62 std::map<
int, std::shared_ptr<MaterialPropertyLib::Medium>>
const& media)
64 n_components_gas_{numberOfComponents(media,
"Gas")},
67 gas_phase_vapour_component_index_{findComponentIndex(
70 gas_phase_dry_air_component_index_{1 - gas_phase_vapour_component_index_},
73 liquid_phase_solute_component_index_{findComponentIndex(
74 media,
"AqueousLiquid",
77 liquid_phase_solvent_component_index_{
78 1 - liquid_phase_solute_component_index_}
80 DBUG(
"Create PhaseTransition constitutive model.");
85 "The current implementation of PhaseTransitionModelEvaporation "
86 "requires the specification of exactly two components in the "
92 auto const medium = media.begin()->second;
93 auto const& gas_phase = medium->phase(
"Gas");
94 auto const& liquid_phase = medium->phase(
"AqueousLiquid");
97 std::array
const required_vapour_component_properties = {
103 std::array
const required_dry_air_component_properties = {
107 std::array
const required_solute_component_properties = {
112 std::array
const required_solvent_component_properties = {
118 std::array
const required_liquid_properties = {
121 checkRequiredProperties(
123 required_vapour_component_properties);
124 checkRequiredProperties(
126 required_dry_air_component_properties);
127 checkRequiredProperties(
129 required_solute_component_properties);
130 checkRequiredProperties(
132 required_solvent_component_properties);
133 checkRequiredProperties(gas_phase, required_gas_properties);
134 checkRequiredProperties(liquid_phase, required_liquid_properties);
154 auto const pGR = p_GR();
155 auto const pCap = p_cap();
156 auto const T = T_data.
T;
161 auto const& liquid_phase = media_data.
liquid;
162 auto const& gas_phase = media_data.
gas;
167 auto const& vapour_component =
169 auto const& dry_air_component =
176 .template value<double>(variables, x_t.
x, x_t.
t, x_t.
dt);
181 .template value<double>(variables, x_t.
x, x_t.
t, x_t.
dt);
189 const auto p_vap_flat =
192 .template value<double>(variables, x_t.
x, x_t.
t, x_t.
dt);
194 const auto dp_vap_flat_dT =
197 .template dValue<double>(variables,
199 x_t.
x, x_t.
t, x_t.
dt);
205 .template value<double>(variables, x_t.
x, x_t.
t, x_t.
dt);
209 auto const pLR = pGR - pCap;
214 pCap > 0. ? std::exp(-pCap * M_W / rho_W_LR() / R / T) : 1.;
216 pCap > 0. ? pCap * M_W / rho_W_LR() / R / T / T * K : 0;
217 const double dK_dpCap =
218 pCap > 0. ? -M_W / rho_W_LR() / R / T * K
224 vapour_pressure_data.
pWGR = p_vap_flat * K;
225 auto const dpWGR_dT = dp_vap_flat_dT * K + p_vap_flat * dK_dT;
226 auto const dpWGR_dpCap = p_vap_flat * dK_dpCap;
229 auto const xnWG_min =
237 std::clamp(vapour_pressure_data.
pWGR / pGR, xnWG_min, 1. - xnWG_min);
238 mass_mole_fractions_data.
xnCG = 1. - cv.
xnWG;
241 auto const dxnWG_dpGR = -vapour_pressure_data.
pWGR / pGR / pGR;
242 auto const dxnWG_dpCap = dpWGR_dpCap / pGR;
243 auto const dxnWG_dT = dpWGR_dT / pGR;
246 auto const MG = mass_mole_fractions_data.
xnCG * M_C + cv.
xnWG * M_W;
251 mass_mole_fractions_data.
xmCG = 1. - cv.
xmWG;
253 auto const dxn_dxm_conversion = M_W * M_C / MG / MG;
255 cv.
dxmWG_dpGR = dxnWG_dpGR * dxn_dxm_conversion;
257 cv.
dxmWG_dT = dxnWG_dT * dxn_dxm_conversion;
260 fluid_density_data.
rho_GR =
262 .template value<double>(variables, x_t.
x, x_t.
t, x_t.
dt);
265 auto const dMG = M_W - M_C;
266 auto const dMG_dpGR = dxnWG_dpGR * dMG;
277 .template dValue<double>(
279 x_t.
x, x_t.
t, x_t.
dt);
281 auto const dMG_dpCap = dxnWG_dpCap * dMG;
285 .template dValue<double>(
287 x_t.
x, x_t.
t, x_t.
dt);
289 auto const dMG_dT = dxnWG_dT * dMG;
293 .template dValue<double>(variables,
295 x_t.
x, x_t.
t, x_t.
dt);
304 mass_mole_fractions_data.
xmCG * fluid_density_data.
rho_GR;
327 .template value<double>(variables, x_t.
x, x_t.
t, x_t.
dt);
331 .template value<double>(variables, x_t.
x, x_t.
t, x_t.
dt);
335 cv.
hWG = cpWG * T + dh_evap;
342 cv.
uG = enthalpy_data.
h_G - pGR / fluid_density_data.
rho_GR;
345 auto const tortuosity =
348 .template value<double>(variables, x_t.
x, x_t.
t, x_t.
dt);
352 .template value<double>(variables, x_t.
x, x_t.
t, x_t.
dt);
354 tortuosity * D_W_G_m;
359 viscosity_data.
mu_GR =
361 .template value<double>(variables, x_t.
x, x_t.
t, x_t.
dt);
367 auto const& solute_component =
378 .template value<double>(variables, x_t.
x, x_t.
t, x_t.
dt);
383 .template dValue<double>(variables,
385 x_t.
x, x_t.
t, x_t.
dt);
389 .template dValue<double>(
391 x_t.
x, x_t.
t, x_t.
dt);
395 auto const cCL = H * mass_mole_fractions_data.
xnCG * pGR;
398 auto const dxnCG_dpGR = -dxnWG_dpGR;
399 auto const dxnCG_dT = -dxnWG_dT;
401 auto const dcCL_dpGR =
402 (dH_dpGR * mass_mole_fractions_data.
xnCG + H * dxnCG_dpGR) * pGR +
403 H * mass_mole_fractions_data.
xnCG;
405 pGR * (dH_dT * mass_mole_fractions_data.
xnCG + H * dxnCG_dT);
417 fluid_density_data.
rho_LR =
419 .template value<double>(variables, x_t.
x, x_t.
t, x_t.
dt);
423 constituent_density_data.
rho_C_LR = fluid_density_data.
rho_LR - rho_W_LR();
426 mass_mole_fractions_data.
xmWL =
427 std::clamp(rho_W_LR() / fluid_density_data.
rho_LR, 0., 1.);
428 auto const xmCL = 1. - mass_mole_fractions_data.
xmWL;
447 auto const rho_ref_betaP =
449 .template dValue<double>(
451 x_t.
x, x_t.
t, x_t.
dt);
453 auto const rho_ref_betaT =
455 .template dValue<double>(variables,
457 x_t.
x, x_t.
t, x_t.
dt);
459 auto const rho_ref_betaC =
461 .template dValue<double>(
466 auto const drhoLR_dpGR = rho_ref_betaP + rho_ref_betaC * dcCL_dpGR;
467 auto const drhoLR_dpCap = -rho_ref_betaP;
468 auto const drhoLR_dT = rho_ref_betaT + rho_ref_betaC * dcCL_dT;
471 auto const drhoWLR_dpGR = rho_ref_betaP;
472 auto const drhoWLR_dpCap = -rho_ref_betaP;
473 auto const drhoWLR_dT = rho_ref_betaT;
477 1. / fluid_density_data.
rho_LR *
478 (drhoWLR_dpGR - mass_mole_fractions_data.
xmWL * drhoLR_dpGR);
480 1. / fluid_density_data.
rho_LR *
481 (drhoWLR_dpCap - mass_mole_fractions_data.
xmWL * drhoLR_dpCap);
483 (drhoWLR_dT - mass_mole_fractions_data.
xmWL * drhoLR_dT);
486 mass_mole_fractions_data.
xnWL =
487 mass_mole_fractions_data.
xmWL * M_C /
488 (mass_mole_fractions_data.
xmWL * M_C + xmCL * M_W);
491 auto const& solvent_component =
498 .template value<double>(variables, x_t.
x, x_t.
t, x_t.
dt);
502 .template value<double>(variables, x_t.
x, x_t.
t, x_t.
dt);
508 .template value<double>(variables, x_t.
x, x_t.
t, x_t.
dt);
511 cv.
hCL = cpCL * T + dh_sol;
513 enthalpy_data.
h_L = xmCL * cv.
hCL + mass_mole_fractions_data.
xmWL * cv.
hWL;
516 cv.
uL = enthalpy_data.
h_L;
521 .template value<double>(variables, x_t.
x, x_t.
t, x_t.
dt);
523 tortuosity * D_C_L_m;
526 viscosity_data.
mu_LR =
528 .template value<double>(variables, x_t.
x, x_t.
t, x_t.
dt);
void eval(SpaceTimeData const &x_t, MediaData const &media_data, GasPressureData const &p_GR, CapillaryPressureData const &p_cap, TemperatureData const &T_data, PureLiquidDensityData const &rho_W_LR, ViscosityData &viscosity_data, EnthalpyData &enthalpy_data, MassMoleFractionsData &mass_mole_fractions_data, FluidDensityData &fluid_density_data, VapourPartialPressureData &vapour_pressure_data, ConstituentDensityData &constituent_density_data, PhaseTransitionData &cv) const override