ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
SolverChoice Struct Reference

#include <ERF_DataStruct.H>

Collaboration diagram for SolverChoice:

Public Member Functions

void init_params (int max_level)
 
void check_params (int max_level)
 
void display (int max_level)
 
void build_coriolis_forcings ()
 
void read_int_string (int max_level, const char *string_to_read, amrex::Vector< int > &vec_to_fill, int default_int)
 

Static Public Member Functions

static void set_flat_terrain_flag ()
 

Public Attributes

AdvChoice advChoice
 
DiffChoice diffChoice
 
SpongeChoice spongeChoice
 
amrex::Vector< TurbChoiceturbChoice
 
std::string pp_prefix {"erf"}
 
int force_stage1_single_substep = 1
 
amrex::Vector< SubsteppingType > substepping_type
 
amrex::Vector< int > anelastic
 
int constant_density = 0
 
int ncorr = 1
 
amrex::Real poisson_abstol = 1e-10
 
amrex::Real poisson_reltol = 1e-10
 
bool test_mapfactor = false
 
int buoyancy_type = 1
 
bool use_gravity = false
 
bool use_coriolis = false
 
bool coriolis_3d = true
 
bool rayleigh_damp_U = false
 
bool rayleigh_damp_V = false
 
bool rayleigh_damp_W = false
 
bool rayleigh_damp_T = false
 
amrex::Real rayleigh_dampcoef = 0.2
 
amrex::Real rayleigh_zdamp = 500.0
 
amrex::Real rayleigh_ztop
 
bool use_lagged_delta_rt = true
 
amrex::Real gravity
 
amrex::Real c_p = Cp_d
 
amrex::Real rdOcp
 
amrex::Real grid_stretching_ratio = 0
 
amrex::Real zsurf = 0.0
 
amrex::Real dz0
 
bool project_initial_velocity = false
 
amrex::Real coriolis_factor = 0.0
 
amrex::Real cosphi = 0.0
 
amrex::Real sinphi = 0.0
 
bool custom_rhotheta_forcing = false
 
bool custom_moisture_forcing = false
 
bool custom_w_subsidence = false
 
bool custom_geostrophic_profile = false
 
bool custom_forcing_prim_vars = false
 
bool nudging_from_input_sounding = false
 
bool use_explicit_most = false
 
bool use_rotate_most = false
 
bool time_avg_vel = false
 
PerturbationType pert_type
 
bool use_num_diff {false}
 
amrex::Real num_diff_coeff {0.}
 
bool use_mono_adv {false}
 
CouplingType coupling_type
 
MoistureType moisture_type
 
WindFarmType windfarm_type
 
WindFarmLocType windfarm_loc_type
 
LandSurfaceType lsm_type
 
ABLDriverType abl_driver_type
 
amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > abl_pressure_grad
 
amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > abl_geo_forcing
 
std::string abl_geo_wind_table
 
bool have_geo_wind_profile {false}
 
int ave_plane {2}
 
bool do_cloud {true}
 
bool do_precip {true}
 
bool use_moist_background {false}
 
int RhoQv_comp {-1}
 
int RhoQc_comp {-1}
 
int RhoQr_comp {-1}
 
std::string windfarm_loc_table
 
std::string windfarm_spec_table
 
std::string windfarm_spec_table_extra
 
std::string windfarm_blade_table
 
std::string windfarm_airfoil_tables
 
amrex::Real sampling_distance_by_D = -1.0
 
amrex::Real turb_disk_angle = -1.0
 
amrex::Real windfarm_x_shift = -1.0
 
amrex::Real windfarm_y_shift = -1.0
 
bool do_forest_drag {false}
 
bool do_terrain_drag {false}
 

Static Public Attributes

static bool terrain_is_flat = false
 
static TerrainType terrain_type = TerrainType::None
 
static MeshType mesh_type = MeshType::ConstantDz
 

Detailed Description

Container holding many of the algorithmic options and parameters

Member Function Documentation

◆ build_coriolis_forcings()

void SolverChoice::build_coriolis_forcings ( )
inline
505  {
506  amrex::ParmParse pp(pp_prefix);
507 
508  // Read the rotational time period (in seconds)
509  amrex::Real rot_time_period = 86400.0;
510  pp.query("rotational_time_period", rot_time_period);
511 
512  coriolis_factor = 2.0 * 2.0 * PI / rot_time_period;
513 
514  amrex::Real latitude = 90.0;
515  pp.query("latitude", latitude);
516 
517  pp.query("coriolis_3d", coriolis_3d);
518 
519  // Convert to radians
520  latitude *= (PI/180.);
521  sinphi = std::sin(latitude);
522  if (coriolis_3d) {
523  cosphi = std::cos(latitude);
524  }
525 
526  amrex::Print() << "Coriolis frequency, f = " << coriolis_factor * sinphi << " 1/s" << std::endl;
527 
528  if (abl_driver_type == ABLDriverType::GeostrophicWind) {
529  // Read in the geostrophic wind -- we only use this to construct
530  // the forcing term so no need to keep it
531  amrex::Vector<amrex::Real> abl_geo_wind(3);
532  pp.queryarr("abl_geo_wind",abl_geo_wind);
533 
534  if(!pp.query("abl_geo_wind_table",abl_geo_wind_table)) {
535  abl_geo_forcing = {
536  -coriolis_factor * (abl_geo_wind[1]*sinphi - abl_geo_wind[2]*cosphi),
537  coriolis_factor * abl_geo_wind[0]*sinphi,
538  -coriolis_factor * abl_geo_wind[0]*cosphi
539  };
540  } else {
541  amrex::Print() << "NOTE: abl_geo_wind_table provided, ignoring input abl_geo_wind" << std::endl;
542  }
543  }
544  }
constexpr amrex::Real PI
Definition: ERF_Constants.H:6
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real pp(amrex::Real y)
Definition: ERF_MicrophysicsUtils.H:219
amrex::Real coriolis_factor
Definition: ERF_DataStruct.H:629
amrex::Real cosphi
Definition: ERF_DataStruct.H:630
std::string pp_prefix
Definition: ERF_DataStruct.H:584
amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > abl_geo_forcing
Definition: ERF_DataStruct.H:671
amrex::Real sinphi
Definition: ERF_DataStruct.H:631
bool coriolis_3d
Definition: ERF_DataStruct.H:603
std::string abl_geo_wind_table
Definition: ERF_DataStruct.H:672
ABLDriverType abl_driver_type
Definition: ERF_DataStruct.H:669

Referenced by init_params().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ check_params()

void SolverChoice::check_params ( int  max_level)
inline
392  {
393  // Warn for PBL models and moisture - these may not yet be compatible
394  for (int lev = 0; lev <= max_level; lev++) {
395  if ((moisture_type != MoistureType::None) && (turbChoice[lev].pbl_type != PBLType::None)) {
396  amrex::Warning("\n*** WARNING: Moisture may not yet be compatible with PBL models, \n proceed with caution ***");
397  }
398  }
399  //
400  // Buoyancy type check
401  //
402  if (buoyancy_type != 1 && buoyancy_type != 2 && buoyancy_type != 3 && buoyancy_type != 4) {
403  amrex::Abort("buoyancy_type must be 1, 2, 3 or 4");
404  }
405 
406  if (!use_lagged_delta_rt && !(terrain_type == TerrainType::Moving)) {
407  amrex::Error("Can't turn off lagged_delta_rt when terrain not moving");
408  }
409 
410  //
411  // Wind farm checks
412  //
413  if (windfarm_type==WindFarmType::SimpleAD and sampling_distance_by_D < 0.0) {
414  amrex::Abort("To use simplified actuator disks, you need to provide a variable"
415  " erf.sampling_distance_by_D in the inputs which specifies the upstream"
416  " distance as a factor of the turbine diameter at which the incoming free stream"
417  " velocity will be computed at.");
418  }
419  if ( (windfarm_type==WindFarmType::SimpleAD ||
420  windfarm_type==WindFarmType::GeneralAD ) && turb_disk_angle < 0.0) {
421  amrex::Abort("To use simplified actuator disks, you need to provide a variable"
422  " erf.turb_disk_angle_from_x in the inputs which is the angle of the face of the"
423  " turbine disk from the x-axis. A turbine facing an oncoming flow in the x-direction"
424  " will have turb_disk_angle value of 90 deg.");
425  }
426  if (windfarm_loc_type == WindFarmLocType::lat_lon and (windfarm_x_shift < 0.0 or windfarm_y_shift < 0.0)) {
427  amrex::Abort("You are using windfarms with latitude-logitude option to position the turbines."
428  " For this you should provide the inputs erf.windfarm_x_shift and"
429  " erf.windfarm_y_shift which are the values by which the bounding box of the"
430  " windfarm is shifted from the x and the y axes.");
431  }
432  }
bool use_lagged_delta_rt
Definition: ERF_DataStruct.H:614
amrex::Real windfarm_x_shift
Definition: ERF_DataStruct.H:693
WindFarmLocType windfarm_loc_type
Definition: ERF_DataStruct.H:666
amrex::Real sampling_distance_by_D
Definition: ERF_DataStruct.H:691
amrex::Vector< TurbChoice > turbChoice
Definition: ERF_DataStruct.H:581
MoistureType moisture_type
Definition: ERF_DataStruct.H:664
static TerrainType terrain_type
Definition: ERF_DataStruct.H:567
WindFarmType windfarm_type
Definition: ERF_DataStruct.H:665
int buoyancy_type
Definition: ERF_DataStruct.H:598
amrex::Real turb_disk_angle
Definition: ERF_DataStruct.H:692
amrex::Real windfarm_y_shift
Definition: ERF_DataStruct.H:694

Referenced by init_params().

Here is the caller graph for this function:

◆ display()

void SolverChoice::display ( int  max_level)
inline
435  {
436  amrex::Print() << "SOLVER CHOICE: " << std::endl;
437  amrex::Print() << "force_stage1_single_substep : " << force_stage1_single_substep << std::endl;
438  for (int lev = 0; lev <= max_level; lev++) {
439  amrex::Print() << "anelastic at level : " << lev << " is " << anelastic[lev] << std::endl;
440  if (substepping_type[lev] == SubsteppingType::None) {
441  amrex::Print() << "No substepping at level " << lev << std::endl;
442  } else if (substepping_type[lev] == SubsteppingType::Explicit) {
443  amrex::Print() << "Explicit substepping at level " << lev << std::endl;
444  } else if (substepping_type[lev] == SubsteppingType::Implicit) {
445  amrex::Print() << "Implicit substepping at level " << lev << std::endl;
446  }
447  }
448  amrex::Print() << "use_coriolis : " << use_coriolis << std::endl;
449  amrex::Print() << "use_gravity : " << use_gravity << std::endl;
450 
451  amrex::Print() << "Terrain Type: " << std::endl;
452  if (terrain_type == TerrainType::Static) {
453  amrex::Print() << " Static" << std::endl;
454  } else if (terrain_type == TerrainType::Moving) {
455  amrex::Print() << " Moving" << std::endl;
456  } else {
457  amrex::Print() << " None" << std::endl;
458  }
459 
460  amrex::Print() << " Mesh Type: " << std::endl;
461  if (mesh_type == MeshType::ConstantDz) {
462  amrex::Print() << " ConstantDz" << std::endl;
463  } else if (mesh_type == MeshType::StretchedDz) {
464  amrex::Print() << " StretchedDz" << std::endl;
465  } else if (mesh_type == MeshType::VariableDz) {
466  amrex::Print() << " VariableDz" << std::endl;
467  } else {
468  amrex::Abort("No mesh_type set!");
469  }
470 
471  amrex::Print() << "ABL Driver Type: " << std::endl;
472  if (abl_driver_type == ABLDriverType::None) {
473  amrex::Print() << " None" << std::endl;
474  } else if (abl_driver_type == ABLDriverType::PressureGradient) {
475  amrex::Print() << " Pressure Gradient "
476  << amrex::RealVect(abl_pressure_grad[0],abl_pressure_grad[1],abl_pressure_grad[2])
477  << std::endl;
478  } else if (abl_driver_type == ABLDriverType::GeostrophicWind) {
479  amrex::Print() << " Geostrophic Wind "
480  << amrex::RealVect(abl_geo_forcing[0],abl_geo_forcing[1],abl_geo_forcing[2])
481  << std::endl;
482  }
483 
484  if (max_level > 0) {
485  amrex::Print() << "Coupling Type: " << std::endl;
486  if (coupling_type == CouplingType::TwoWay) {
487  amrex::Print() << " Two-way" << std::endl;
488  } else if (coupling_type == CouplingType::OneWay) {
489  amrex::Print() << " One-way" << std::endl;
490  }
491  }
492 
493  amrex::Print() << "Buoyancy_type : " << buoyancy_type << std::endl;
494 
495  advChoice.display();
498 
499  for (int lev = 0; lev <= max_level; lev++) {
500  turbChoice[lev].display(lev);
501  }
502  }
void display()
Definition: ERF_AdvStruct.H:190
void display()
Definition: ERF_DiffStruct.H:64
static MeshType mesh_type
Definition: ERF_DataStruct.H:570
DiffChoice diffChoice
Definition: ERF_DataStruct.H:579
bool use_gravity
Definition: ERF_DataStruct.H:601
int force_stage1_single_substep
Definition: ERF_DataStruct.H:586
amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > abl_pressure_grad
Definition: ERF_DataStruct.H:670
amrex::Vector< SubsteppingType > substepping_type
Definition: ERF_DataStruct.H:588
bool use_coriolis
Definition: ERF_DataStruct.H:602
amrex::Vector< int > anelastic
Definition: ERF_DataStruct.H:589
AdvChoice advChoice
Definition: ERF_DataStruct.H:578
SpongeChoice spongeChoice
Definition: ERF_DataStruct.H:580
CouplingType coupling_type
Definition: ERF_DataStruct.H:663
void display()
Definition: ERF_SpongeStruct.H:45
Here is the call graph for this function:

◆ init_params()

void SolverChoice::init_params ( int  max_level)
inline
85  {
86  amrex::ParmParse pp(pp_prefix);
87 
88  pp.query("grid_stretching_ratio", grid_stretching_ratio);
89  if (grid_stretching_ratio != 0) {
90  AMREX_ASSERT_WITH_MESSAGE((grid_stretching_ratio >= 1.),
91  "The grid stretching ratio must be greater than 1");
92  }
93  if (grid_stretching_ratio >= 1) {
94  if (mesh_type == MeshType::ConstantDz) {
95  mesh_type = MeshType::StretchedDz;
96  }
97  if (terrain_type != TerrainType::Static) {
98  amrex::Print() << "Turning terrain on to enable grid stretching" << std::endl;
99  terrain_type = TerrainType::Static;
100  }
101  pp.query("zsurface", zsurf);
102  if (zsurf != 0.0) {
103  amrex::Print() << "Nominal zsurface height != 0, may result in unexpected behavior"
104  << std::endl;
105  }
106  pp.get("initial_dz", dz0);
107  }
108 
109  // Do we set map scale factors to 0.5 instead of 1 for testing?
110  pp.query("test_mapfactor", test_mapfactor);
111 
112  // What type of moisture model to use?
113  moisture_type = MoistureType::None; // Default
114  pp.query_enum_case_insensitive("moisture_model",moisture_type);
115  if (moisture_type == MoistureType::SAM) {
119  } else if (moisture_type == MoistureType::SAM_NoIce) {
123  } else if (moisture_type == MoistureType::SAM_NoPrecip_NoIce) {
126  } else if (moisture_type == MoistureType::Kessler) {
130  } else if (moisture_type == MoistureType::Kessler_NoRain) {
133  } else if (moisture_type == MoistureType::SatAdj) {
136  }
137 
138  // TODO: should we set default for dry??
139  // Set a different default for moist vs dry
140  if (moisture_type != MoistureType::None) {
141  if (moisture_type == MoistureType::Kessler_NoRain ||
142  moisture_type == MoistureType::SAM ||
143  moisture_type == MoistureType::SAM_NoIce ||
144  moisture_type == MoistureType::SAM_NoPrecip_NoIce ||
145  moisture_type == MoistureType::SatAdj)
146  {
147  buoyancy_type = 1; // uses Rhoprime
148  } else {
149  buoyancy_type = 2; // uses Tprime
150  }
151  }
152 
153  // Which expression (1,2/3 or 4) to use for buoyancy
154  pp.query("buoyancy_type", buoyancy_type);
155 
156  // What type of land surface model to use
157  lsm_type = LandSurfaceType::None; // Default
158  pp.query_enum_case_insensitive("land_surface_model",lsm_type);
159 
160  // Is the terrain none, static or moving?
161  pp.query_enum_case_insensitive("terrain_type",terrain_type);
162 
163  if (terrain_type != TerrainType::None) {
164  mesh_type = MeshType::VariableDz;
165  }
166 
167  int n_zlevels = pp.countval("terrain_z_levels");
168  if (n_zlevels > 0)
169  {
170  if (terrain_type == TerrainType::None) {
171  terrain_type = TerrainType::Static;
172  }
173  if (mesh_type == MeshType::ConstantDz) {
174  mesh_type = MeshType::StretchedDz;
175  }
176  }
177 
178  // Use lagged_delta_rt in the fast integrator?
179  pp.query("use_lagged_delta_rt", use_lagged_delta_rt);
180 
181  // These default to true but are used for unit testing
182  pp.query("use_gravity", use_gravity);
184 
185  pp.query("c_p", c_p);
186  rdOcp = R_d / c_p;
187 
188  read_int_string(max_level, "anelastic", anelastic, 0);
189 
190  // *******************************************************************************
191  // Read substepping_type and allow for different values at each level
192  // *******************************************************************************
193  substepping_type.resize(max_level+1);
194 
195  for (int i = 0; i <= max_level; i++) {
196  substepping_type[i] = SubsteppingType::Implicit;
197  }
198 
199  int nvals = pp.countval("substepping_type");
200  AMREX_ALWAYS_ASSERT(nvals == 0 || nvals == 1 || nvals >= max_level+1);
201 
202  if (nvals == 1) {
203  pp.query_enum_case_insensitive("substepping_type",substepping_type[0]);
204  for (int i = 1; i <= max_level; i++) {
206  }
207  } else if (nvals > 1) { // in this case we have asserted nvals >= max_level+1
208  for (int i = 0; i <= max_level; i++) {
209  pp.query_enum_case_insensitive("substepping_type",substepping_type[i],i);
210  }
211  }
212 
213  // *******************************************************************************
214  // Error check on deprecated input
215  // *******************************************************************************
216  int nvals_old = pp.countval("no_substepping");
217  if (nvals_old > 0) {
218  amrex::Abort("The no_substepping flag is deprecated -- set substepping_type instead");
219  }
220  // *******************************************************************************
221 
222  bool any_anelastic = false;
223  for (int i = 0; i <= max_level; ++i) {
224  if (anelastic[i] == 1) any_anelastic = true;
225  }
226 
227  // If anelastic at all, we do not advect rho -- it is always == rho0
228  if (any_anelastic == 1) {
229  constant_density = true;
231  buoyancy_type = 3; // (This isn't actually used when anelastic is set)
232  } else {
233  pp.query("project_initial_velocity", project_initial_velocity);
234 
235  constant_density = false; // We default to false but allow the user to set it
236  pp.query("constant_density", constant_density);
237  }
238 
239  // *******************************************************************************
240 
241  pp.query("ncorr", ncorr);
242  pp.query("poisson_abstol", poisson_abstol);
243  pp.query("poisson_reltol", poisson_reltol);
244 
245  for (int lev = 0; lev <= max_level; lev++) {
246  if (anelastic[lev] != 0)
247  {
248  substepping_type[lev] = SubsteppingType::None;
249  }
250  }
251 
252  pp.query("force_stage1_single_substep", force_stage1_single_substep);
253 
254  // Include Coriolis forcing?
255  pp.query("use_coriolis", use_coriolis);
256 
257  // Include Rayleigh damping (separate flags for each variable)
258  pp.query("rayleigh_damp_U", rayleigh_damp_U);
259  pp.query("rayleigh_damp_V", rayleigh_damp_V);
260  pp.query("rayleigh_damp_W", rayleigh_damp_W);
261  pp.query("rayleigh_damp_T", rayleigh_damp_T);
262  pp.query("rayleigh_dampcoef", rayleigh_dampcoef);
263  pp.query("rayleigh_zdamp", rayleigh_zdamp);
264 
265  // Flag to do explicit MOST formulation
266  pp.query("use_explicit_most",use_explicit_most);
267 
268  // Flag to do MOST rotations with terrain
269  pp.query("use_rotate_most",use_rotate_most);
270  if (use_rotate_most) {
271  AMREX_ASSERT_WITH_MESSAGE(terrain_type != TerrainType::None,"MOST stress rotations are only valid with terrain!");
272  AMREX_ASSERT_WITH_MESSAGE(use_explicit_most, "MOST Stress rotations are only valid with explicit MOST!");
273  }
274 
275  // Which external forcings?
276  abl_driver_type = ABLDriverType::None; // Default: no ABL driver for simulating classical fluid dynamics problems
277  pp.query_enum_case_insensitive("abl_driver_type",abl_driver_type);
278 
279  // Which type of inflow turbulent generation
280  pert_type = PerturbationType::None; // Default
281  pp.query_enum_case_insensitive("perturbation_type",pert_type);
282 
283  amrex::Vector<amrex::Real> abl_pressure_grad_in = {0.0, 0.0, 0.0};
284  pp.queryarr("abl_pressure_grad",abl_pressure_grad_in);
285  for(int i = 0; i < AMREX_SPACEDIM; ++i) abl_pressure_grad[i] = abl_pressure_grad_in[i];
286 
287  amrex::Vector<amrex::Real> abl_geo_forcing_in = {0.0, 0.0, 0.0};
288  if(pp.queryarr("abl_geo_forcing",abl_geo_forcing_in)) {
289  amrex::Print() << "Specified abl_geo_forcing: (";
290  for (int i = 0; i < AMREX_SPACEDIM; ++i) {
291  abl_geo_forcing[i] = abl_geo_forcing_in[i];
292  amrex::Print() << abl_geo_forcing[i] << " ";
293  }
294  amrex::Print() << ")" << std::endl;
295  }
296 
297  if (use_coriolis)
298  {
300  }
301 
302  pp.query("add_custom_rhotheta_forcing", custom_rhotheta_forcing);
303  pp.query("add_custom_moisture_forcing", custom_moisture_forcing);
304  pp.query("add_custom_w_subsidence", custom_w_subsidence);
305  pp.query("add_custom_geostrophic_profile", custom_geostrophic_profile);
306  pp.query("custom_forcing_uses_primitive_vars", custom_forcing_prim_vars);
307 
308  pp.query("nudging_from_input_sounding", nudging_from_input_sounding);
309 
311  AMREX_ALWAYS_ASSERT_WITH_MESSAGE(!(!abl_geo_wind_table.empty() && custom_geostrophic_profile),
312  "Should not have both abl_geo_wind_table and custom_geostrophic_profile set.");
313 
314  pp.query("Ave_Plane", ave_plane);
315 
316  pp.query("mp_clouds", do_cloud);
317  pp.query("mp_precip", do_precip);
318  pp.query("use_moist_background", use_moist_background);
319 
320  // Use numerical diffusion?
321  pp.query("num_diff_coeff",num_diff_coeff);
322  AMREX_ASSERT_WITH_MESSAGE(( (num_diff_coeff >= 0.) && (num_diff_coeff <= 1.) ),
323  "Numerical diffusion coefficient must be between 0 & 1.");
325  if (use_num_diff) {
326  amrex::Print() << "6th-order numerical diffusion turned on with coefficient = "
327  << num_diff_coeff << std::endl;
328  num_diff_coeff *= std::pow(2.0,-6);
329  }
330 
331  // Use monotonic advection?
332  pp.query("use_mono_adv",use_mono_adv);
333 
337 
338  turbChoice.resize(max_level+1);
339  for (int lev = 0; lev <= max_level; lev++) {
340  turbChoice[lev].init_params(lev,max_level);
341  }
342 
343  // YSU PBL: use consistent coriolis frequency
344  for (int lev = 0; lev <= max_level; lev++) {
345  if (turbChoice[lev].pbl_ysu_use_consistent_coriolis) {
346  if (use_coriolis) {
347  turbChoice[lev].pbl_ysu_coriolis_freq = coriolis_factor * sinphi;
348  if (lev == 0) {
349  amrex::Print() << "YSU PBL using ERF coriolis frequency: " << turbChoice[lev].pbl_ysu_coriolis_freq << std::endl;
350  }
351  } else {
352  amrex::Abort("YSU cannot use ERF coriolis frequency if not using coriolis");
353  }
354  }
355  }
356 
357 
358  // Which type of multilevel coupling
359  coupling_type = CouplingType::TwoWay; // Default
360  pp.query_enum_case_insensitive("coupling_type",coupling_type);
361 
362  // Which type of windfarm model
363  windfarm_type = WindFarmType::None; // Default
364  pp.query_enum_case_insensitive("windfarm_type",windfarm_type);
365 
366  static std::string windfarm_loc_type_string = "None";
367  windfarm_loc_type = WindFarmLocType::None;
368  pp.query_enum_case_insensitive("windfarm_loc_type",windfarm_loc_type);
369 
370  pp.query("windfarm_loc_table", windfarm_loc_table);
371  pp.query("windfarm_spec_table", windfarm_spec_table);
372  pp.query("windfarm_blade_table", windfarm_blade_table);
373  pp.query("windfarm_airfoil_tables", windfarm_airfoil_tables);
374  pp.query("windfarm_spec_table_extra", windfarm_spec_table_extra);
375 
376  // Sampling distance upstream of the turbine to find the
377  // incoming free stream velocity as a factor of the diameter of the
378  // turbine. ie. the sampling distance will be this number multiplied
379  // by the diameter of the turbine
380  pp.query("sampling_distance_by_D", sampling_distance_by_D);
381  pp.query("turb_disk_angle_from_x", turb_disk_angle);
382 
383  pp.query("windfarm_x_shift",windfarm_x_shift);
384  pp.query("windfarm_y_shift",windfarm_y_shift);
385  // Test if time averaged data is to be output
386  pp.query("time_avg_vel",time_avg_vel);
387 
388  check_params(max_level);
389  }
constexpr amrex::Real CONST_GRAV
Definition: ERF_Constants.H:21
constexpr amrex::Real R_d
Definition: ERF_Constants.H:10
#define RhoQ4_comp
Definition: ERF_IndexDefines.H:45
#define RhoQ2_comp
Definition: ERF_IndexDefines.H:43
#define RhoQ3_comp
Definition: ERF_IndexDefines.H:44
#define RhoQ1_comp
Definition: ERF_IndexDefines.H:42
void init_params()
Definition: ERF_AdvStruct.H:21
void init_params()
Definition: ERF_DiffStruct.H:21
bool rayleigh_damp_T
Definition: ERF_DataStruct.H:608
amrex::Real dz0
Definition: ERF_DataStruct.H:624
bool use_explicit_most
Definition: ERF_DataStruct.H:645
bool rayleigh_damp_V
Definition: ERF_DataStruct.H:606
int RhoQr_comp
Definition: ERF_DataStruct.H:687
amrex::Real poisson_reltol
Definition: ERF_DataStruct.H:594
amrex::Real rayleigh_zdamp
Definition: ERF_DataStruct.H:610
amrex::Real rdOcp
Definition: ERF_DataStruct.H:619
void read_int_string(int max_level, const char *string_to_read, amrex::Vector< int > &vec_to_fill, int default_int)
Definition: ERF_DataStruct.H:546
std::string windfarm_spec_table
Definition: ERF_DataStruct.H:689
bool use_mono_adv
Definition: ERF_DataStruct.H:661
void build_coriolis_forcings()
Definition: ERF_DataStruct.H:504
int ncorr
Definition: ERF_DataStruct.H:592
std::string windfarm_spec_table_extra
Definition: ERF_DataStruct.H:689
LandSurfaceType lsm_type
Definition: ERF_DataStruct.H:667
amrex::Real c_p
Definition: ERF_DataStruct.H:618
std::string windfarm_loc_table
Definition: ERF_DataStruct.H:689
amrex::Real gravity
Definition: ERF_DataStruct.H:617
void check_params(int max_level)
Definition: ERF_DataStruct.H:391
bool custom_rhotheta_forcing
Definition: ERF_DataStruct.H:634
bool custom_w_subsidence
Definition: ERF_DataStruct.H:636
bool nudging_from_input_sounding
Definition: ERF_DataStruct.H:642
bool rayleigh_damp_U
Definition: ERF_DataStruct.H:605
int RhoQc_comp
Definition: ERF_DataStruct.H:681
bool custom_geostrophic_profile
Definition: ERF_DataStruct.H:637
amrex::Real grid_stretching_ratio
Definition: ERF_DataStruct.H:622
bool have_geo_wind_profile
Definition: ERF_DataStruct.H:673
bool do_precip
Definition: ERF_DataStruct.H:678
bool use_num_diff
Definition: ERF_DataStruct.H:657
int RhoQv_comp
Definition: ERF_DataStruct.H:680
bool test_mapfactor
Definition: ERF_DataStruct.H:596
bool custom_moisture_forcing
Definition: ERF_DataStruct.H:635
amrex::Real num_diff_coeff
Definition: ERF_DataStruct.H:658
std::string windfarm_blade_table
Definition: ERF_DataStruct.H:690
amrex::Real zsurf
Definition: ERF_DataStruct.H:623
bool project_initial_velocity
Definition: ERF_DataStruct.H:626
int constant_density
Definition: ERF_DataStruct.H:591
bool use_moist_background
Definition: ERF_DataStruct.H:679
bool custom_forcing_prim_vars
Definition: ERF_DataStruct.H:638
bool rayleigh_damp_W
Definition: ERF_DataStruct.H:607
PerturbationType pert_type
Definition: ERF_DataStruct.H:654
amrex::Real poisson_abstol
Definition: ERF_DataStruct.H:593
bool time_avg_vel
Definition: ERF_DataStruct.H:651
bool do_cloud
Definition: ERF_DataStruct.H:677
bool use_rotate_most
Definition: ERF_DataStruct.H:648
amrex::Real rayleigh_dampcoef
Definition: ERF_DataStruct.H:609
std::string windfarm_airfoil_tables
Definition: ERF_DataStruct.H:690
int ave_plane
Definition: ERF_DataStruct.H:675
void init_params()
Definition: ERF_SpongeStruct.H:17
Here is the call graph for this function:

◆ read_int_string()

void SolverChoice::read_int_string ( int  max_level,
const char *  string_to_read,
amrex::Vector< int > &  vec_to_fill,
int  default_int 
)
inline
548  {
549  amrex::ParmParse pp("erf");
550  int nvals = pp.countval(string_to_read);
551  AMREX_ALWAYS_ASSERT(nvals == 0 || nvals == 1 || nvals >= max_level+1);
552  amrex::Vector<int> temp; temp.resize(nvals);
553  pp.queryarr(string_to_read,temp);
554  if (nvals == 0) {
555  for (int i = 0; i <= max_level; ++i) vec_to_fill.push_back(default_int);
556  } else if (nvals == 1) {
557  for (int i = 0; i <= max_level; ++i) vec_to_fill.push_back(temp[0]);
558  } else {
559  for (int i = 0; i <= max_level; ++i) vec_to_fill.push_back(temp[i]);
560  }
561  }

Referenced by init_params().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_flat_terrain_flag()

static void SolverChoice::set_flat_terrain_flag ( )
inlinestatic
574  {
575  terrain_is_flat = true;
576  }
static bool terrain_is_flat
Definition: ERF_DataStruct.H:564

Referenced by ProblemBase::init_custom_terrain().

Here is the caller graph for this function:

Member Data Documentation

◆ abl_driver_type

ABLDriverType SolverChoice::abl_driver_type

◆ abl_geo_forcing

amrex::GpuArray<amrex::Real, AMREX_SPACEDIM> SolverChoice::abl_geo_forcing

◆ abl_geo_wind_table

std::string SolverChoice::abl_geo_wind_table

◆ abl_pressure_grad

amrex::GpuArray<amrex::Real, AMREX_SPACEDIM> SolverChoice::abl_pressure_grad

◆ advChoice

AdvChoice SolverChoice::advChoice

◆ anelastic

amrex::Vector<int> SolverChoice::anelastic

◆ ave_plane

int SolverChoice::ave_plane {2}

◆ buoyancy_type

int SolverChoice::buoyancy_type = 1

◆ c_p

amrex::Real SolverChoice::c_p = Cp_d

◆ constant_density

int SolverChoice::constant_density = 0

Referenced by erf_slow_rhs_pre(), and init_params().

◆ coriolis_3d

bool SolverChoice::coriolis_3d = true

Referenced by build_coriolis_forcings().

◆ coriolis_factor

amrex::Real SolverChoice::coriolis_factor = 0.0

◆ cosphi

amrex::Real SolverChoice::cosphi = 0.0

◆ coupling_type

CouplingType SolverChoice::coupling_type

◆ custom_forcing_prim_vars

bool SolverChoice::custom_forcing_prim_vars = false

◆ custom_geostrophic_profile

bool SolverChoice::custom_geostrophic_profile = false

Referenced by init_params().

◆ custom_moisture_forcing

bool SolverChoice::custom_moisture_forcing = false

Referenced by init_params(), and make_sources().

◆ custom_rhotheta_forcing

bool SolverChoice::custom_rhotheta_forcing = false

Referenced by init_params(), and make_sources().

◆ custom_w_subsidence

bool SolverChoice::custom_w_subsidence = false

◆ diffChoice

◆ do_cloud

bool SolverChoice::do_cloud {true}

◆ do_forest_drag

bool SolverChoice::do_forest_drag {false}

Referenced by make_mom_sources().

◆ do_precip

bool SolverChoice::do_precip {true}

◆ do_terrain_drag

bool SolverChoice::do_terrain_drag {false}

Referenced by make_mom_sources().

◆ dz0

amrex::Real SolverChoice::dz0

Referenced by init_params().

◆ force_stage1_single_substep

int SolverChoice::force_stage1_single_substep = 1

Referenced by display(), and init_params().

◆ gravity

amrex::Real SolverChoice::gravity

◆ grid_stretching_ratio

amrex::Real SolverChoice::grid_stretching_ratio = 0

Referenced by init_params().

◆ have_geo_wind_profile

bool SolverChoice::have_geo_wind_profile {false}

Referenced by init_params(), and make_mom_sources().

◆ lsm_type

LandSurfaceType SolverChoice::lsm_type

Referenced by init_params().

◆ mesh_type

◆ moisture_type

◆ ncorr

int SolverChoice::ncorr = 1

Referenced by init_params().

◆ nudging_from_input_sounding

bool SolverChoice::nudging_from_input_sounding = false

◆ num_diff_coeff

amrex::Real SolverChoice::num_diff_coeff {0.}

◆ pert_type

PerturbationType SolverChoice::pert_type

Referenced by init_params(), and make_sources().

◆ poisson_abstol

amrex::Real SolverChoice::poisson_abstol = 1e-10

Referenced by init_params().

◆ poisson_reltol

amrex::Real SolverChoice::poisson_reltol = 1e-10

Referenced by init_params().

◆ pp_prefix

std::string SolverChoice::pp_prefix {"erf"}

◆ project_initial_velocity

bool SolverChoice::project_initial_velocity = false

Referenced by init_params().

◆ rayleigh_damp_T

bool SolverChoice::rayleigh_damp_T = false

Referenced by init_params(), and make_sources().

◆ rayleigh_damp_U

bool SolverChoice::rayleigh_damp_U = false

Referenced by init_params(), and make_mom_sources().

◆ rayleigh_damp_V

bool SolverChoice::rayleigh_damp_V = false

Referenced by init_params(), and make_mom_sources().

◆ rayleigh_damp_W

bool SolverChoice::rayleigh_damp_W = false

Referenced by init_params(), and make_mom_sources().

◆ rayleigh_dampcoef

amrex::Real SolverChoice::rayleigh_dampcoef = 0.2

◆ rayleigh_zdamp

amrex::Real SolverChoice::rayleigh_zdamp = 500.0

◆ rayleigh_ztop

amrex::Real SolverChoice::rayleigh_ztop

Referenced by make_mom_sources(), and make_sources().

◆ rdOcp

amrex::Real SolverChoice::rdOcp

◆ RhoQc_comp

int SolverChoice::RhoQc_comp {-1}

◆ RhoQr_comp

int SolverChoice::RhoQr_comp {-1}

◆ RhoQv_comp

int SolverChoice::RhoQv_comp {-1}

◆ sampling_distance_by_D

amrex::Real SolverChoice::sampling_distance_by_D = -1.0

Referenced by check_params(), and init_params().

◆ sinphi

amrex::Real SolverChoice::sinphi = 0.0

◆ spongeChoice

SpongeChoice SolverChoice::spongeChoice

◆ substepping_type

amrex::Vector<SubsteppingType> SolverChoice::substepping_type

Referenced by display(), and init_params().

◆ terrain_is_flat

bool SolverChoice::terrain_is_flat = false
inlinestatic

Referenced by set_flat_terrain_flag().

◆ terrain_type

TerrainType SolverChoice::terrain_type = TerrainType::None
inlinestatic

◆ test_mapfactor

bool SolverChoice::test_mapfactor = false

Referenced by init_params().

◆ time_avg_vel

bool SolverChoice::time_avg_vel = false

Referenced by init_params().

◆ turb_disk_angle

amrex::Real SolverChoice::turb_disk_angle = -1.0

Referenced by check_params(), and init_params().

◆ turbChoice

◆ use_coriolis

bool SolverChoice::use_coriolis = false

◆ use_explicit_most

bool SolverChoice::use_explicit_most = false

◆ use_gravity

bool SolverChoice::use_gravity = false

Referenced by display(), and init_params().

◆ use_lagged_delta_rt

bool SolverChoice::use_lagged_delta_rt = true

Referenced by check_params(), and init_params().

◆ use_moist_background

bool SolverChoice::use_moist_background {false}

Referenced by init_params().

◆ use_mono_adv

bool SolverChoice::use_mono_adv {false}

◆ use_num_diff

bool SolverChoice::use_num_diff {false}

Referenced by init_params(), and make_sources().

◆ use_rotate_most

bool SolverChoice::use_rotate_most = false

◆ windfarm_airfoil_tables

std::string SolverChoice::windfarm_airfoil_tables

Referenced by init_params().

◆ windfarm_blade_table

std::string SolverChoice::windfarm_blade_table

Referenced by init_params().

◆ windfarm_loc_table

std::string SolverChoice::windfarm_loc_table

Referenced by init_params().

◆ windfarm_loc_type

WindFarmLocType SolverChoice::windfarm_loc_type

Referenced by check_params(), and init_params().

◆ windfarm_spec_table

std::string SolverChoice::windfarm_spec_table

Referenced by init_params().

◆ windfarm_spec_table_extra

std::string SolverChoice::windfarm_spec_table_extra

Referenced by init_params().

◆ windfarm_type

WindFarmType SolverChoice::windfarm_type

Referenced by check_params(), and init_params().

◆ windfarm_x_shift

amrex::Real SolverChoice::windfarm_x_shift = -1.0

Referenced by check_params(), and init_params().

◆ windfarm_y_shift

amrex::Real SolverChoice::windfarm_y_shift = -1.0

Referenced by check_params(), and init_params().

◆ zsurf

amrex::Real SolverChoice::zsurf = 0.0

Referenced by init_params().


The documentation for this struct was generated from the following file: