34 #include "libmesh/getpot.h"
39 const std::string& physics,
62 const std::string& physics,
71 bool have_conductivity_model = input.have_variable(
"Physics/"+physics+
"/conductivity_model");
73 if( (have_material && have_conductivity_model) ||
74 (have_material && have_ht_conductivity_model) )
76 libmesh_error_msg(
"Error: Cannot specify both conductivity_model and material.");
82 if( !have_conductivity_model && !have_material && !have_ht_conductivity_model )
84 std::string warning =
"Warning: Neither conductivity_model nor material were specified.\n";
85 warning +=
" We are assuming a constant conductivity model.\n";
86 warning +=
" This case is DEPRECATED.\n";
87 warning +=
" Please update and specify Physics/"+physics+
"/material.\n";
94 if( have_ht_conductivity_model )
97 warning +=
" Please update to use Physics/"+physics+
"/material.\n";
104 if( have_conductivity_model )
106 std::string warning =
"Warning: Option Physics/"+physics+
"/conductivity_model is DEPRECATED.\n";
107 warning +=
" Please update to use Physics/"+physics+
"/material.\n";
110 model = input(
"Physics/"+physics+
"/conductivity_model",
"constant" );
124 const std::string& physics,
132 if( have_material && have_lmns_specific_heat_model )
138 if( have_lmns_specific_heat_model )
141 warning +=
" Please update to use Physics/"+physics+
"/material.\n";
156 const std::string& physics,
175 if( !have_material &&
196 const std::string& physics,
198 std::string& strain_energy )
204 bool have_elasticity_model = input.have_variable(
"Physics/"+physics+
"/elasticity_model");
207 if( have_elasticity_model &&
208 input.have_variable(
"Materials/"+material+
"/StressStrainLaw/model") )
210 libmesh_error_msg(
"ERROR: Cannot specify both Materials/"+material+
"/StressStrainLaw/model and Physics/"+physics+
"/elasticity_model!");
214 if( !have_elasticity_model &&
215 !input.have_variable(
"Materials/"+material+
"/StressStrainLaw/model") )
218 libmesh_error_msg(
"ERROR: Must specify Materials/"+material+
"/StressStrainLaw/model!");
222 if( have_elasticity_model )
224 std::string warning =
"Warning: Option Physics/"+physics+
"/elasticity_model is DEPRECATED.\n";
225 warning +=
" Please update to use Materials/MATERIAL_NAME/StressStrainLaw/model.\n";
228 model = input(
"Physics/"+physics+
"/elasticity_model",
"DIE!" );
230 if( model == std::string(
"HookesLaw") )
231 model =
"hookes_law";
232 if( model == std::string(
"MooneyRivlin") )
234 model =
"incompressible_hyperelasticity";
235 strain_energy =
"mooney_rivlin";
240 else if( input.have_variable(
"Materials/"+material+
"/StressStrainLaw/model") )
243 model, strain_energy );
253 const std::string& physics,
262 if( have_thermochem_lib &&
263 input.have_variable(
"Materials/"+material+
"/GasMixture/thermochemistry_library") )
269 if( have_thermochem_lib )
274 else if( input.have_variable(
"Materials/"+material+
"/GasMixture/thermochemistry_library") )
276 model = input(
"Materials/"+material+
"/GasMixture/thermochemistry_library",
"DIE!");
281 libmesh_error_msg(
"ERROR! Could not find valid thermochemistry_library input!");
285 if( model != std::string(
"antioch") &&
286 model != std::string(
"cantera") )
288 std::string error =
"ERROR! Invalid thermochemistry library value "+model+
"!\n";
289 error +=
" Valid selections are: antioch\n";
290 error +=
" cantera\n";
292 libmesh_error_msg(error);
297 const std::string& physics,
298 std::string& transport_model,
299 std::string& thermo_model,
300 std::string& viscosity_model,
301 std::string& conductivity_model,
302 std::string& diffusivity_model )
307 bool have_transport_model = input.have_variable(
"Physics/Antioch/transport_model" );
310 if( have_transport_model &&
311 input.have_variable(
"Materials/"+material+
"/GasMixture/Antioch/transport_model") )
313 libmesh_error_msg(
"ERROR: Cannot specify both Materials/"+material+
"/GasMixture/Antioch/transport_model and Physics/Antioch/transport_model!");
317 if( have_transport_model )
319 std::string warning =
"Warning: Option Physics/Antioch/transport_model is DEPRECATED.\n";
320 warning +=
" Please update to use Use Materials/MATERIAL_NAME/GasMixture/Antioch/transport_model.\n";
323 transport_model = input(
"Physics/Antioch/transport_model",
"mixture_averaged" );
326 else if( input.have_variable(
"Physics/Antioch/mixing_model") )
328 std::string warning =
"Warning: Option Physics/Antioch/mixing_model is DEPRECATED.\n";
329 warning +=
" Please update to use Use Materials/MATERIAL_NAME/GasMixture/Antioch/transport_model.\n";
332 transport_model = input(
"Physics/Antioch/mixing_model" ,
"mixture_averaged" );
335 else if( input.have_variable(
"Materials/"+material+
"/GasMixture/Antioch/transport_model") )
337 transport_model = input(
"Materials/"+material+
"/GasMixture/Antioch/transport_model",
"DIE!");
342 libmesh_error_msg(
"ERROR! Could not find valid transport_model input!");
346 if( transport_model == std::string(
"wilke") )
348 libMesh::err <<
"WARNING: Physics/Antioch/transport_model value of 'wilke' is deprecated!" << std::endl
349 <<
" Replace Physics/Antioch/transport_model value with 'mixture_averaged'"
352 transport_model =
"mixture_averaged";
357 if( have_transport_model || input.have_variable(
"Physics/Antioch/mixing_model") )
360 thermo_model = input(
"Physics/Antioch/thermo_model",
"stat_mech");
361 viscosity_model = input(
"Physics/Antioch/viscosity_model",
"blottner");
362 conductivity_model = input(
"Physics/Antioch/conductivity_model",
"eucken");
363 diffusivity_model = input(
"Physics/Antioch/diffusivity_model",
"constant_lewis");
366 if( input.have_variable(
"Materials/"+material+
"/GasMixture/Antioch/thermo_model") ||
367 input.have_variable(
"Materials/"+material+
"/GasMixture/Antioch/viscosity_model") ||
368 input.have_variable(
"Materials/"+material+
"/GasMixture/Antioch/thermal_conductivity_model") ||
369 input.have_variable(
"Materials/"+material+
"/GasMixture/Antioch/mass_diffusivity_model") )
371 libmesh_error_msg(
"ERROR: Cannot specifiy Physics/Antioch/transport_model and then specify Materials/"+material+
"/GasMixture/Antioch/<thermo,viscosity,conductivity,diffusivity>_model!");
375 else if( input.have_variable(
"Materials/"+material+
"/GasMixture/Antioch/transport_model") )
385 thermo_model = input(
"Materials/"+material+
"/GasMixture/Antioch/thermo_model",
"DIE!");
386 viscosity_model = input(
"Materials/"+material+
"/GasMixture/Antioch/viscosity_model",
"DIE!");
387 conductivity_model = input(
"Materials/"+material+
"/GasMixture/Antioch/thermal_conductivity_model",
"DIE!");
388 diffusivity_model = input(
"Materials/"+material+
"/GasMixture/Antioch/mass_diffusivity_model",
"DIE!");
391 if( input.have_variable(
"Physics/Antioch/thermo_model") ||
392 input.have_variable(
"Physics/Antioch/viscosity_model") ||
393 input.have_variable(
"Physics/Antioch/conductivity_model") ||
394 input.have_variable(
"Physics/Antioch/diffusivity_model") )
396 libmesh_error_msg(
"ERROR: Cannot specifiy Materials/"+material+
"/GasMixture/Antioch/transport_model and then specify Physics/Antioch/<thermo,viscosity,conductivity,diffusivity>_model!");
402 libmesh_error_msg(
"ERROR! Could not find valid transport_model input!");
410 const std::string& physics,
413 bool have_viscosity_model = input.have_variable(
"Physics/"+physics+
"/viscosity_model");
415 if( (have_material && have_ins_viscosity_model) ||
416 (have_material && have_viscosity_model) )
418 libmesh_error_msg(
"Error: Cannot specify both viscosity_model and material.");
423 if( !have_ins_viscosity_model && !have_material && !have_viscosity_model )
425 std::string warning =
"Warning: Neither viscosity_model nor material were specified.\n";
426 warning +=
" We are assuming a constant viscosity model.\n";
427 warning +=
" This case is DEPRECATED.\n";
428 warning +=
" Please update and specify Physics/"+physics+
"/material.\n";
434 if( have_ins_viscosity_model )
437 warning +=
" Please update to use Physics/"+physics+
"/material.\n";
443 if( have_viscosity_model )
445 std::string warning =
"Warning: Option Physics/"+physics+
"/viscosity_model is DEPRECATED.\n";
446 warning +=
" Please update to use Physics/"+physics+
"/material.\n";
449 model = input(
"Physics/"+physics+
"/viscosity_model",
"constant" );
static void parse_viscosity_model(const GetPot &input, const std::string &physics, std::string &model)
Determine viscosity model based on given physics name.
static PhysicsName heat_transfer()
static void parse_thermochemistry_model(const GetPot &input, const std::string &physics, std::string &model)
Determine thermochemistry model type.
static PhysicsName reacting_low_mach_navier_stokes()
static PhysicsName low_mach_navier_stokes()
#define grins_warning(message)
static void parse_antioch_models(const GetPot &input, const std::string &physics, std::string &transport_model, std::string &thermo_model, std::string &viscosity_model, std::string &conductivity_model, std::string &diffusivity_model)
static void check_for_input_option(const GetPot &input, const std::string &option)
Helper function to check for option and error out if it's not found.
static void viscosity_model(const GetPot &input, const std::string &physics, const std::string &material, std::string &model)
Parse the viscosity model for the given material.
static void stress_strain_model(const GetPot &input, const std::string &, const std::string &material, std::string &model, std::string &strain_energy)
Parse the stress-strain model for the given material.
static void parse_conductivity_model(const GetPot &input, const std::string &physics, std::string &model)
Determine conductivity model based on given physics name.
static void turb_viscosity_model(const GetPot &input, const std::string &physics, const std::string &material, std::string &model)
Parse the turbulence viscosity model for the given material.
static void specific_heat_model(const GetPot &input, const std::string &physics, const std::string &material, std::string &model)
Parse the specific heat model for the given material.
static PhysicsName incompressible_navier_stokes()
static void deprecated_visc_model_parsing(bool have_viscosity_model, bool have_material, const GetPot &input, const std::string &physics, std::string &model)
static std::string material_name(const GetPot &input, const std::string &physics)
Get the name of the material in the Physics/physics section.
static void parse_stress_strain_model(const GetPot &input, const std::string &physics, std::string &model, std::string &strain_energy)
Determine stress-strain law used by solid mechanics classes.
static bool have_material(const GetPot &input, const std::string &physics)
Check if Physics/physics section has a material variable.
static void parse_specific_heat_model(const GetPot &input, const std::string &physics, std::string &model)
Determine specific heat model based on given physics name.
static void thermal_conductivity_model(const GetPot &input, const std::string &physics, const std::string &material, std::string &model)
Parse the conductivity model for the given material.
static void parse_turb_viscosity_model(const GetPot &input, const std::string &physics, std::string &model)
Determine viscosity model used by turblence classes.