Skip to content

Commit

Permalink
changed background_flow option to no_background_flow
Browse files Browse the repository at this point in the history
  • Loading branch information
ta440 committed Sep 5, 2024
1 parent eb00b0e commit 4d0e41a
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions case_studies/transport/nair_lauritzen_divergent.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,18 @@
nair_lauritzen_divergent_defaults = {
'initial_conditions': 'slotted_cylinder', # one of 'slotted_cylinder',
# 'cosine_bells' or 'gaussian'
'background_flow': False, # whether background flow is applied
'ncells_per_edge': 16, # num points per icosahedron edge (ref level 4)
'dt': 900.0, # 15 minutes
'tmax': 12.*24.*60.*60., # 12 days
'dumpfreq': 288, # once every 3 days with default values
'no_background_flow': False, # option to remove the background flow
'ncells_per_edge': 16, # num points per icosahedron edge (ref level 4)
'dt': 900.0, # 15 minutes
'tmax': 12.*24.*60.*60., # 12 days
'dumpfreq': 288, # once every 3 days with default values
'dirname': 'nair_lauritzen_divergent'
}


def nair_lauritzen_divergent(
initial_conditions=nair_lauritzen_divergent_defaults['initial_conditions'],
background_flow=nair_lauritzen_divergent_defaults['background_flow'],
no_background_flow=nair_lauritzen_divergent_defaults['no_background_flow'],
ncells_per_edge=nair_lauritzen_divergent_defaults['ncells_per_edge'],
dt=nair_lauritzen_divergent_defaults['dt'],
tmax=nair_lauritzen_divergent_defaults['tmax'],
Expand All @@ -61,6 +61,8 @@ def nair_lauritzen_divergent(
# Our settings for this set up
# ------------------------------------------------------------------------ #

print(no_background_flow)

degree = 1

# ------------------------------------------------------------------------ #
Expand Down Expand Up @@ -101,7 +103,7 @@ def nair_lauritzen_divergent(
lamda, theta, _ = lonlatr_from_xyz(xyz[0], xyz[1], xyz[2])

# Set up the divergent, time-varying, velocity field
if background_flow:
if not no_background_flow:
def u_t(t):
k = 5.*radius/tau
u_background = 2*pi*radius/tau
Expand Down Expand Up @@ -208,10 +210,11 @@ def u_t(t):
default=nair_lauritzen_divergent_defaults['initial_conditions']
)
parser.add_argument(
'--background_flow',
help="Whether the transporting velocity includes a background flow",
'--no_background_flow',
help="Whether to remove the background flow of the transporting velocity. "
+ "This defaults to False, which means there is a background flow.",
type=bool,
default=nair_lauritzen_divergent_defaults['background_flow']
default=nair_lauritzen_divergent_defaults['no_background_flow']
)
parser.add_argument(
'--ncells_per_edge',
Expand Down

0 comments on commit 4d0e41a

Please sign in to comment.