58 std::map<
int, std::shared_ptr<MaterialPropertyLib::Medium>>
const& media)
70 media,
"AqueousLiquid",
76 DBUG(
"Create PhaseTransition constitutive model.");
81 "The current implementation of PhaseTransitionModelEvaporation "
82 "requires the specification of exactly two components in the "
88 auto const medium = media.begin()->second;
90 auto const& liquid_phase =
94 std::array
const required_medium_properties = {
96 checkRequiredProperties(*medium, required_medium_properties);
99 std::array
const required_vapour_component_properties = {
105 std::array
const required_dry_air_component_properties = {
109 std::array
const required_solute_component_properties = {
114 std::array
const required_solvent_component_properties = {
119 std::array
const required_liquid_properties = {
122 checkRequiredProperties(
124 required_vapour_component_properties);
125 checkRequiredProperties(
127 required_dry_air_component_properties);
128 checkRequiredProperties(
130 required_solute_component_properties);
131 checkRequiredProperties(
133 required_solvent_component_properties);
134 checkRequiredProperties(gas_phase, required_gas_properties);
135 checkRequiredProperties(liquid_phase, required_liquid_properties);
154 auto const pGR = p_GR.
pG;
155 auto const pCap = p_cap.
pCap;
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. - 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 + xnWG * M_W;
250 double const xmWG = xnWG * M_W / MG;
251 mass_mole_fractions_data.
xmCG = 1. - 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;
305 constituent_density_data.
rho_W_GR = xmWG * 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;
338 fluid_enthalpy_data.
h_G =
339 mass_mole_fractions_data.
xmCG * cv.
hCG + xmWG * cv.
hWG;
343 cv.
uG = fluid_enthalpy_data.
h_G - pGR / fluid_density_data.
rho_GR;
349 auto const tortuosity = media_data.
tortuosity_prop->template value<double>(
350 variables, x_t.
x, x_t.
t, x_t.
dt);
354 .template value<double>(variables, x_t.
x, x_t.
t, x_t.
dt);
356 tortuosity * D_W_G_m;
364 auto const& solute_component =
375 .template value<double>(variables, x_t.
x, x_t.
t, x_t.
dt);
380 .template dValue<double>(variables,
382 x_t.
x, x_t.
t, x_t.
dt);
386 .template dValue<double>(
388 x_t.
x, x_t.
t, x_t.
dt);
392 auto const cCL = H * mass_mole_fractions_data.
xnCG * pGR;
395 auto const dxnCG_dpGR = -dxnWG_dpGR;
396 auto const dxnCG_dT = -dxnWG_dT;
398 auto const dcCL_dpGR =
399 (dH_dpGR * mass_mole_fractions_data.
xnCG + H * dxnCG_dpGR) * pGR +
400 H * mass_mole_fractions_data.
xnCG;
402 pGR * (dH_dT * mass_mole_fractions_data.
xnCG + H * dxnCG_dT);
414 fluid_density_data.
rho_LR =
416 .template value<double>(variables, x_t.
x, x_t.
t, x_t.
dt);
420 constituent_density_data.
rho_C_LR = fluid_density_data.
rho_LR - rho_W_LR();
423 mass_mole_fractions_data.
xmWL =
424 std::clamp(rho_W_LR() / fluid_density_data.
rho_LR, 0., 1.);
425 auto const xmCL = 1. - mass_mole_fractions_data.
xmWL;
444 auto const rho_ref_betaP =
446 .template dValue<double>(
448 x_t.
x, x_t.
t, x_t.
dt);
450 auto const rho_ref_betaT =
452 .template dValue<double>(variables,
454 x_t.
x, x_t.
t, x_t.
dt);
456 auto const rho_ref_betaC =
458 .template dValue<double>(
463 auto const drhoLR_dpGR = rho_ref_betaP + rho_ref_betaC * dcCL_dpGR;
464 auto const drhoLR_dpCap = -rho_ref_betaP;
465 cv.
drho_LR_dT = rho_ref_betaT + rho_ref_betaC * dcCL_dT;
468 auto const drhoWLR_dpGR = rho_ref_betaP;
469 auto const drhoWLR_dpCap = -rho_ref_betaP;
470 auto const drhoWLR_dT = rho_ref_betaT;
474 1. / fluid_density_data.
rho_LR *
475 (drhoWLR_dpGR - mass_mole_fractions_data.
xmWL * drhoLR_dpGR);
477 1. / fluid_density_data.
rho_LR *
478 (drhoWLR_dpCap - mass_mole_fractions_data.
xmWL * drhoLR_dpCap);
483 mass_mole_fractions_data.
xnWL =
484 mass_mole_fractions_data.
xmWL * M_C /
485 (mass_mole_fractions_data.
xmWL * M_C + xmCL * M_W);
488 auto const& solvent_component =
495 .template value<double>(variables, x_t.
x, x_t.
t, x_t.
dt);
499 .template value<double>(variables, x_t.
x, x_t.
t, x_t.
dt);
505 .template value<double>(variables, x_t.
x, x_t.
t, x_t.
dt);
508 double const hCL = cpCL * T + dh_sol;
509 double const hWL = cpWL * T;
510 fluid_enthalpy_data.
h_L = xmCL * hCL + mass_mole_fractions_data.
xmWL * hWL;
514 cv.
uL = fluid_enthalpy_data.
h_L;
520 .template value<double>(variables, x_t.
x, x_t.
t, x_t.
dt);
522 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