14 dimensionedScalar oneTwo
24 volScalarField rhoPolySM
31 IOobject::READ_IF_PRESENT,
35 dimensionedScalar(
"rhoPolySM", dimless, 1100.0)
43 forAll(mesh.C(), celli)
45 if (liquidMixtureDensitySurrogate)
48 modena_inputs_set(inputs_den, Td_pos, TS[celli]);
49 modena_inputs_set(inputs_den, XOHd_pos, XOH[celli]);
53 density_reaction_mixturemodel,
59 modena_inputs_destroy (inputs_den);
60 modena_outputs_destroy (outputs_den);
64 rhoPolySM[celli] = modena_outputs_get(outputs_den, 0);
71 rhoPolySM.correctBoundaryConditions();
75 dimensionedScalar dumVar1 (
"dumVar1",dimensionSet(1,-1,-2,-1,0,0,0), 1.0);
76 dimensionedScalar dumVar2 (
"dumVar2",dimensionSet(0,-2,2,1,0,0,0), 1.0);
78 forAll(mesh.C(), celli)
80 if (wCO2_g[celli] < 0.0)
82 wCO2_g[celli] = ROOTVSMALL;
84 if (wBA_g[celli] < 0.0)
86 wBA_g[celli] = ROOTVSMALL;
94 volScalarField rho_bubble
97 /max((scalar(1000.0)*(wCO2_g + wBA_g)),ROOTVSMALL))
102 dumVar2*(rho_bubble*(mOne/(scalar(1.0) + mOne))
103 + dumVar1*((scalar(1.0) +
L0)*rhoPolySM
104 *(scalar(1.0) - (mOne/(scalar(1.0) + mOne)))))
109 dimensionedScalar dumVar1 (
"dumVar1",dimensionSet(0,2,-2,-1,0,0,0), 1.0);
110 dimensionedScalar dumVar2 (
"dumVar2",dimensionSet(-1,3,0,0,0,0,0), 1.0);
112 forAll(mesh.C(), celli)
114 scalar
temp, henry_coeff;
118 scalar wCO2_g_val, wBA_g_val, pr, bubble_radius, mZero_val, mOne_val;
120 mZero_val = mOne_val = 0.0;
123 wCO2_g_val = wCO2_g[celli];
124 wBA_g_val = wBA_g[celli];
127 scalar partialPressure_CO2;
128 partialPressure_CO2 =
132 wCO2_g_val, wBA_g_val, pr, bubble_radius
136 wCO2_Max =
wCO2Max (
M_CO2, M_liq, partialPressure_CO2, henry_coeff);
140 ((CW_0*XW[celli]*
M_CO2)/(scalar(1000.0)*rhoPolySM[celli])) - wCO2_Max
143 if (CO2[celli] < 0.0)
151 (((CO2*scalar(1000.0)*
RR*TS)/(p*
M_CO2))*dumVar1
152 + ((wBA_g*scalar(1000.0)*
RR*TS)/(p*M_B))*dumVar1
153 + ((wBA_l)/(
rhoBL))*dumVar2
154 + (scalar(1.0)/rhoPolySM)*dumVar2)
size_t modena_model_inputs_argPos(const modena_model_t *self, const char *name)
Function determining position of an argument in the input vector.
double henryCoefficient(double &T)
Henry coefficient for CO2.
real(dp) temp
temperature (K)
double partialPressureCO2(const state_type &y)
partial pressure of CO2
double surfaceTension
required for the computation of partial pressure
double M_CO2
Molecular mass of carbon dioxide, kg/kmol.
int modena_model_call(modena_model_t *self, modena_inputs_t *inputs, modena_outputs_t *outputs)
Function calling the surrogate model and checking for errors.
double RR
ideal gas constant, J/mol K
double bubbleRadius(const double m0, const double m1)
radius of bubbles based on the moments
double rhoPoly
density of the liquid polymer, kg/m3
void modena_model_destroy(modena_model_t *self)
Function deallocating the memory allocated for the surrogate model.
double rhoBL
density of the blowing agent, kg/m3
double M_B
Molecular mass of blowing agent, kg/kmol.
double L0
Initial weight fraction of blowing agent in the liquid, -.
double wCO2Max(double &M_CO2, double &M_liq, double &pCO2, double &henryCoeff)
dissolved amount of CO2 in liquid
void modena_model_argPos_check(const modena_model_t *self)
Function checking that the user has queried all input positions.