7#include <deal.II/base/exceptions.h>
8#include <deal.II/base/parameter_handler.h>
9#include <deal.II/base/parsed_function.h>
10#include <deal.II/base/utilities.h>
19 SharpeningThresholdError,
21 <<
"Sharpening threshold : " << arg1 <<
" is smaller than 0 or larger than 1."
23 <<
"Projection-based interface sharpening model requires a sharpening threshold between 0 and 1.");
26 SharpeningThresholdErrorMaxDeviation,
28 <<
"Sharpening threshold max deviation : " << arg1
29 <<
" is smaller than 0 or larger than 0.5." << std::endl
30 <<
"Adaptive projection-based interface sharpening requires a maximum deviation of the"
31 <<
" sharpening threshold between 0.0 and 0.5. See documentation for further details");
34 ReinitializationMethodFrequencyError,
36 <<
"Reinitialization method frequency : " << arg1
37 <<
" is equal or smaller than 0." << std::endl
38 <<
"Interface reinitialization method requires an frequency larger than 0.");
41 QMOMScalarNamesCountError,
44 <<
"The \"scalar names\" of the QMOM subsection has " << arg1
45 <<
" names, but the \"number of scalars\" is " << arg2 <<
"." << std::endl
46 <<
"Give one name per scalar, or no name to use scalar_0, scalar_1, ...");
51 <<
"The scalar name \"" << arg1 <<
"\" of the QMOM subsection is invalid."
53 <<
"Scalar names may only contain letters, digits and underscores.");
59 <<
"\" of the QMOM subsection contradicts the \"" << arg2
60 <<
"\" process, which imposes it." << std::endl
61 <<
"Remove \"" << arg1
62 <<
"\" from the parameter file, or set the "
63 <<
"process to generic.");
66 QMOMDistributionExpressionsCountError,
71 <<
"\" particle size distribution of the QMOM physics expects " << arg2
72 <<
" expressions, but " << arg3 <<
" are given." << std::endl
73 <<
"Give the number density, in particles per m^3, followed by the "
74 <<
"parameters of the distribution.");
82 deprecated_transformation_type_names = {
83 {
"piecewise polynomial",
89 deprecated_reinitialization_method_type_names = {
90 {
"projection-based interface sharpening",
92 {
"pde-based interface reinitialization",
94 {
"geometric interface reinitialization",
99 deprecated_electromagnetic_scaling_type_names = {
116 is_valid_scalar_name(
const std::string &scalar_name)
118 const auto is_valid_character = [](
const char character) {
119 return std::isalnum(
static_cast<unsigned char>(character)) != 0 ||
122 return !scalar_name.empty() &&
123 std::ranges::all_of(scalar_name, is_valid_character);
132 prm.enter_subsection(
"multiphysics");
134 prm.declare_entry(
"fluid dynamics",
137 "Fluid flow calculation <true|false>");
139 prm.declare_entry(
"heat transfer",
142 "Thermic calculation <true|false>");
144 prm.declare_entry(
"tracer",
145 Patterns::Tools::Convert<bool>::to_string(
tracer),
147 "Passive tracer calculation <true|false>");
149 prm.declare_entry(
"cls",
150 Patterns::Tools::Convert<bool>::to_string(
CLS),
152 "CLS calculation <true|false>");
154 prm.declare_entry(
"cahn hilliard",
157 "Cahn-Hilliard calculation <true|false>");
163 "Time harmonic electromagnetics calculation <true|false>");
165 prm.declare_entry(
"continuum solid dynamics",
166 Patterns::Tools::Convert<bool>::to_string(
169 "Euler-Euler solid phase calculation <true|false>");
173 Patterns::Tools::Convert<bool>::to_string(
qmom),
175 "Quadrature method of moments calculation (requires QMOMKit) "
179 prm.declare_entry(
"viscous dissipation",
180 Patterns::Tools::Convert<bool>::to_string(
183 "Viscous dissipation in heat equation <true|false>");
185 prm.declare_entry(
"thermal buoyancy force",
186 Patterns::Tools::Convert<bool>::to_string(
189 "Thermal buoyancy force calculation <true|false>");
190 prm.declare_entry(
"microwave heating",
191 Patterns::Tools::Convert<bool>::to_string(
194 "Microwave heating calculation <true|false>");
196 prm.leave_subsection();
207 ParameterHandler &prm,
210 prm.enter_subsection(
"multiphysics");
214 tracer = prm.get_bool(
"tracer");
215 CLS = prm.get_bool(
"cls");
219 qmom = prm.get_bool(
"qmom");
226 prm.leave_subsection();
236 prm.enter_subsection(
"CLS");
243 "viscous dissipative fluid",
245 "Fluid to which the viscous dissipation is applied "
246 "in the heat equation.",
251 Patterns::Tools::Convert<double>::to_string(
diffusivity),
253 "Diffusivity (diffusion coefficient in L^2/s) in the phase indicator transport equation. "
254 "Default value is 0 to have pure advection.");
258 Patterns::Tools::Convert<bool>::to_string(
compressible),
260 "Enable phase compressibility in the CLS equation. This leads to the inclusion of the phase * div(u) term in the CLS equation. "
261 "It should be set to false when the phases are incompressible");
263 prm.leave_subsection();
269 prm.enter_subsection(
"CLS");
279 "viscous dissipative fluid");
285 prm.leave_subsection();
290 ParameterHandler &prm)
const
292 prm.enter_subsection(
"interface reinitialization method");
297 "CLS interface reinitialization method.",
298 deprecated_reinitialization_method_type_names);
302 Patterns::Tools::Convert<int>::to_string(
frequency),
303 Patterns::Integer(0),
304 "Reinitialization frequency (number of time steps) at which the "
305 "interface reinitialization process will be applied to the CLS "
306 "phase indicator field.");
311 "States whether the output from the interface reinitialization method "
312 "should be printed.",
319 prm.leave_subsection();
325 prm.enter_subsection(
"interface reinitialization method");
329 prm.get(
"type"), deprecated_reinitialization_method_type_names,
"type");
340 this->
frequency = prm.get_integer(
"frequency");
342 ReinitializationMethodFrequencyError(this->
frequency));
352 prm.leave_subsection();
359 prm.enter_subsection(
"projection-based interface sharpening");
365 "CLS interface sharpening type, "
366 "if constant the sharpening threshold is the same throughout the simulation, "
367 "if adaptive the sharpening threshold is determined by binary search, "
368 "to ensure mass conservation of the monitored phase.");
373 Patterns::Tools::Convert<double>::to_string(defaults.
threshold),
375 "Interface sharpening threshold that represents the phase indicator at which "
376 "the interphase is considered located");
380 "threshold max deviation",
381 Patterns::Tools::Convert<double>::to_string(
384 "Maximum deviation (from the base value of 0.5) considered in the search "
385 "algorithm to ensure mass conservation. "
386 "A threshold max deviation of 0.20 results in a search interval from 0.30 to 0.70");
390 Patterns::Tools::Convert<int>::to_string(defaults.
max_iterations),
392 "Maximum number of iteration in the bissection algorithm that ensures mass conservation");
396 Patterns::Tools::Convert<bool>::to_string(defaults.
monitoring),
398 "Enable conservation monitoring in multiphase fluid simulations <true|false>");
402 Patterns::Tools::Convert<double>::to_string(defaults.
tolerance),
404 "Tolerance on the mass conservation of the monitored fluid, used with adaptive sharpening");
410 "Fluid for which conservation is monitored, used with adaptive sharpening.",
417 "interface sharpness",
420 "Sharpness of the moving interface (parameter alpha in the interface sharpening model)");
422 prm.leave_subsection();
428 prm.enter_subsection(
"projection-based interface sharpening");
457 prm.leave_subsection();
464 prm.enter_subsection(
"surface tension force");
466 prm.declare_entry(
"enable",
467 Patterns::Tools::Convert<bool>::to_string(
470 "Enable surface tension force calculation <true|false>");
472 prm.declare_entry(
"output auxiliary fields",
473 Patterns::Tools::Convert<bool>::to_string(
476 "Output the phase indicator gradient and curvature");
479 "phase indicator gradient diffusion factor",
480 Patterns::Tools::Convert<double>::to_string(
483 "Factor applied to the filter for phase indicator gradient calculations to damp high-frequency errors");
486 "curvature diffusion factor",
487 Patterns::Tools::Convert<double>::to_string(
490 "Factor applied to the filter for curvature calculations to damp high-frequency errors");
496 "State whether the output from the surface tension force calculations should be printed.",
501 prm.declare_entry(
"enable marangoni effect",
502 Patterns::Tools::Convert<bool>::to_string(
505 "Enable marangoni effect calculation <true|false>");
507 prm.leave_subsection();
513 prm.enter_subsection(
"surface tension force");
515 enable = prm.get_bool(
"enable");
517 prm.get_double(
"phase indicator gradient diffusion factor");
528 prm.leave_subsection();
535 prm.enter_subsection(
"phase filtration");
541 "CLS phase indicator filtration type, "
542 "if <none> is selected, the phase won't be filtered; "
543 "if <tanh> is selected, the filtered phase will be a result of the "
544 "following function: \\alpha_f = 0.5 \\tanh(\\beta(\\alpha-0.5)) + 0.5; "
545 "where \\beta is a parameter influencing the interface thickness that "
548 {Parameters::FilterType::none, Parameters::FilterType::tanh});
551 Patterns::Tools::Convert<double>::to_string(defaults.
beta),
553 "This parameter appears in the tanh filter function. It influence "
554 "the thickness and the shape of the interface. For higher values of "
555 "beta, a thinner and 'sharper/pixelated' interface will be seen.");
559 "States whether the filtered data should be printed.",
563 prm.leave_subsection();
569 prm.enter_subsection(
"phase filtration");
575 beta = prm.get_double(
"beta");
582 prm.leave_subsection();
587 dealii::ParameterHandler &prm)
590 prm.enter_subsection(
"PDE-based interface reinitialization");
593 "output reinitialization steps",
594 Patterns::Tools::Convert<bool>::to_string(
597 "Enables pvtu format outputs of the PDE-based interface reinitialization "
598 "steps <true|false>");
600 "diffusivity multiplier",
601 Patterns::Tools::Convert<double>::to_string(
604 "Factor that multiplies the mesh-size in the mesh-dependant diffusion "
605 "coefficient of the PDE-based interface reinitialization.");
610 "Power value applied to the mesh-size in the mesh-dependant diffusion "
611 "coefficient of the PDE-based interface reinitialization.");
612 prm.declare_entry(
"steady-state criterion",
613 Patterns::Tools::Convert<double>::to_string(
616 "Tolerance for the artificial time-stepping scheme.");
617 prm.declare_entry(
"max steps number",
618 Patterns::Tools::Convert<double>::to_string(
621 "Maximum number of reinitialization steps.");
623 "artificial time-step factor",
624 Patterns::Tools::Convert<double>::to_string(defaults.
dtau_factor),
626 "Factor multiplying the artificial time step in the PDE-based "
627 "interface reinitialization.");
629 prm.leave_subsection();
634 dealii::ParameterHandler &prm)
636 prm.enter_subsection(
"PDE-based interface reinitialization");
639 prm.get_bool(
"output reinitialization steps");
642 this->
dtau_factor = prm.get_double(
"artificial time-step factor");
646 prm.leave_subsection();
651 dealii::ParameterHandler &prm)
654 prm.enter_subsection(
"geometric interface reinitialization");
657 "output signed distance",
658 Patterns::Tools::Convert<bool>::to_string(
661 "Enables pvtu format outputs of the geometric interface reinitialization "
662 "steps <true|false>");
663 prm.declare_entry(
"max reinitialization distance",
664 Patterns::Tools::Convert<double>::to_string(
667 "Maximum reinitialization distance value");
670 "transformation type",
672 "Transformation function used to get the phase indicator from the signed "
674 deprecated_transformation_type_names);
675 prm.declare_entry(
"tanh thickness",
676 Patterns::Tools::Convert<double>::to_string(
679 "Interface thickness for the tanh transformation");
681 prm.leave_subsection();
686 dealii::ParameterHandler &prm)
688 prm.enter_subsection(
"geometric interface reinitialization");
692 prm.get_double(
"max reinitialization distance");
695 prm.get(
"transformation type"),
696 deprecated_transformation_type_names,
697 "transformation type");
700 prm.leave_subsection();
707 prm.enter_subsection(
"phase filtration");
713 "CahnHilliard phase filtration type, "
714 "if <none> is selected, the phase won't be filtered; "
715 "if <clip> is selected, the phase order values above 1 (respectively below -1) will be brought back to 1 (respectively -1); "
716 "if <tanh> is selected, the filtered phase will be a result of the "
717 "following function: \\alpha_f = \\tanh(\\beta\\alpha); "
718 "where beta is a parameter influencing the interface thickness that "
722 Patterns::Tools::Convert<double>::to_string(defaults.
beta),
724 "This parameter appears in the tanh filter function. It influence "
725 "the thickness and the shape of the interface. For higher values of "
726 "beta, a thinner and 'sharper/pixelated' interface will be seen.");
730 "States whether the filtered data should be printed.",
734 prm.leave_subsection();
740 prm.enter_subsection(
"phase filtration");
746 beta = prm.get_double(
"beta");
753 prm.leave_subsection();
759 prm.enter_subsection(
"cahn hilliard");
764 "potential smoothing coefficient",
765 Patterns::Tools::Convert<double>::to_string(
768 "Smoothing coefficient for the chemical potential in the Cahn-Hilliard equations.");
770 prm.enter_subsection(
"epsilon");
776 "Epsilon is either set to two times the characteristic length (automatic) of the element or user defined on all the domain (manual).");
780 Patterns::Tools::Convert<double>::to_string(
epsilon),
782 "Parameter linked to the interface thickness. Should always be bigger than the characteristic size of the smallest element");
788 "Display the value of epsilon for each time iteration if set to verbose.");
790 prm.leave_subsection();
792 prm.leave_subsection();
799 prm.enter_subsection(
"cahn hilliard");
804 prm.get_double(
"potential smoothing coefficient");
806 prm.enter_subsection(
"epsilon");
814 epsilon = prm.get_double(
"value");
817 prm.leave_subsection();
819 prm.leave_subsection();
826 prm.enter_subsection(
"phase evolution");
828 prm.declare_entry(
"enable adaptive node count",
829 Patterns::Tools::Convert<bool>::to_string(
832 "Enable adaptive quadrature node count <true|false>");
834 prm.leave_subsection();
840 prm.enter_subsection(
"phase evolution");
844 prm.leave_subsection();
851 prm.enter_subsection(
"QMOM");
856 "Process simulated. A process other than generic "
857 "imposes the scalars and the number of moments.");
859 prm.declare_entry(
"number of scalars",
860 Patterns::Tools::Convert<unsigned int>::to_string(
862 Patterns::Integer(0),
863 "Number of scalars transported together with the "
866 prm.declare_entry(
"scalar names",
868 Patterns::List(Patterns::Anything()),
869 "Comma-separated names of the scalars, used for the "
870 "output. If empty, the scalars are named scalar_0, "
873 prm.declare_entry(
"number of moments",
874 Patterns::Tools::Convert<unsigned int>::to_string(
876 Patterns::Integer(1),
877 "Number of transported raw moments. The quadrature has "
878 "half as many nodes, rounded up.");
883 "Operator splitting scheme between the physical-space "
884 "transport and the phase-space evolution");
886 prm.declare_entry(
"enable nucleation",
887 Patterns::Tools::Convert<bool>::to_string(
890 "Include the nucleation source <true|false>");
892 prm.declare_entry(
"enable coalescence",
893 Patterns::Tools::Convert<bool>::to_string(
896 "Include the coalescence source <true|false>");
898 prm.declare_entry(
"enable growth",
899 Patterns::Tools::Convert<bool>::to_string(
902 "Include the growth source <true|false>");
908 prm.leave_subsection();
914 prm.enter_subsection(
"QMOM");
919 scalar_names = Utilities::split_string_list(prm.get(
"scalar names"));
924 std::vector<std::string> process_scalar_names;
931 process_scalar_names = {
"ethanol_concentration",
932 "free_lipids_concentration"};
933 process_number_of_moments = 8;
941 QMOMProcessConflictError(
"number of scalars",
945 QMOMProcessConflictError(
"scalar names",
949 QMOMProcessConflictError(
"number of moments",
959 scalar_names.emplace_back(
"scalar_" + std::to_string(i_scalar));
964 AssertThrow(is_valid_scalar_name(scalar_name),
965 QMOMScalarNameError(scalar_name));
968 prm.get(
"splitting scheme"));
978 prm.leave_subsection();
983 ParameterHandler &prm)
const
986 prm.enter_subsection(
"lipid nanoparticle production");
988 prm.declare_entry(
"operating temperature",
989 Patterns::Tools::Convert<double>::to_string(
991 Patterns::Double(0.),
992 "Operating temperature [K]");
997 Patterns::Double(0.),
998 "Ratio of the aqueous phase flow rate to the organic phase flow rate [-]");
1002 Patterns::Tools::Convert<double>::to_string(defaults.
total_flow_rate),
1003 Patterns::Double(0.),
1004 "Total flow rate of the aqueous and organic phases [m^3/s]");
1007 "mixing time scale",
1009 Patterns::Double(0.),
1010 "Mixing time scale of the aqueous and organic phases [s]");
1013 "initial concentration organic",
1014 Patterns::Tools::Convert<double>::to_string(
1016 Patterns::Double(0.),
1017 "Initial lipid concentration in the organic phase [mol/m^3]");
1019 prm.declare_entry(
"ion concentration mixture",
1020 Patterns::Tools::Convert<double>::to_string(
1022 Patterns::Double(0.),
1023 "Ion concentration in the mixture [mol/m^3]");
1025 prm.declare_entry(
"density aqueous",
1026 Patterns::Tools::Convert<double>::to_string(
1028 Patterns::Double(0.),
1029 "Density of the aqueous phase [kg/m^3]");
1031 prm.declare_entry(
"molar mass aqueous",
1032 Patterns::Tools::Convert<double>::to_string(
1034 Patterns::Double(0.),
1035 "Molar mass of the aqueous phase [kg/mol]");
1038 "mole fraction solubility aqueous",
1039 Patterns::Tools::Convert<double>::to_string(
1041 Patterns::Double(0., 1.),
1042 "Mole fraction solubility of the lipid in the pure aqueous phase [-]");
1044 prm.declare_entry(
"permittivity aqueous",
1045 Patterns::Tools::Convert<double>::to_string(
1047 Patterns::Double(0.),
1048 "Relative permittivity of the aqueous phase [-]");
1050 prm.declare_entry(
"density organic",
1051 Patterns::Tools::Convert<double>::to_string(
1053 Patterns::Double(0.),
1054 "Density of the organic phase [kg/m^3]");
1056 prm.declare_entry(
"molar mass organic",
1057 Patterns::Tools::Convert<double>::to_string(
1059 Patterns::Double(0.),
1060 "Molar mass of the organic phase [kg/mol]");
1063 "mole fraction solubility organic",
1064 Patterns::Tools::Convert<double>::to_string(
1066 Patterns::Double(0., 1.),
1067 "Mole fraction solubility of the lipid in the pure organic phase [-]");
1069 prm.declare_entry(
"permittivity organic",
1070 Patterns::Tools::Convert<double>::to_string(
1072 Patterns::Double(0.),
1073 "Relative permittivity of the organic phase [-]");
1076 "viscosity mixture",
1078 Patterns::Double(0.),
1079 "Dynamic viscosity of the aqueous and organic mixture [Pa s]");
1083 Patterns::Tools::Convert<double>::to_string(defaults.
shape_factor),
1084 Patterns::Double(0.),
1085 "Volume shape factor of the particles, pi/6 for spheres [-]");
1087 prm.leave_subsection();
1092 ParameterHandler &prm)
1094 prm.enter_subsection(
"lipid nanoparticle production");
1101 prm.get_double(
"initial concentration organic");
1106 prm.get_double(
"mole fraction solubility aqueous");
1111 prm.get_double(
"mole fraction solubility organic");
1116 prm.leave_subsection();
1121 ParameterHandler &prm)
const
1124 prm.enter_subsection(
"physical constants");
1126 prm.declare_entry(
"boltzmann constant",
1127 Patterns::Tools::Convert<double>::to_string(
1129 Patterns::Double(0.),
1130 "Boltzmann constant [J/K]");
1132 prm.declare_entry(
"avogadro number",
1133 Patterns::Tools::Convert<double>::to_string(
1135 Patterns::Double(0.),
1136 "Avogadro number [1/mol]");
1138 prm.declare_entry(
"elementary charge",
1139 Patterns::Tools::Convert<double>::to_string(
1141 Patterns::Double(0.),
1142 "Elementary charge [C]");
1144 prm.declare_entry(
"permittivity vacuum",
1145 Patterns::Tools::Convert<double>::to_string(
1147 Patterns::Double(0.),
1148 "Vacuum permittivity [F/m]");
1150 prm.leave_subsection();
1156 prm.enter_subsection(
"physical constants");
1163 prm.leave_subsection();
1170 switch (distribution_type)
1184 AssertThrow(
false, ExcInternalError());
1192 prm.enter_subsection(
"scalars");
1197 Functions::ParsedFunction<dim>::declare_parameters(prm);
1199 prm.leave_subsection();
1201 prm.enter_subsection(
"distribution");
1206 "Family of the particle size distribution from which "
1207 "the moments are computed.");
1208 Functions::ParsedFunction<dim>::declare_parameters(prm);
1210 prm.leave_subsection();
1219 const auto count_expressions = [&prm]() {
1220 return static_cast<unsigned int>(
1221 Utilities::split_string_list(prm.get(
"Function expression"),
';').size());
1224 prm.enter_subsection(
"scalars");
1227 std::make_shared<Functions::ParsedFunction<dim>>(count_expressions());
1228 scalars->parse_parameters(prm);
1230 prm.leave_subsection();
1232 prm.enter_subsection(
"distribution");
1235 const unsigned int n_expressions = count_expressions();
1238 const unsigned int n_expected_expressions =
1240 AssertThrow(n_expressions == n_expected_expressions,
1241 QMOMDistributionExpressionsCountError(
1242 prm.get(
"type"), n_expected_expressions, n_expressions));
1245 std::make_shared<Functions::ParsedFunction<dim>>(n_expressions);
1248 prm.leave_subsection();
1262 ParameterHandler &prm)
const
1264 prm.enter_subsection(
"time harmonic maxwell");
1266 prm.enter_subsection(
"time coupling strategy");
1271 "The type of time coupling strategy to use.");
1274 "coupling iteration",
1276 Patterns::Integer(1),
1277 "Coupling parameter for the time coupling strategy based on "
1278 "iteration, this parameter represents the number of time iterations "
1279 "between two consecutive resolutions of the electromagnetic fields.");
1284 Patterns::Double(DBL_MIN),
1285 "Coupling parameter for the time coupling strategy based on time. "
1286 "This parameter represents the real time interval between two "
1287 "consecutive resolutions of the electromagnetic fields.");
1290 "coupling threshold",
1292 Patterns::Double(0),
1293 "Coupling parameter for the time coupling strategy based on a "
1294 "threshold. This parameter represents the change in the "
1295 "electromagnetic properties of the medium (i.e., permittivity, "
1296 "permeability or conductivity) that triggers the recomputation of "
1297 "the electromagnetic fields.)");
1299 prm.leave_subsection();
1303 "electromagnetic frequency",
1305 Patterns::Double(0),
1306 "Frequency of the time harmonic electromagnetic wave excitation (in Hz).");
1310 "electromagnetic scaling type",
1312 "The type of electromagnetic scaling to apply to the solution of the time-harmonic Maxwell solver after solving the linear system. This is relevant when the user wants to recover the physical solution in dimensional units instead of the dimensionless solution used for better conditioning of the linear system.",
1313 deprecated_electromagnetic_scaling_type_names);
1316 "electric field amplitude",
1318 Patterns::Double(0),
1319 "The amplitude of the electric field used for the normalization of the solution in [V/m].");
1322 "magnetic field amplitude",
1324 Patterns::Double(0),
1325 "The amplitude of the magnetic field used for the normalization of the solution in [A/m].");
1327 prm.declare_entry(
"number of waveguide inlets",
1328 Patterns::Tools::Convert<unsigned int>::to_string(
1330 Patterns::Integer(0),
1331 "Number of waveguide inlets in the simulation.");
1338 constexpr unsigned int max_waveguide_inlets = 10;
1340 for (
unsigned int inlet = 0; inlet < max_waveguide_inlets; ++inlet)
1342 prm.enter_subsection(
"waveguide inlet " + std::to_string(inlet));
1347 Patterns::Integer(0),
1348 "The boundary id where the waveguide inlet is applied.");
1353 Patterns::Double(0),
1354 "The power of the waveguide mode excitation in Watts. This is used to compute the amplitude of the electromagnetic wave at the inlet in dimensional units.");
1356 prm.enter_subsection(
"waveguide mode");
1362 "The waveguide mode excitation for a rectangular waveguide can be either Transverse Electric (TE) or Transverse Magnetic (TM).");
1367 Patterns::Integer(0),
1368 "The mode order m in the first transverse direction of the rectangular waveguide.");
1373 Patterns::Integer(0),
1374 "The mode order n in the second transverse direction of the rectangular waveguide.");
1376 prm.leave_subsection();
1378 const unsigned int num_corners = Utilities::fixed_power<2>(dim - 1);
1379 for (
unsigned int corner = 0; corner < num_corners; ++corner)
1381 if constexpr (dim == 2)
1383 prm.declare_entry(
"corner " + std::to_string(corner),
1385 Patterns::List(Patterns::Double(), 2, 2),
1386 "Coordinates of corner " +
1387 std::to_string(corner));
1389 else if constexpr (dim == 3)
1391 prm.declare_entry(
"corner " + std::to_string(corner),
1393 Patterns::List(Patterns::Double(), 3, 3),
1394 "Coordinates of corner " +
1395 std::to_string(corner));
1399 prm.leave_subsection();
1402 prm.leave_subsection();
1408 ParameterHandler &prm,
1411 prm.enter_subsection(
"time harmonic maxwell");
1413 prm.enter_subsection(
"time coupling strategy");
1420 prm.get_integer(
"coupling iteration");
1423 prm.get_double(
"coupling threshold");
1425 prm.leave_subsection();
1428 prm.get_double(
"electromagnetic frequency") *
1433 prm.get(
"electromagnetic scaling type"),
1434 deprecated_electromagnetic_scaling_type_names,
1435 "electromagnetic scaling type");
1441 prm.get_double(
"electric field amplitude");
1444 prm.get_double(
"magnetic field amplitude");
1447 prm.get_integer(
"number of waveguide inlets");
1454 "The number of waveguide inlets specified exceeds "
1455 "the maximum allowed. Please increase the value "
1456 "of max_waveguide_inlets in the code declare_parameters section of the TimeHarmonicMaxwell class."));
1468 prm.enter_subsection(
"waveguide inlet " + std::to_string(inlet));
1471 prm.get_integer(
"port boundary id");
1474 prm.get_double(
"waveguide power");
1481 "The waveguide power for the inlet " + std::to_string(inlet) +
1482 " is zero. Please check the waveguide power parameter in the input prm file for this inlet. If you really want to have no excitation but an open boundary condition at this inlet, you should change the boundary condition type to the impedance boundary condition with zero excitation and the desired admittance."));
1484 prm.enter_subsection(
"waveguide mode");
1490 prm.get_integer(
"mode order m");
1493 prm.get_integer(
"mode order n");
1499 throw(std::runtime_error(
1500 "Invalid waveguide mode orders m and n. "
1501 "At least one of the two mode orders must be non-zero."));
1504 prm.leave_subsection();
1506 const unsigned int num_corners = Utilities::fixed_power<2>(dim - 1);
1507 std::array<Tensor<1, dim>, num_corners> tmp_corners;
1509 for (
unsigned int corner = 0; corner < num_corners; ++corner)
1511 const std::string corner_name =
1512 "corner " + std::to_string(corner);
1513 const Tensor<1, dim> corner_value =
1516 tmp_corners[corner] = corner_value;
1522 if constexpr (dim == 3)
1524 const Tensor<1, dim> vec1 =
1527 const Tensor<1, dim> vec2 =
1530 const Tensor<1, dim> vec3 =
1540 const double determinant =
1541 scalar_product(vec3, cross_product_3d(vec1, vec2)) /
1542 (vec1.norm() * vec2.norm() * vec3.norm());
1544 const double tolerance = 1e-10;
1546 AssertThrow(std::abs(determinant) < tolerance,
1548 "The provided corners for waveguide inlet " +
1549 std::to_string(inlet) +
1550 " do not define a coplanar quadrilateral. "
1551 "Please check the corner coordinates."));
1556 prm.leave_subsection();
1566 "The power-based electromagnetic scaling type requires at least one waveguide inlet to be defined. Please check the number of waveguide inlets specified in the input prm file."));
1568 prm.leave_subsection();
Class used to rescale physical properties for cases where the main dimensions of the problems (Length...
double electromagnetic_frequency_scaling
double cahn_hilliard_epsilon_scaling
Tensor< 1, spacedim > value_string_to_tensor(const std::string &value_string)
Return the tensor corresponding to the value_string. If the dimension correspondence of the value_str...
std::vector< std::pair< std::string, EnumType > > DeprecatedEnumNames
Deprecated strings of an enum parameter, each paired with the enumerator it stands for....
std::string enum_to_string(const EnumType value)
Return the name of an enumerator, e.g. to derive the default value string of a parameter entry from t...
EnumType string_to_enum(const std::string &name)
Return the enumerator whose identifier is name, e.g. to parse the value of a parameter entry into its...
void declare_enum_entry(ParameterHandler &prm, const std::string &entry_name, const EnumType default_value, const std::string &description, const DeprecatedEnumNames< EnumType > &deprecated_names={}, const std::vector< EnumType > &allowed_values={})
Declare a parameter entry whose value is an enumerator. The default value, the accepted values and th...
@ TE
Transverse Electric mode.
const std::vector< Verbosity > & quiet_or_verbose()
Return the verbosity levels accepted by the parameters which do not support Verbosity::extra_verbose.
const DeprecatedEnumNames< FluidIndicator > & deprecated_fluid_indicator_names()
Return the deprecated strings of the parameters parsed into a FluidIndicator, which remain accepted i...
unsigned int get_number_of_distribution_parameters(const QMOMDistributionType distribution_type)
Number of parameters of a particle size distribution family, not counting the number density.
@ lipid_nanoparticle_production
@ projection_based_sharpening
QMOMDistributionType
Family of the particle size distribution from which the moments of the QMOM physics are computed....
const std::vector< FluidIndicator > & single_fluid_indicators()
Return the fluid indicators accepted by the parameters which designate a single fluid.
const DeprecatedEnumNames< Verbosity > & deprecated_verbosity_names()
Return the deprecated strings of the parameters parsed into a Verbosity, which remain accepted in par...
DeclException3(QMOMDistributionExpressionsCountError, std::string, unsigned int, unsigned int,<< "The \""<< arg1<< "\" particle size distribution of the QMOM physics expects "<< arg2<< " expressions, but "<< arg3<< " are given."<< std::endl<< "Give the number density, in particles per m^3, followed by the "<< "parameters of the distribution.")
DeclException1(SharpeningThresholdError, double,<< "Sharpening threshold : "<< arg1<< " is smaller than 0 or larger than 1."<< std::endl<< "Projection-based interface sharpening model requires a sharpening threshold between 0 and 1.")
DeclException2(QMOMScalarNamesCountError, std::size_t, unsigned int,<< "The \"scalar names\" of the QMOM subsection has "<< arg1<< " names, but the \"number of scalars\" is "<< arg2<< "."<< std::endl<< "Give one name per scalar, or no name to use scalar_0, scalar_1, ...")
Parameters for geometric reinitialization of the interface used with the CLS solver.
RedistanciationTransformationType transformation_type
double max_reinitialization_distance
Maximum reinitialization distance value.
void parse_parameters(ParameterHandler &prm)
Parse the parameters.
static void declare_parameters(ParameterHandler &prm)
Declare the parameters.
double tanh_thickness
Interface thickness for the tanh transformation.
bool output_signed_distance
Enables/Disables the output of the signed distance field.
CLS_InterfaceSharpening - Defines the parameters for interface sharpening in the CLS solver.
double threshold_max_deviation
void parse_parameters(ParameterHandler &prm)
Parsesthe CLS interface-sharpening parameters.
Parameters::SharpeningType type
Parameters::FluidIndicator monitored_fluid
double interface_sharpness
static void declare_parameters(ParameterHandler &prm)
Declare the CLS interface-sharpening parameters.
Parameters for PDE-based reinitialization of the interface used with the CLS solver.
static void declare_parameters(ParameterHandler &prm)
Declare the parameters.
void parse_parameters(ParameterHandler &prm)
Parse the parameters.
double diffusivity_multiplier
double steady_state_criterion
Steady-state criterion used for the artificial time-stepping scheme.
bool output_reinitialization_steps
double max_steps_number
Maximum number of reinitialization steps.
Parameters for the phase filtration.
Parameters::Verbosity verbosity
void parse_parameters(ParameterHandler &prm)
Parse the CLS phase-filter parameters.
Parameters::FilterType type
static void declare_parameters(ParameterHandler &prm)
Declare the CLS phase-filter parameters.
Parameters::CLS_InterfaceSharpening sharpening
Interface sharpening parameters.
Parameters::CLS_PDEBasedInterfaceReinitialization pde_based_interface_reinitialization
PDE-based interface reinitialization parameters.
Parameters::Verbosity verbosity
Type of verbosity of the PDE-based interface reinitialization solver.
void declare_parameters(ParameterHandler &prm) const
Declare the parameters.
Parameters::ReinitializationMethodType reinitialization_method_type
Reinitialization method type.
void parse_parameters(ParameterHandler &prm)
Parse the parameters.
Parameters::CLS_GeometricInterfaceReinitialization geometric_interface_reinitialization
Geometric interface reinitialization parameters.
Parameters for the calculation of surface tension force in the CLS solver.
bool output_cls_auxiliary_fields
Parameters::Verbosity verbosity
static void declare_parameters(ParameterHandler &prm)
Declare the CLS surface-tension force parameters.
double curvature_diffusion_factor
double phase_indicator_gradient_diffusion_factor
bool enable_marangoni_effect
void parse_parameters(ParameterHandler &prm)
Parse the CLS surface-tension force parameters.
Parameters::FluidIndicator viscous_dissipative_fluid
Parameters::CLS_SurfaceTensionForce surface_tension_force
void declare_parameters(ParameterHandler &prm) const
Declare the CLS parameters.
void parse_parameters(ParameterHandler &prm)
Parse the CLS parameters.
Parameters::CLS_PhaseFilter phase_filter
Parameters::CLS_ReinitializationMethod reinitialization_method
CahnHilliard_PhaseFilter - Defines the parameters for the phase filtration of CahnHilliard physics.
static void declare_parameters(ParameterHandler &prm)
Declare the Cahn-Hilliard phase-filter parameters.
void parse_parameters(ParameterHandler &prm)
Parse the Cahn-Hilliard phase-filter parameters.
Parameters::FilterType type
Parameters::Verbosity verbosity
void parse_parameters(ParameterHandler &prm, const Dimensionality &dimensions)
Parse the Cahn-Hilliard parameters.
void declare_parameters(ParameterHandler &prm) const
Declare the Cahn-Hilliard parameters.
Parameters::EpsilonVerbosity epsilon_verbosity
Parameters::EpsilonSetMethod epsilon_set_method
double potential_smoothing_coefficient
Parameters::CahnHilliard_PhaseFilter cahn_hilliard_phase_filter
Multiphysics - the parameters for multiphysics simulations and handles sub-physics parameters.
bool continuum_solid_dynamics
Parameters::CahnHilliard cahn_hilliard_parameters
bool thermal_buoyancy_force
void declare_parameters(ParameterHandler &prm) const
Declare the multiphysics parameters.
Parameters::CLS cls_parameters
void parse_parameters(ParameterHandler &prm, const Dimensionality &dimensions)
Parse the multiphysics parameters.
Parameters::QMOM qmom_parameters
Parameters::TimeHarmonicMaxwell< dim > time_harmonic_maxwell_parameters
Functions of space and time prescribing the fields of the QMOM physics. They are used for the initial...
void parse_parameters(ParameterHandler &prm)
Parse the "scalars" and "distribution" subsections of the current subsection. The number of component...
std::shared_ptr< Functions::ParsedFunction< dim > > scalars
Scalars, one component per scalar.
void set_time(const double time)
Set the time of all the functions.
std::shared_ptr< Functions::ParsedFunction< dim > > distribution
QMOMDistributionType distribution_type
Family of the particle size distribution.
static void declare_parameters(ParameterHandler &prm)
Declare the "scalars" and "distribution" subsections in the current subsection. All the functions are...
Process parameters of the lipid nanoparticle (LNP) production simulated with the QMOM physics: operat...
double molar_mass_aqueous
Molar mass of the aqueous phase [kg/mol].
double density_organic
Density of the organic phase [kg/m^3].
double mole_fraction_solubility_aqueous
Mole fraction solubility of the lipid in the pure aqueous phase [-].
double initial_concentration_organic
Initial lipid concentration in the organic phase [mol/m^3].
double permittivity_aqueous
Relative permittivity of the aqueous phase [-].
double mole_fraction_solubility_organic
Mole fraction solubility of the lipid in the pure organic phase [-].
double total_flow_rate
Total flow rate of the aqueous and organic phases [m^3/s].
double ion_concentration_mixture
Ion concentration in the mixture [mol/m^3].
void parse_parameters(ParameterHandler &prm)
Parse the "lipid nanoparticle production" subsection.
double molar_mass_organic
Molar mass of the organic phase [kg/mol].
double density_aqueous
Density of the aqueous phase [kg/m^3].
double operating_temperature
Operating temperature [K].
double viscosity_mixture
Dynamic viscosity of the aqueous and organic mixture [Pa s].
double shape_factor
Volume shape factor of the particles, pi/6 for spheres [-].
void declare_parameters(ParameterHandler &prm) const
Declare the "lipid nanoparticle production" subsection.
double flow_rate_ratio
Ratio of the aqueous phase flow rate to the organic phase flow rate [-].
double mixing_time_scale
Mixing time scale of the aqueous and organic phases [s].
double permittivity_organic
Relative permittivity of the organic phase [-].
Parameters of the phase-space evolution of the QMOM moments, which is delegated to QMOMKit.
void parse_parameters(ParameterHandler &prm)
Parse the "phase evolution" subsection.
void declare_parameters(ParameterHandler &prm) const
Declare the "phase evolution" subsection.
bool enable_adaptive_node_count
Enable the adaptive number of quadrature nodes.
Physical constants used by the QMOM physics, in SI units. Their default values are the exact values o...
double elementary_charge
Elementary charge [C].
double boltzmann_constant
Boltzmann constant [J/K].
double avogadro_number
Avogadro number [1/mol].
void parse_parameters(ParameterHandler &prm)
Parse the "physical constants" subsection.
double permittivity_vacuum
Vacuum permittivity [F/m].
void declare_parameters(ParameterHandler &prm) const
Declare the "physical constants" subsection.
Parameters of the quadrature method of moments (QMOM) physics, declared in the "QMOM" subsection.
std::vector< std::string > scalar_names
bool enable_growth
Include the growth source.
unsigned int number_of_scalars
Number of scalars transported together with the moments.
QMOMLipidNanoparticleProduction lipid_nanoparticle_production
void declare_parameters(ParameterHandler &prm) const
Declare the "QMOM" subsection.
QMOMPhysicalConstants physical_constants
Physical constants ("physical constants" subsection).
bool enable_nucleation
Include the nucleation source.
QMOMSplittingScheme splitting_scheme
bool enable_coalescence
Include the coalescence source.
unsigned int number_of_moments
Number of transported raw moments M_0 to M_{number_of_moments - 1}.
unsigned int number_of_nodes
void parse_parameters(ParameterHandler &prm)
Parse the "QMOM" subsection.
QMOMPhaseEvolution phase_evolution
Phase-space evolution ("phase evolution" subsection).
TimeHarmonicMaxwell - Defines the parameters for time-harmonic Maxwell simulations.
std::vector< unsigned int > mode_order_n
unsigned int number_of_waveguide_inlets
double electric_field_amplitude
double electromagnetic_frequency
unsigned int coupling_iteration
std::vector< std::array< Tensor< 1, dim >, Utilities::fixed_power< 2 >(dim - 1)> > waveguide_corners
std::vector< int > waveguide_boundary_ids
std::vector< Parameters::WaveguideMode > waveguide_mode
Parameters::TimeHarmonicMaxwellCouplingStrategy time_coupling_strategy
double coupling_threshold
double magnetic_field_amplitude
std::vector< unsigned int > mode_order_m
void declare_parameters(ParameterHandler &prm) const
Declare the time-harmonic Maxwell parameters.
void parse_parameters(ParameterHandler &prm, const Dimensionality &dimensions)
Parse the time-harmonic Maxwell parameters.
std::vector< double > waveguide_power
Parameters::ElectromagneticScalingType electromagnetic_scaling_type