16 IOdictionary kineticsProperties
29 word KineticsModel(kineticsProperties.lookup(
"KineticsModel"));
33 !(KineticsModel ==
"generic" 34 || KineticsModel ==
"RF-1" )
37 FatalErrorIn(args.executable())
38 <<
"Invalid kinetics model " << KineticsModel
39 <<
"\nValid kinetics models are: " 44 scalar AOH, EOH, COH_0, CNCO_0, CW_0, AW, EW;
45 AOH=EOH=COH_0=CNCO_0=CW_0=AW=EW=0.0;
47 if (KineticsModel ==
"generic")
50 readScalar(kineticsProperties.subDict(
"GellingConstants").lookup(
"A_OH"));
52 readScalar(kineticsProperties.subDict(
"GellingConstants").lookup(
"E_OH"));
57 kineticsProperties.subDict(
"GellingConstants").lookup(
"initCOH")
62 kineticsProperties.subDict(
"GellingConstants").lookup(
"initCNCO")
67 kineticsProperties.subDict(
"GellingConstants").lookup(
"initCW")
70 readScalar(kineticsProperties.subDict(
"BlowingConstants").lookup(
"A_W"));
72 readScalar(kineticsProperties.subDict(
"BlowingConstants").lookup(
"E_W"));
73 if (EOH < 0.0 || COH_0 < 0.0 || CNCO_0 < 0.0 || CW_0 < 0.0 )
75 FatalErrorIn(args.executable())
76 <<
"Invalid value for gelling constants!" 77 "\nGelling constats cannot be negative." 82 FatalErrorIn(args.executable())
83 <<
"Invalid value for blowing constants!" 84 "\nActivation energy cannot be negative." 92 kineticsProperties.subDict(
"GellingConstants").lookup(
"gellingPoint")
96 FatalErrorIn(args.executable())
97 <<
"Invalid value for gelling point!" 98 "\nGelling point cannot be negative." 103 word blowingAgent(kineticsProperties.lookup(
"blowingAgent"));
107 !(blowingAgent ==
"n-pentane" 108 || blowingAgent ==
"R-11" 109 || blowingAgent ==
"no")
112 FatalErrorIn(args.executable())
113 << blowingAgent <<
" Is an invalid type of physical blowing agent." 114 <<
"\nValid types are: " 125 kineticsProperties.subDict(
"GenericConstants").lookup(
"idealGasCons")
130 kineticsProperties.subDict(
"GenericConstants").lookup(
"rhoPolymer")
135 kineticsProperties.subDict(
"GenericConstants").lookup(
"rhoBlowingAgent")
140 kineticsProperties.subDict(
"GenericConstants").lookup(
"molecularMassCO2")
145 kineticsProperties.subDict(
"GenericConstants").lookup(
"molecularMassBlowingAgent")
150 kineticsProperties.subDict(
"GenericConstants").lookup(
"molecularMassNCO")
155 kineticsProperties.subDict(
"GenericConstants").lookup(
"dxdTcons")
160 kineticsProperties.subDict(
"GenericConstants").lookup(
"initBlowingAgent")
165 kineticsProperties.subDict(
"GenericConstants").lookup(
"molecularMassLiquidFoam")
170 kineticsProperties.subDict(
"GenericConstants").lookup(
"surfaceTension")
175 RR < 0.0 || rhoPoly < 0.0 || rhoBL < 0.0
176 || M_B < 0.0 || M_CO2 < 0.0 || M_NCO < 0.0
177 || L0 < 0.0 || M_liq < 0.0 || surfaceTension < 0.0
180 FatalErrorIn(args.executable())
181 <<
"\nInvalid value for generic constants!" 189 kineticsProperties.subDict(
"EnthalpyConstants").lookup(
"deltaOH")
194 kineticsProperties.subDict(
"EnthalpyConstants").lookup(
"deltaW")
199 kineticsProperties.subDict(
"EnthalpyConstants").lookup(
"PUspecificHeat")
204 kineticsProperties.subDict(
"EnthalpyConstants").lookup(
"latentHeat")
207 Switch liquidMixtureDensitySurrogate
209 kineticsProperties.lookup(
"liquidMixtureDensitySurrogate")
212 Info<<
"Reading field XW \n" << endl;
226 Info<<
"Creating field rho_foam*alpha2\n" << endl;
227 volScalarField rhoFoamAlpha2
233 Info<<
"Creating surface field of rho_foam*alpha2*U\n" << endl;
234 surfaceScalarField frhoFoamAlpha2
236 fvc::interpolate(rhoFoamAlpha2)*phi
239 volScalarField::Internal XWSource
248 dimensionedScalar(
"XWSource", dimensionSet(0,0,-1,0,0,0,0), 0.0)
251 volScalarField::Internal XOHSource
260 dimensionedScalar(
"XOHSource", dimensionSet(0,0,-1,0,0,0,0), 0.0)
263 Info<<
"Reading field XOH \n" << endl;
277 Info<<
"\nCreating source fields ScNonXOH for XOH: " << endl;
278 volScalarField::Internal ScNonXOH
287 dimensionedScalar(
"ScNonXOH", dimensionSet(0,0,-1,0,0,0,0), 0.0)
290 Info<<
"\nCreating first order coefficient for XOH source: " << endl;
291 volScalarField::Internal Coeff_1stOrd
300 dimensionedScalar(
"Coeff_1stOrd", dimensionSet(0,0,-1,0,0,0,0), 0.0)
303 Info<<
"Creating SuXOH and SpXOH for the second order term of in XOH source" << endl;
304 volScalarField::Internal SuXOH
313 dimensionedScalar(
"SuXOH", dimensionSet(0,0,-1,0,0,0,0), 0.0)
315 volScalarField::Internal SpXOH
324 dimensionedScalar(
"SpXOH", dimensionSet(0,0,-1,0,0,0,0), 0.0)
327 volScalarField::Internal TSource
336 dimensionedScalar(
"TSource", dimensionSet(1,-3,-1,1,0,0,0), 0.0)
339 Info<<
"Reading field wBA_g, blowing agent in gas \n" << endl;
352 volScalarField::Internal wBA_gSource
361 dimensionedScalar(
"wBA_gSource", dimensionSet(0,0,-1,0,0,0,0), 0.0)
364 Info<<
"Reading field wBA_l, blowing agent in liquid \n" << endl;
378 volScalarField::Internal wBA_lSource
387 dimensionedScalar(
"wBA_lSource", dimensionSet(0,0,-1,0,0,0,0), 0.0)
390 Info<<
"Reading field wCO2_l, CO2 in liquid \n" << endl;
391 volScalarField wCO2_l
403 volScalarField::Internal wCO2_lSource
412 dimensionedScalar(
"wCO2_lSource", dimensionSet(0,0,-1,0,0,0,0), 0.0)
415 Info<<
"Reading field wCO2_g, CO2 in gas \n" << endl;
416 volScalarField wCO2_g
428 volScalarField::Internal wCO2_gSource
437 dimensionedScalar(
"wCO2_gSource", dimensionSet(0,0,-1,0,0,0,0), 0.0)
440 Info<<
"Reading field g1_CO2, source of mOne due to the generation of CO2\n" << endl;
441 volScalarField g1_CO2
453 Info<<
"Reading field g1_BA, source of mOne due to the evaporation of blowing agent\n" << endl;
466 Info<<
"Reading field cc1, a constant based on the growth rate due to blowing agent\n" << endl;
487 IOobject::READ_IF_PRESENT,
491 dimensionedScalar(
"CO2", dimless, 0.0)
493 volScalarField creamT
500 IOobject::READ_IF_PRESENT,
504 dimensionedScalar(
"creamT", dimless, 0.0)
513 IOobject::READ_IF_PRESENT,
517 dimensionedScalar(
"TS", dimensionSet(0,0,0,1,0,0,0), 298.0)
519 volScalarField::Internal TSSource
528 dimensionedScalar(
"TSSource", dimensionSet(0,0,-1,1,0,0,0), 0.0)
531 Info<<
"Reading field Catalyst_1 \n" << endl;
532 volScalarField Catalyst_1
544 Info<<
"Reading field CE_A0 \n" << endl;
557 Info<<
"Reading field CE_A1 \n" << endl;
570 Info<<
"Reading field CE_B \n" << endl;
583 Info<<
"Reading field CE_B2 \n" << endl;
596 Info<<
"Reading field CE_I0 \n" << endl;
609 Info<<
"Reading field CE_I1 \n" << endl;
622 Info<<
"Reading field CE_I2 \n" << endl;
635 Info<<
"Reading field CE_PBA \n" << endl;
636 volScalarField CE_PBA
648 Info<<
"Reading field CE_Breac \n" << endl;
649 volScalarField CE_Breac
661 Info<<
"Reading field CE_Areac0 \n" << endl;
662 volScalarField CE_Areac0
674 Info<<
"Reading field CE_Areac1 \n" << endl;
675 volScalarField CE_Areac1
687 Info<<
"Reading field CE_Ireac0 \n" << endl;
688 volScalarField CE_Ireac0
700 Info<<
"Reading field CE_Ireac1 \n" << endl;
701 volScalarField CE_Ireac1
713 Info<<
"Reading field CE_Ireac2 \n" << endl;
714 volScalarField CE_Ireac2
726 Info<<
"Reading field Bulk \n" << endl;
739 Info<<
"Reading field R_1 \n" << endl;
752 Info<<
"Reading field R_1_mass \n" << endl;
753 volScalarField R_1_mass
765 Info<<
"Reading field R_1_temp_RF1 \n" << endl;
766 volScalarField R_1_temp_RF1
778 Info<<
"Reading field R_1_vol_RF1 \n" << endl;
779 volScalarField R_1_vol_RF1
792 Info<<
"Creating source term source_Catalyst_1" << endl;
793 volScalarField source_Catalyst_1
802 dimensionedScalar(
"source_Catalyst_1", dimensionSet(0,0,-1,0,0,0,0), 0.0)
804 Info<<
"Creating source term source_CE_A0" << endl;
805 volScalarField source_CE_A0
814 dimensionedScalar(
"source_CE_A0", dimensionSet(0,0,-1,0,0,0,0), 0.0)
816 Info<<
"Creating source term source_CE_A1" << endl;
817 volScalarField source_CE_A1
826 dimensionedScalar(
"source_CE_A1", dimensionSet(0,0,-1,0,0,0,0), 0.0)
828 Info<<
"Creating source term source_CE_B" << endl;
829 volScalarField source_CE_B
838 dimensionedScalar(
"source_CE_B", dimensionSet(0,0,-1,0,0,0,0), 0.0)
840 Info<<
"Creating source term source_CE_B2" << endl;
841 volScalarField source_CE_B2
850 dimensionedScalar(
"source_CE_B2", dimensionSet(0,0,-1,0,0,0,0), 0.0)
852 Info<<
"Creating source term source_CE_I0" << endl;
853 volScalarField source_CE_I0
862 dimensionedScalar(
"source_CE_I0", dimensionSet(0,0,-1,0,0,0,0), 0.0)
864 Info<<
"Creating source term source_CE_I1" << endl;
865 volScalarField source_CE_I1
874 dimensionedScalar(
"source_CE_I1", dimensionSet(0,0,-1,0,0,0,0), 0.0)
876 Info<<
"Creating source term source_CE_I2" << endl;
877 volScalarField source_CE_I2
886 dimensionedScalar(
"source_CE_I2", dimensionSet(0,0,-1,0,0,0,0), 0.0)
888 Info<<
"Creating source term source_CE_PBA" << endl;
889 volScalarField source_CE_PBA
898 dimensionedScalar(
"source_CE_PBA", dimensionSet(0,0,-1,0,0,0,0), 0.0)
900 Info<<
"Creating source term source_CE_Breac" << endl;
901 volScalarField source_CE_Breac
910 dimensionedScalar(
"source_CE_Breac", dimensionSet(0,0,-1,0,0,0,0), 0.0)
912 Info<<
"Creating source term source_CE_Areac0" << endl;
913 volScalarField source_CE_Areac0
922 dimensionedScalar(
"source_CE_Areac0", dimensionSet(0,0,-1,0,0,0,0), 0.0)
924 Info<<
"Creating source term source_CE_Areac1" << endl;
925 volScalarField source_CE_Areac1
934 dimensionedScalar(
"source_CE_Areac1", dimensionSet(0,0,-1,0,0,0,0), 0.0)
936 Info<<
"Creating source term source_CE_Ireac0" << endl;
937 volScalarField source_CE_Ireac0
946 dimensionedScalar(
"source_CE_Ireac0", dimensionSet(0,0,-1,0,0,0,0), 0.0)
948 Info<<
"Creating source term source_CE_Ireac1" << endl;
949 volScalarField source_CE_Ireac1
958 dimensionedScalar(
"source_CE_Ireac1", dimensionSet(0,0,-1,0,0,0,0), 0.0)
960 Info<<
"Creating source term source_CE_Ireac2" << endl;
961 volScalarField source_CE_Ireac2
970 dimensionedScalar(
"source_CE_Ireac2", dimensionSet(0,0,-1,0,0,0,0), 0.0)
972 Info<<
"Creating source term source_Bulk" << endl;
973 volScalarField source_Bulk
982 dimensionedScalar(
"source_Bulk", dimensionSet(0,0,-1,0,0,0,0), 0.0)
984 Info<<
"Creating source term source_R_1" << endl;
985 volScalarField source_R_1
994 dimensionedScalar(
"source_R_1", dimensionSet(0,0,-1,0,0,0,0), 0.0)
996 Info<<
"Creating source term source_R_1_mass" << endl;
997 volScalarField source_R_1_mass
1006 dimensionedScalar(
"source_R_1_mass", dimensionSet(0,0,-1,0,0,0,0), 0.0)
1008 Info<<
"Creating source term source_R_1_temp_RF1" << endl;
1009 volScalarField source_R_1_temp_RF1
1013 "source_R_1_temp_RF1",
1018 dimensionedScalar(
"sourceR_1_temp_RF1", dimensionSet(0,0,-1,0,0,0,0), 0.0)
1020 Info<<
"Creating source term source_R_1_vol_RF1" << endl;
1021 volScalarField source_R_1_vol_RF1
1025 "source_R_1_vol_RF1",
1030 dimensionedScalar(
"sourceR_1_vol_RF1", dimensionSet(0,0,-1,0,0,0,0), 0.0)
1033 if (KineticsModel ==
"RF-1")
1035 forAll(mesh.C(), celli)
1037 if (alpha1[celli] == 0.0)
1041 CW_0 = scalar(1000.0)*CE_B2[foam_index];
1042 COH_0 = scalar(1000.0)*(CE_A0[foam_index] + CE_A1[foam_index]);
1046 reduce(CW_0,maxOp<scalar>());
1047 reduce(COH_0,maxOp<scalar>());
double surfaceTension
required for the computation of partial pressure
double M_CO2
Molecular mass of carbon dioxide, kg/kmol.
double M_NCO
Molecular weight of NCO, kg/kmol.
double RR
ideal gas constant, J/mol K
double DH_OH
Reaction heat for the gelling reaction, J/mol.
double rhoPoly
density of the liquid polymer, kg/m3
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 DH_W
Reaction heat for the blowing reaction, J/mol.