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 = {
117 std::array
const required_liquid_properties = {
120 checkRequiredProperties(
122 required_vapour_component_properties);
123 checkRequiredProperties(
125 required_dry_air_component_properties);
126 checkRequiredProperties(
128 required_solute_component_properties);
129 checkRequiredProperties(
131 required_solvent_component_properties);
132 checkRequiredProperties(gas_phase, required_gas_properties);
133 checkRequiredProperties(liquid_phase, required_liquid_properties);
152 auto const pGR = p_GR();
153 auto const pCap = p_cap();
154 auto const T = T_data.
T;
159 auto const& liquid_phase = media_data.
liquid;
160 auto const& gas_phase = media_data.
gas;
165 auto const& vapour_component =
167 auto const& dry_air_component =
174 .template value<double>(variables, x_t.
x, x_t.
t, x_t.
dt);
179 .template value<double>(variables, x_t.
x, x_t.
t, x_t.
dt);
187 const auto p_vap_flat =
190 .template value<double>(variables, x_t.
x, x_t.
t, x_t.
dt);
192 const auto dp_vap_flat_dT =
195 .template dValue<double>(variables,
197 x_t.
x, x_t.
t, x_t.
dt);
203 .template value<double>(variables, x_t.
x, x_t.
t, x_t.
dt);
207 auto const pLR = pGR - pCap;
212 pCap > 0. ? std::exp(-pCap * M_W / rho_W_LR() / R / T) : 1.;
214 pCap > 0. ? pCap * M_W / rho_W_LR() / R / T / T * K : 0;
215 const double dK_dpCap =
216 pCap > 0. ? -M_W / rho_W_LR() / R / T * K
222 vapour_pressure_data.
pWGR = p_vap_flat * K;
223 auto const dpWGR_dT = dp_vap_flat_dT * K + p_vap_flat * dK_dT;
224 auto const dpWGR_dpCap = p_vap_flat * dK_dpCap;
227 auto const xnWG_min =
235 std::clamp(vapour_pressure_data.
pWGR / pGR, xnWG_min, 1. - xnWG_min);
236 mass_mole_fractions_data.
xnCG = 1. - xnWG;
239 auto const dxnWG_dpGR = -vapour_pressure_data.
pWGR / pGR / pGR;
240 auto const dxnWG_dpCap = dpWGR_dpCap / pGR;
241 auto const dxnWG_dT = dpWGR_dT / pGR;
244 auto const MG = mass_mole_fractions_data.
xnCG * M_C + xnWG * M_W;
248 double const xmWG = xnWG * M_W / MG;
249 mass_mole_fractions_data.
xmCG = 1. - xmWG;
251 auto const dxn_dxm_conversion = M_W * M_C / MG / MG;
253 cv.
dxmWG_dpGR = dxnWG_dpGR * dxn_dxm_conversion;
255 cv.
dxmWG_dT = dxnWG_dT * dxn_dxm_conversion;
258 fluid_density_data.
rho_GR =
260 .template value<double>(variables, x_t.
x, x_t.
t, x_t.
dt);
263 auto const dMG = M_W - M_C;
264 auto const dMG_dpGR = dxnWG_dpGR * dMG;
275 .template dValue<double>(
277 x_t.
x, x_t.
t, x_t.
dt);
279 auto const dMG_dpCap = dxnWG_dpCap * dMG;
283 .template dValue<double>(
285 x_t.
x, x_t.
t, x_t.
dt);
287 auto const dMG_dT = dxnWG_dT * dMG;
291 .template dValue<double>(variables,
293 x_t.
x, x_t.
t, x_t.
dt);
302 mass_mole_fractions_data.
xmCG * fluid_density_data.
rho_GR;
303 constituent_density_data.
rho_W_GR = xmWG * fluid_density_data.
rho_GR;
325 .template value<double>(variables, x_t.
x, x_t.
t, x_t.
dt);
329 .template value<double>(variables, x_t.
x, x_t.
t, x_t.
dt);
333 cv.
hWG = cpWG * T + dh_evap;
336 fluid_enthalpy_data.
h_G =
337 mass_mole_fractions_data.
xmCG * cv.
hCG + xmWG * cv.
hWG;
341 cv.
uG = fluid_enthalpy_data.
h_G - pGR / fluid_density_data.
rho_GR;
346 auto const tortuosity =
349 .template value<double>(variables, x_t.
x, x_t.
t, x_t.
dt);
353 .template value<double>(variables, x_t.
x, x_t.
t, x_t.
dt);
355 tortuosity * D_W_G_m;
363 auto const& solute_component =
374 .template value<double>(variables, x_t.
x, x_t.
t, x_t.
dt);
379 .template dValue<double>(variables,
381 x_t.
x, x_t.
t, x_t.
dt);
385 .template dValue<double>(
387 x_t.
x, x_t.
t, x_t.
dt);
391 auto const cCL = H * mass_mole_fractions_data.
xnCG * pGR;
394 auto const dxnCG_dpGR = -dxnWG_dpGR;
395 auto const dxnCG_dT = -dxnWG_dT;
397 auto const dcCL_dpGR =
398 (dH_dpGR * mass_mole_fractions_data.
xnCG + H * dxnCG_dpGR) * pGR +
399 H * mass_mole_fractions_data.
xnCG;
401 pGR * (dH_dT * mass_mole_fractions_data.
xnCG + H * dxnCG_dT);
413 fluid_density_data.
rho_LR =
415 .template value<double>(variables, x_t.
x, x_t.
t, x_t.
dt);
419 constituent_density_data.
rho_C_LR = fluid_density_data.
rho_LR - rho_W_LR();
422 mass_mole_fractions_data.
xmWL =
423 std::clamp(rho_W_LR() / fluid_density_data.
rho_LR, 0., 1.);
424 auto const xmCL = 1. - mass_mole_fractions_data.
xmWL;
443 auto const rho_ref_betaP =
445 .template dValue<double>(
447 x_t.
x, x_t.
t, x_t.
dt);
449 auto const rho_ref_betaT =
451 .template dValue<double>(variables,
453 x_t.
x, x_t.
t, x_t.
dt);
455 auto const rho_ref_betaC =
457 .template dValue<double>(
462 auto const drhoLR_dpGR = rho_ref_betaP + rho_ref_betaC * dcCL_dpGR;
463 auto const drhoLR_dpCap = -rho_ref_betaP;
464 cv.
drho_LR_dT = rho_ref_betaT + rho_ref_betaC * dcCL_dT;
467 auto const drhoWLR_dpGR = rho_ref_betaP;
468 auto const drhoWLR_dpCap = -rho_ref_betaP;
469 auto const drhoWLR_dT = rho_ref_betaT;
473 1. / fluid_density_data.
rho_LR *
474 (drhoWLR_dpGR - mass_mole_fractions_data.
xmWL * drhoLR_dpGR);
476 1. / fluid_density_data.
rho_LR *
477 (drhoWLR_dpCap - mass_mole_fractions_data.
xmWL * drhoLR_dpCap);
482 mass_mole_fractions_data.
xnWL =
483 mass_mole_fractions_data.
xmWL * M_C /
484 (mass_mole_fractions_data.
xmWL * M_C + xmCL * M_W);
487 auto const& solvent_component =
494 .template value<double>(variables, x_t.
x, x_t.
t, x_t.
dt);
498 .template value<double>(variables, x_t.
x, x_t.
t, x_t.
dt);
504 .template value<double>(variables, x_t.
x, x_t.
t, x_t.
dt);
507 double const hCL = cpCL * T + dh_sol;
508 double const hWL = cpWL * T;
509 fluid_enthalpy_data.
h_L = xmCL * hCL + mass_mole_fractions_data.
xmWL * hWL;
513 cv.
uL = fluid_enthalpy_data.
h_L;
519 .template value<double>(variables, x_t.
x, x_t.
t, x_t.
dt);
521 tortuosity * D_C_L_m;
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, FluidEnthalpyData &fluid_enthalpy_data, MassMoleFractionsData &mass_mole_fractions_data, FluidDensityData &fluid_density_data, VapourPartialPressureData &vapour_pressure_data, ConstituentDensityData &constituent_density_data, PhaseTransitionData &cv) const override