8 if (viscosityModel ==
"constant")
10 forAll(mesh.C(), celli)
12 muFoamCorr[celli] = 1.0e-3;
17 if (viscosityModel ==
"castro-macosko")
19 double muTemp,alphacell,CXOH,CXW;
20 double muinf = 10.3*1e-8;
27 forAll(mesh.C(), celli)
30 alphacell = alpha2[celli];
36 XNCO[celli] = (CNCO_0 - (CNCO_0 - CXOH*COH_0 - 2*CXW*CW_0))/CNCO_0;
39 (muinf*Foam::exp(EnuR/(muTemp)) *
40 Foam::pow((XNCOGel/max((XNCOGel - XNCO[celli]),ROOTVSMALL)),
41 (nua + nub*XNCO[celli] + nuc*XNCO[celli]*XNCO[celli])))
48 if (viscosityModel ==
"bird-carreau")
51 double coeffalpha,coeffn,muTemp,lambdaBC,XOHC,alphacell,a,b,c,
d,mu0l,muinfl;
53 scalar EmuR = 10000.0;
65 forAll(mesh.C(), celli)
67 alphacell = alpha2[celli];
73 volScalarField shearRate = Foam::mag(fvc::grad(U));
77 (Foam::log(XOHC+d) - Foam::log(d) +
78 Foam::pow((XOH_Gel/max((XOH_Gel - XOHC),0.00001)),
79 ((a+b*XOHC+c*XOHC*XOHC))))*mu0l
83 (Foam::log(XOHC + d) - Foam::log(d) +
84 Foam::pow((XOH_Gel/max((XOH_Gel - XOHC),0.00001)),
85 ((a + b*XOHC + c*XOHC*XOHC))))*muinfl
90 ((muinf[celli] + (mag((mu0[celli] - muinf[celli]))*
91 Foam::pow((1.0 + Foam::pow((shearRate[celli]*lambdaBC),coeffalpha)),
92 ((coeffn - 1)/coeffalpha)))))
94 muFoamCorr[celli] = (muFoam[celli]*(Amu*Foam::exp(EmuR/
RR/muTemp)));
98 muFoamCorr[celli] = 1.0e-5;
103 if (viscosityModel ==
"MoDeNaRheology")
105 forAll(mesh.C(), celli)
107 if (alpha2[celli] > 0.5)
109 volScalarField shearRate = Foam::mag(fvc::grad(U));
111 modena_inputs_set(inputs_rheo,
temp_rheopos, TS[celli]);
112 modena_inputs_set(inputs_rheo,
conv_rheopos, XOH[celli]);
113 modena_inputs_set(inputs_rheo,
shear_rheopos, shearRate[celli]);
114 modena_inputs_set(inputs_rheo,
m0_rheopos, mZero[celli]);
115 modena_inputs_set(inputs_rheo,
m1_rheopos, mOne[celli]);
118 if (modena_error_occurred())
120 modena_inputs_destroy (inputs_rheo);
121 modena_outputs_destroy (outputs_rheo);
123 Info<<
"MoDeNa Error: " << (modena_error()) << endl;
126 muFoamCorr[celli] = modena_outputs_get(outputs_rheo, 0);
130 muMixture = alpha1*muAir + alpha2*muFoamCorr;
131 muMixture.correctBoundaryConditions();
size_t m0_rheopos
memory allocation for the moment of order zero as the input of rheology surrogate model ...
size_t temp_rheopos
memory allocation for the temperature as the input of rheology surrogate model
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
size_t m1_rheopos
memory allocation for the moment of order one as the input of rheology surrogate model ...
real(dp), dimension(:), allocatable d
diffusion coefficients (for each dissolved gas)
size_t conv_rheopos
memory allocation for the conversion as the input of rheology surrogate model
void modena_model_destroy(modena_model_t *self)
Function deallocating the memory allocated for the surrogate model.
size_t shear_rheopos
memory allocation for the shear rate as the input of rheology surrogate model