4#ifndef lethe_simulation_parameters_h
5#define lethe_simulation_parameters_h
37 std::map<CLSSubequationsID, Parameters::LinearSolver>
39 std::map<CLSSubequationsID, Parameters::NonLinearSolver>
45 std::shared_ptr<Parameters::Nitsche<dim>>
nitsche;
85 prm.declare_entry(
"dimension",
88 "Dimension of the problem");
90 prm.declare_entry(
"print parameters",
92 Patterns::Selection(
"none|only changed|all"),
93 "Print all the parameters, or only"
94 "the changed parameters or none");
100 "Print a comment at the beginning of the console output.");
106 nitsche = std::make_shared<Parameters::Nitsche<dim>>();
107 nitsche->declare_parameters(prm);
134 std::make_shared<Parameters::MeshBoxRefinement<dim>>();
149 cls_subequation_name);
169 ale.declare_parameters(prm);
184 test.parse_parameters(prm);
189 linear_solver[physics_id].parse_parameters(prm, physics_name);
196 linear_solver[physics_id].parse_parameters(prm, physics_name);
203 prm, cls_subequation_name);
205 .parse_parameters(prm, cls_subequation_name);
209 mesh.parse_parameters(prm);
211 nitsche->parse_parameters(prm);
214 timer.parse_parameters(prm);
237 ale.parse_parameters(prm);
248 throw std::logic_error(
249 "Inconsistency in .prm!\n with CLS = true\n use: number of fluids = 2");
255 throw std::logic_error(
256 "Inconsistency in .prm!\n when CLS = false"
257 "\n use (default value): set postprocessed fluid = both"
258 "\n or: set postprocessed fluid = fluid_0");
264 throw std::logic_error(
265 "Inconsistency in .prm!\n "
266 "Number of fluids in 'physical properties' was set to 2,\n "
267 "but neither 'cls' or 'cahn hilliard' is enabled in the 'multiphysics'.\n ");
271 if (
multiphysics.cls_parameters.surface_tension_force.enable)
273 std::string constant_surface_tension_model(
274 " subsection fluid-fluid interaction\n"
275 " set first fluid id = 0\n"
276 " set second fluid id = 1\n"
277 " set surface tension model = constant\n"
278 " set surface tension coefficient = $value_of_coefficient\n"
281 std::string linear_surface_tension_model(
282 " subsection fluid-fluid interaction\n"
283 " set first fluid id = 0\n"
284 " set second fluid id = 1\n"
285 " set surface tension model = linear\n"
286 " set surface tension coefficient = $value_of_coefficient\n"
287 " set temperature-driven surface tension gradient = $value_of_gradient\n"
290 std::string phase_change_surface_tension_model(
291 " subsection fluid-fluid interaction\n"
292 " set first fluid id = 0\n"
293 " set second fluid id = 1\n"
294 " set surface tension model = phase change\n"
295 " set surface tension coefficient = $value_of_coefficient\n"
296 " set temperature-driven surface tension gradient = $value_of_gradient\n"
297 " set solidus temperature = $value_of_solidus_temperature\n"
298 " set liquidus temperature = $value_of_liquidus_temperature\n"
301 .enable_marangoni_effect)
305 throw std::logic_error(
306 "Inconsistency in .prm!\n "
307 "In subsection CLS, with surface tension force enabled,\n "
308 "but no material interactions specified in\n "
309 "subsection physical properties.\n "
311 " set number of material interactions = 1\n"
312 " subsection material interaction 0\n"
313 " set type = fluid_fluid\n" +
314 constant_surface_tension_model +
" end\n");
323 throw std::logic_error(
324 "Inconsistency in .prm!\n "
325 "In subsection multiphysics, 'cls' and 'heat transfer' enabled,\n "
326 "and in subsection physical properties, a non-constant surface\n "
327 "tension model, but Marangoni effect disabled in subsection\n "
328 "surface tension force of subsection CLS. This is necessary to account\n "
329 "for Marangoni effect. In subsection CLS, use:\n\n "
330 " subsection surface tension force\n"
331 " set enable = true\n"
332 " set enable marangoni effect = true\n"
341 throw std::logic_error(
342 "Inconsistency in .prm!\n "
343 "in subsection CLS, surface tension force enabled,\n "
344 "but no fluid-fluid material interactions specified in \n "
345 "subsection physical properties\n "
347 " subsection material interaction $material_interaction_id\n"
348 " set type = fluid_fluid\n" +
349 constant_surface_tension_model +
" end\n");
357 throw std::logic_error(
358 "Inconsistency in .prm!\n "
359 "In subsection CLS, marangoni effect enabled,\n "
360 "but no material interactions specified in subsection physical\n "
361 "properties. This is necessary to account for Marangoni \n "
362 "effect. In subsection physical properties, use:\n\n"
363 " set number of material interactions = 1\n"
364 " subsection material interaction 0\n"
365 " set type = fluid_fluid\n" +
366 linear_surface_tension_model +
369 " set number of material interactions = 1\n"
370 " subsection material interaction 0\n"
371 " set type = fluid_fluid\n" +
372 phase_change_surface_tension_model +
" end\n");
379 throw std::logic_error(
380 "Inconsistency in .prm!\n "
381 "In subsection CLS, Marangoni effect enabled,\n "
382 "but no fluid-fluid material interactions specified in subsection\n "
383 "physical properties. This is necessary to account for Marangoni\n "
384 "effect. In subsection physical properties, use:\n\n"
385 " subsection material interaction $material_interaction_id\n"
386 " set type = fluid_fluid\n" +
387 linear_surface_tension_model +
390 " set number of material interactions = 1\n"
391 " subsection material interaction 0\n"
392 " set type = fluid_fluid\n" +
393 phase_change_surface_tension_model +
" end\n");
398 throw std::logic_error(
399 "Inconsistency in .prm!\n "
400 "In subsection CLS, Marangoni effect enabled,\n "
401 "but a constant surface tension model is specified in subsection\n "
402 "physical properties. This is necessary to account for Marangoni \n "
403 "effect. In subsection physical properties, use:\n\n"
404 " subsection material interaction $material_interaction_id\n"
405 " set type = fluid_fluid\n" +
406 linear_surface_tension_model +
409 " set number of material interactions = 1\n"
410 " subsection material interaction 0\n"
411 " set type = fluid_fluid\n" +
412 phase_change_surface_tension_model +
" end\n");
420 throw std::runtime_error(
421 "Cannot solve a multiphase problem using CLS and Cahn-Hilliard at the same time");
427 throw std::logic_error(
428 "Inconsistency in .prm!\n "
429 "cahn hilliard = true, \n "
430 "but no fluid-fluid material interactions specified in\n "
431 "subsection physical properties\n "
433 " subsection material interaction $material_interaction_id\n"
434 " set type = fluid_fluid\n"
435 " subsection fluid-fluid interaction\n"
436 " set first fluid id = 0\n"
437 " set second fluid id = 1\n"
438 " set cahn hilliard mobility model = constant\n"
439 " set cahn hilliard mobility coefficient = $value_of_coefficient\n"
446 dim>::LaserType::gaussian_heat_flux_cls_interface ||
449 dim>::LaserType::uniform_heat_flux_cls_interface) &&
452 throw std::logic_error(
453 "At the moment, the laser surface heat flux is not implemented for 1 fluid simulations."
454 "Please enable the CLS auxiliary physic in the 'multiphysics' subsection, \n"
455 "specify a 2nd fluid in the 'physical properties' subsection,\n"
456 "and define appropriate initial conditions in the 'initial conditions' subsection.");
461 throw std::logic_error(
462 "Inconsistency in .prm!\n "
463 "The apply constraints on a solid domain feature is enabled, however\n "
464 "'heat transfer' was not set to 'true' in the 'multiphysics' subsection.\n ");
471 std::string n_constraints =
473 std::string n_fluids = Utilities::to_string(
475 throw std::logic_error(
476 "Inconsistency in .prm!\n "
477 "The number of constraints (" +
478 n_constraints +
") is greater than the number of fluids (" +
481 "Only 1 constraint per fluid can be declared.\n ");
486 throw std::logic_error(
487 "Inconsistency in .prm!\n "
488 "The current implementation for constraining solid domains with\n "
489 "temperature is not implemented for Cahn Hilliard simulations.\n ");
497 fluid.density_model !=
500 "Inconsistency in .prm!\n "
501 "Thermal buoyancy force is enabled while the isothermal ideal gas\n "
502 "density model is used. The isothermal ideal gas density model assumes\n "
503 "thermal independence of the density, which is incompatible with the\n "
504 "thermal buoyancy force."));
515 constexpr double pressure_scaling_tolerance = 1e-8;
518 pressure_scaling_tolerance,
520 "Inconsistency in .prm!\n "
521 "The 'pressure scaling factor' parameter of the 'stabilization'\n "
522 "subsection is not supported with a non-constant density model\n "
523 "(isothermal_ideal_gas). Set it to 1."));
528 (
multiphysics.cls_parameters.surface_tension_force.enable &&
531 "The current implementation only allows the capillary time-step constraint \n "
532 "to be respected for CLS multiphase flows with surface tension.\n "));
539 "Inconsistency in .prm!\n"
540 "The 'cls' multiphysics is disabled and the 'fluid with phase change' parameter (subsection velocity source) has not been to 'fluid_0'."));
548 "You are attempting to monitor temperature isocontours, but 'heat transfer = false' in the 'multiphysics' subsection."));
554 "You are attempting to monitor phase indicator isocontours, but 'cls = false' in the 'multiphysics' subsection."));
557 if (
post_processing.probing_points.probing_points_per_variable.contains(
564 "You are attempting to evaluate velocity or pressure values using at least one postprocessing probe, but 'fluid dynamics = false' in the 'multiphysics' subsection."));
565 if (
post_processing.probing_points.probing_points_per_variable.contains(
570 "You are attempting to evaluate phase indicator values using at least one postprocessing probe, but 'cls = false' in the 'multiphysics' subsection."));
571 if (
post_processing.probing_points.probing_points_per_variable.contains(
576 "You are attempting to evaluate temperature values using at least one postprocessing probe, but 'heat transfer = false' in the 'multiphysics' subsection."));
581 std::vector<Parameters::MaterialInteractions> &material_interactions)
584 material_interactions)
586 if (material_interaction.material_interaction_type ==
598 std::vector<Parameters::MaterialInteractions> &material_interactions)
601 material_interactions)
603 if (material_interaction.surface_tension_model !=
622 "continuum solid dynamics",
627 "CLS PDE-based interface reinitialization"};
Implements analytical solutions for the Navier-Stokes equations and the other physics supported by le...
This class manages the boundary conditions for CLS solver It introduces the boundary functions and de...
This class manages the boundary conditions for the Cahn-Hilliard solver It introduces the boundary fu...
This class manages the boundary conditions forhe fluid dynamics solver It introduces the boundary fun...
This class manages the boundary conditions for Heat-Transfer solver It introduces the boundary functi...
Boundary conditions of the QMOM physics. They apply to the advective flux of all the QMOM fields (sca...
This class manages the boundary conditions for Time Harmonic Maxwell solver. It introduces the bounda...
This class manages the boundary conditions for Tracer solver It introduces the boundary functions and...
An interface for all the common parameters required to consider a moving frame of reference in a simp...
Class used to rescale physical properties for cases where the main dimensions of the problems (Length...
Laser parameters - Defines the parameters for the laser heat source.
Manifolds - This class manages attaching manifolds to faces when a manual attachment is required (for...
MaterialInteractions - Class that defines physical properties due to interactions between two differe...
Mesh - Parameters that control mesh reading and mesh generation.
static void declare_parameters(ParameterHandler &prm)
Declare the parameters.
PhysicalProperties - Define the possible physical properties. All continuum equations share the same ...
Postprocessing - Defines the parameters for the post-processing. In Lethe, post-processing implies th...
Implements a drift velocity function to account for simplified multiphase flows.
Class that manages the physical properties model which are required to calculate the various physical...
bool no_fluid_fluid_interaction_error(std::vector< Parameters::MaterialInteractions > &material_interactions)
SourceTerms::SourceTerm< dim > source_term
Parameters::Mortar< dim > mortar_parameters
std::shared_ptr< Parameters::MeshBoxRefinement< dim > > mesh_box_refinement
BoundaryConditions::TracerBoundaryConditions< dim > tracer_boundary_conditions
Parameters::Evaporation evaporation
std::shared_ptr< Parameters::Laser< dim > > laser_parameters
Parameters::Restart restart_parameters
BoundaryConditions::CLSBoundaryConditions< dim > cls_boundary_conditions
Parameters::Dimensionality dimensionality
Parameters::Stabilization stabilization
AnalyticalSolutions::AnalyticalSolution< dim > * analytical_solution
void parse(ParameterHandler &prm)
Parameters::ConstrainSolidDomain< dim > constrain_solid_domain
std::shared_ptr< Parameters::IBParticles< dim > > particlesParameters
bool is_constant_surface_tension_model(std::vector< Parameters::MaterialInteractions > &material_interactions)
PhysicalPropertiesManager physical_properties_manager
BoundaryConditions::HeatTransferBoundaryConditions< dim > boundary_conditions_ht
Parameters::DynamicFlowControl flow_control
Parameters::Multiphysics< dim > multiphysics
Parameters::MeshAdaptation mesh_adaptation
std::vector< std::string > nonlinear_physics_names
std::map< CLSSubequationsID, Parameters::NonLinearSolver > cls_subequations_non_linear_solvers
std::shared_ptr< Parameters::Nitsche< dim > > nitsche
std::map< CLSSubequationsID, Parameters::LinearSolver > cls_subequations_linear_solvers
Parameters::SimulationControl simulation_control
Parameters::Manifolds manifolds_parameters
Parameters::TracerDriftVelocity< dim > tracer_drift_velocity
Parameters::Mesh< dim > mesh
Parameters::PostProcessing< dim > post_processing
Parameters::ALE< dim > ale
Parameters::InitialConditions< dim > * initial_condition
Parameters::PhysicalProperties physical_properties
BoundaryConditions::FluidDynamicsBoundaryConditions< dim > boundary_conditions
std::map< PhysicsID, Parameters::LinearSolver > linear_solver
BoundaryConditions::QMOMBoundaryConditions< dim > qmom_boundary_conditions
BoundaryConditions::TimeHarmonicMaxwellBoundaryConditions< dim > boundary_conditions_time_harmonic_electromagnetics
std::vector< std::string > linear_physics_names
Parameters::FEM fem_parameters
Parameters::Forces forces_parameters
Parameters::VelocitySource velocity_sources
std::map< PhysicsID, Parameters::NonLinearSolver > physics_solving_strategy
std::vector< std::string > cls_subequations_names
BoundaryConditions::CahnHilliardBoundaryConditions< dim > cahn_hilliard_boundary_conditions
void declare(ParameterHandler &prm, Parameters::SizeOfSubsections size_of_subsections)
CLSSubequationsID get_cls_subequation_id(const std::string &cls_subequation_name)
Get the CLSSubequationsID associated to a specific CLS subequation from a string.
CLSSubequationsID
IDs associated to the different subequations solved in Lethe.
@ phase
Phase indicator scalar field from CLS.
@ velocity
Velocity vector field from fluid dynamics.
@ pressure
Pressure scalar field from fluid dynamics.
@ temperature
Temperature scalar field from heat transfer.
PhysicsID get_physics_id(const std::string &physics_name)
Utility function used for parsing physics-based parameters.
PhysicsID
Unique identifiers for each physics module in Lethe.
Parameter classes for solid objects used in Nitsche immersed boundary and DEM simulations.
Set of parameters constraining a certain portion of a fluid domain to null velocity and pressure fiel...
FlowControl - Set average velocity on a boundary (CFD) or the domain (CFD-DEM).
static void declare_parameters(ParameterHandler &prm)
Declare the default parameters.
Evaporation - Defines the subparameters for the evaporation cooling and recoil pressure at the free s...
static void declare_parameters(ParameterHandler &prm)
Declare the default parameters.
FEM - The finite element section controls the properties of the finite element method....
static void declare_parameters(ParameterHandler &prm)
Declare the parameters.
Forces - Defines the parameters for the force calculation on boundaries of the domain.
static void declare_parameters(ParameterHandler &prm)
Declare the parameters.
static void declare_parameters(ParameterHandler &prm, const std::string &physics_name)
Declare the parameters.
MeshAdaption - Parameters that control dynamic mesh adaptation. Dynamic mesh adaptation in Lethe is v...
static void declare_parameters(ParameterHandler &prm)
Declare the parameters.
Mortar - Defines parameters used to construct mortar elements.
Multiphysics - the parameters for multiphysics simulations and handles sub-physics parameters.
static void declare_parameters(ParameterHandler &prm, const std::string &physics_name)
Declare the parameters.
Restart - Controls writing and reading simulation checkpoints.
static void declare_parameters(ParameterHandler &prm)
Declare the parameters.
SimulationControl - Defines the parameter that control the flow of the simulation as well as the freq...
static void declare_parameters(ParameterHandler &prm)
Declare the simulation control parameters.
Stabilization - Defines parameters for an advanced control over the stabilization strategy used by th...
static void declare_parameters(ParameterHandler &prm)
Declare the parameters.
Testing - Some solvers have a specific testing mode that can be enabled to output more variables to t...
static void declare_parameters(ParameterHandler &prm)
Declare the parameters.
Timer - Defines the parameters that control the timing of the simulation. Lethe supports advanced tim...
static void declare_parameters(ParameterHandler &prm)
Declare the parameters.
VelocitySource - Adds velocity-dependent source term to the Navier-Stokes equations with the appropri...
static void declare_parameters(ParameterHandler &prm)
Declare the parameters.