6 #include <rapidjson/document.h> 7 #include <rapidjson/filereadstream.h> 8 #include "rapidjson/writer.h" 9 #include "rapidjson/stringbuffer.h" 12 FILE * pFile = fopen (
"../inputs/unifiedInput.json" ,
"r");
14 rapidjson::FileReadStream is(pFile, buffer,
sizeof(buffer));
15 rapidjson::Document document;
16 document.ParseStream<0, rapidjson::UTF8<>, rapidjson::FileReadStream>(is);
18 Pr=document[
"physicalProperties"][
"pressure"].GetDouble();
19 Temp0=document[
"initialConditions"][
"temperature"].GetDouble();
20 if (document[
"kinetics"][
"kineticModel"].GetString()==std::string(
"Baser")) {
22 }
else if (document[
"kinetics"][
"kineticModel"].GetString()==std::string(
"BaserRx")) {
24 }
else if (document[
"kinetics"][
"kineticModel"].GetString()==std::string(
"RF-1")) {
27 std::cout <<
"kinetic model unknown in QmomKinetics" << std::endl;
30 X_gel=document[
"kinetics"][
"gelPoint"].GetDouble();
32 A_OH=document[
"kinetics"][
"gellingReaction"][
"frequentialFactor"].GetDouble();
33 E_OH=document[
"kinetics"][
"gellingReaction"][
"activationEnergy"].GetDouble();
34 A_W=document[
"kinetics"][
"blowingReaction"][
"frequentialFactor"].GetDouble();
35 E_W=document[
"kinetics"][
"blowingReaction"][
"activationEnergy"].GetDouble();
36 OH_0=document[
"initialConditions"][
"concentrations"][
"polyol"].GetDouble();
37 NCO_0=document[
"initialConditions"][
"concentrations"][
"isocyanate"].GetDouble();
38 if (document[
"kinetics"][
"useDilution"].GetBool()){
44 catalyst=document[
"initialConditions"][
"concentrations"][
"catalyst"].GetDouble();
45 polyol1_ini=document[
"initialConditions"][
"concentrations"][
"polyol1"].GetDouble();
46 polyol2_ini=document[
"initialConditions"][
"concentrations"][
"polyol2"].GetDouble();
47 amine_ini=document[
"initialConditions"][
"concentrations"][
"amine"].GetDouble();
48 isocyanate1_ini=document[
"initialConditions"][
"concentrations"][
"isocyanate1"].GetDouble();
49 isocyanate2_ini=document[
"initialConditions"][
"concentrations"][
"isocyanate2"].GetDouble();
50 isocyanate3_ini=document[
"initialConditions"][
"concentrations"][
"isocyanate3"].GetDouble();
53 W_0=document[
"initialConditions"][
"concentrations"][
"water"].GetDouble();
54 rhoBL=document[
"physicalProperties"][
"blowingAgents"][
"PBL"][
"density"].GetDouble();
55 DH_OH=document[
"kinetics"][
"gellingReaction"][
"reactionEnthalpy"].GetDouble();
56 DH_W=document[
"kinetics"][
"blowingReaction"][
"reactionEnthalpy"].GetDouble();
57 C_Poly=document[
"physicalProperties"][
"polymer"][
"heatCapacity"].GetDouble();
58 C_CO2=document[
"physicalProperties"][
"blowingAgents"][
"CO2"][
"heatCapacityInLiquidPhase"].GetDouble();
59 C_BG=document[
"physicalProperties"][
"blowingAgents"][
"PBL"][
"heatCapacityInGaseousPhase"].GetDouble();
60 C_BL=document[
"physicalProperties"][
"blowingAgents"][
"PBL"][
"heatCapacityInLiquidPhase"].GetDouble();
61 lambda=document[
"physicalProperties"][
"blowingAgents"][
"PBL"][
"evaporationHeat"].GetDouble();
62 if (document[
"physicalBlowingAgent"].GetString()==std::string(
"n-pentane")) {
64 }
else if (document[
"physicalBlowingAgent"].GetString()==std::string(
"R11")) {
67 std::cout <<
"unknown blowing agent (solubility)" << std::endl;
70 if (document[
"physicalProperties"][
"polymer"][
"polymerDensityModel"].GetString()==std::string(
"nanotools")) {
72 }
else if (document[
"physicalProperties"][
"polymer"][
"polymerDensityModel"].GetString()==std::string(
"constant")) {
74 rhoPoly=document[
"physicalProperties"][
"polymer"][
"density"].GetDouble();
75 }
else if (document[
"physicalProperties"][
"polymer"][
"polymerDensityModel"].GetString()==std::string(
"pcsaft")) {
78 M_CO2=document[
"physicalProperties"][
"blowingAgents"][
"CO2"][
"molarMass"].GetDouble()*1e3;
79 M_B=document[
"physicalProperties"][
"blowingAgents"][
"PBL"][
"molarMass"].GetDouble()*1e3;
80 M_NCO=document[
"physicalProperties"][
"polymer"][
"molarMassNCO"].GetDouble()*1e3;
81 M_air=document[
"physicalProperties"][
"air"][
"molarMass"].GetDouble()*1e3;
82 double cb=document[
"initialConditions"][
"concentrations"][
"blowingAgents"][
"PBL"].GetDouble();
84 double cc=document[
"initialConditions"][
"concentrations"][
"blowingAgents"][
"CO2"].GetDouble();
86 surfaceTension=document[
"physicalProperties"][
"surfaceTension"].GetDouble();
87 sig=document[
"initialConditions"][
"bubbleRadiusDeviation"].GetDouble();
88 init_size=document[
"initialConditions"][
"bubbleRadius"].GetDouble()*2;
89 NN=document[
"initialConditions"][
"numberBubbleDensity"].GetDouble();
90 abs_err=document[
"QmomKinetics"][
"absoluteTolerance"].GetDouble();
91 rel_err=document[
"QmomKinetics"][
"relativeTolerance"].GetDouble();
92 dt=document[
"QmomKinetics"][
"timeStep"].GetDouble();
93 tend=document[
"QmomKinetics"][
"endTime"].GetDouble();
94 bubbleMode=document[
"QmomKinetics"][
"bubbleMode"].GetString();
98 apparentViscosity=document[
"physicalProperties"][
"ModenaFoamViscosityModel"].GetBool();
double E_W
activation energy for the blowing reaction, J/mol
double C_BL
Specific heat of the physical blowing agent in liquid phase, J/kg K.
real(dp) polyol1_ini
initial concentration of polyol 1
double CO2_0
Initial weight fraction of CO2 in the liquid, -.
double NN
correlated to number of initial bubbles in m^3
double lambda
Latent heat of blowing agent, J/kg.
double rel_err
relative error
double abs_err
absolute error
double OH_0
Initial concentration of polyol OH groups in the mixutre, mol/m3.
real(dp) amine_ini
initial concentration of amine
double sig
correlated to variance of initial distribution
real(dp) isocyanate2_ini
initial concentration of isocyanate 2
int denMod
density mode, 1 = modena, 2 = constant
double C_BG
Specific heat of the physical blowing agent in gas phase, J/kg K.
real(dp) isocyanate3_ini
initial concentration of isocyanate 3
double surfaceTension
required for the computation of partial pressure
double M_CO2
Molecular mass of carbon dioxide, kg/kmol.
double W_0
Initial concentration of water in the mixture, mol/m3.
double M_NCO
Molecular weight of NCO, kg/kmol.
double init_size
initial mean bubble diameter, m
double DH_OH
Reaction heat for the gelling reaction, J/mol.
double Pr
initial/final pressure of the mixture, Pa
double rhoPoly
density of the liquid polymer, kg/m3
bool dilution
use dilution effect
double rhoBL
density of the blowing agent, kg/m3
double C_CO2
CO2 specific heat, J/kg K.
real(dp) polyol2_ini
initial concentration of polyol 2
double NCO_0
Initial concentration of isocianate NCO groups in the mixutre, mol/m3.
double M_B
Molecular mass of blowing agent, kg/kmol.
double Temp0
initial temperature, K
double M_air
Molecular weight of air, kg/kmol.
double L0
Initial weight fraction of blowing agent in the liquid, -.
int kinMod
kinetics model, 1 = Baser, 2 = Baser with R(x)
real(dp) isocyanate1_ini
initial concentration of isocyanate 1
double A_OH
pre-exponential factor for the gelling reaction, 1/s
int phBL
type of physical blowing agent 1 = pentane, 2 = R-11
double DH_W
Reaction heat for the blowing reaction, J/mol.
double A_W
pre-exponential factor for the blowing reaction, 1/s
real(dp) catalyst
concentration of catalyst
double E_OH
activation energy for the gelling reaction, J/mol