MoDeNa  1.0
Software framework facilitating sequential multi-scale modelling
modenaCalls.h
Go to the documentation of this file.
1 
11 #ifndef MODENACALLS_H
12 #define MODENACALLS_H
13 
14 
15 bblgr1 = modena_model_new("bubbleGrowth1");
16 if (modena_error_occurred())
17 {
18  return modena_error();
19 }
20 
21 bblgr2 = modena_model_new("bubbleGrowth2");
22 if (modena_error_occurred())
23 {
24  return modena_error();
25 }
26 
27 kinetics = modena_model_new("RF-1-public");
28 if (modena_error_occurred())
29 {
30  return modena_error();
31 }
32 
33 if (denMod==1) {
34  density_reaction_mixturemodel = modena_model_new("density_reaction_mixture");
35  if (modena_error_occurred())
36  {
37  return modena_error();
38  }
39 } else if (denMod==3) {
40  density_reaction_mixturemodel = modena_model_new("PolymerDensity[A=AIR,B=PU]");
41  if (modena_error_occurred())
42  {
43  return modena_error();
44  }
45 }
46 rheologymodel = modena_model_new("Rheology_Arrhenius");
47 if (modena_error_occurred())
48 {
49  return modena_error();
50 }
51 
52 strutContentmodel = modena_model_new("strutContent");
53 if (modena_error_occurred())
54 {
55  return modena_error();
56 }
57 thermalConductivitymodel = modena_model_new("foamConductivity");
58 if (modena_error_occurred())
59 {
60  return modena_error();
61 }
62 
63 
64 inputs_bblgr1 = modena_inputs_new(bblgr1);
65 outputs_bblgr1 = modena_outputs_new(bblgr1);
66 
67 inputs_bblgr2 = modena_inputs_new(bblgr2);
68 outputs_bblgr2 = modena_outputs_new(bblgr2);
69 
70 inputs_kinetics = modena_inputs_new(kinetics);
71 outputs_kinetics = modena_outputs_new(kinetics);
72 
73 if (denMod==1 || denMod == 3) {
74  inputs_den = modena_inputs_new (density_reaction_mixturemodel);
75  outputs_den = modena_outputs_new (density_reaction_mixturemodel);
76 }
77 
78 inputs_rheo = modena_inputs_new (rheologymodel);
79 outputs_rheo = modena_outputs_new (rheologymodel);
80 
81 inputs_strutContent = modena_inputs_new (strutContentmodel);
82 outputs_strutContent = modena_outputs_new (strutContentmodel);
83 
84 inputs_thermalConductivity = modena_inputs_new (thermalConductivitymodel);
85 outputs_thermalConductivity = modena_outputs_new (thermalConductivitymodel);
86 
87 // inputs argPos
88 kineticTime_Pos = modena_model_inputs_argPos(kinetics, "'kineticTime'");
89 Catalyst_1_Pos = modena_model_inputs_argPos(kinetics, "'Catalyst_1'");
90 CE_A0_Pos = modena_model_inputs_argPos(kinetics, "'CE_A0'");
91 CE_A1_Pos = modena_model_inputs_argPos(kinetics, "'CE_A1'");
92 CE_B_Pos = modena_model_inputs_argPos(kinetics, "'CE_B'");
93 CE_B2_Pos = modena_model_inputs_argPos(kinetics, "'CE_B2'");
94 CE_I0_Pos = modena_model_inputs_argPos(kinetics, "'CE_I0'");
95 CE_I1_Pos = modena_model_inputs_argPos(kinetics, "'CE_I1'");
96 CE_I2_Pos = modena_model_inputs_argPos(kinetics, "'CE_I2'");
97 CE_PBA_Pos = modena_model_inputs_argPos(kinetics, "'CE_PBA'");
98 CE_Breac_Pos = modena_model_inputs_argPos(kinetics, "'CE_Breac'");
99 CE_Areac0_Pos = modena_model_inputs_argPos(kinetics, "'CE_Areac0'");
100 CE_Areac1_Pos = modena_model_inputs_argPos(kinetics, "'CE_Areac1'");
101 CE_Ireac0_Pos = modena_model_inputs_argPos(kinetics, "'CE_Ireac0'");
102 CE_Ireac1_Pos = modena_model_inputs_argPos(kinetics, "'CE_Ireac1'");
103 CE_Ireac2_Pos = modena_model_inputs_argPos(kinetics, "'CE_Ireac2'");
104 Bulk_Pos = modena_model_inputs_argPos(kinetics, "'Bulk'");
105 R_1_Pos = modena_model_inputs_argPos(kinetics, "'R_1'");
106 R_1_mass_Pos = modena_model_inputs_argPos(kinetics, "'R_1_mass'");
107 R_1_temp_Pos = modena_model_inputs_argPos(kinetics, "'R_1_temp'");
108 R_1_vol_Pos = modena_model_inputs_argPos(kinetics, "'R_1_vol'");
109 
110 // First 20 outputs (source terms)
111 source_Catalyst_1_Pos = modena_model_outputs_argPos(kinetics, "source_Catalyst_1");
112 source_CE_A0_Pos = modena_model_outputs_argPos(kinetics, "source_CE_A0");
113 source_CE_A1_Pos = modena_model_outputs_argPos(kinetics, "source_CE_A1");
114 source_CE_B_Pos = modena_model_outputs_argPos(kinetics, "source_CE_B");
115 source_CE_B2_Pos = modena_model_outputs_argPos(kinetics, "source_CE_B2");
116 source_CE_I0_Pos = modena_model_outputs_argPos(kinetics, "source_CE_I0");
117 source_CE_I1_Pos = modena_model_outputs_argPos(kinetics, "source_CE_I1");
118 source_CE_I2_Pos = modena_model_outputs_argPos(kinetics, "source_CE_I2");
119 source_CE_PBA_Pos = modena_model_outputs_argPos(kinetics, "source_CE_PBA");
120 source_CE_Breac_Pos = modena_model_outputs_argPos(kinetics, "source_CE_Breac");
121 source_CE_Areac0_Pos = modena_model_outputs_argPos(kinetics, "source_CE_Areac0");
122 source_CE_Areac1_Pos = modena_model_outputs_argPos(kinetics, "source_CE_Areac1");
123 source_CE_Ireac0_Pos = modena_model_outputs_argPos(kinetics, "source_CE_Ireac0");
124 source_CE_Ireac1_Pos = modena_model_outputs_argPos(kinetics, "source_CE_Ireac1");
125 source_CE_Ireac2_Pos = modena_model_outputs_argPos(kinetics, "source_CE_Ireac2");
126 source_Bulk_Pos = modena_model_outputs_argPos(kinetics, "source_Bulk");
127 source_R_1_Pos = modena_model_outputs_argPos(kinetics, "source_R_1");
128 source_R_1_mass_Pos = modena_model_outputs_argPos(kinetics, "source_R_1_mass");
129 source_R_1_temp_Pos = modena_model_outputs_argPos(kinetics, "source_R_1_temp");
130 source_R_1_vol_Pos = modena_model_outputs_argPos(kinetics, "source_R_1_vol");
131 
132 modena_model_argPos_check(kinetics);
133 
134 // strut contents argPos
135 rho_foam_Pos = modena_model_inputs_argPos(strutContentmodel, "rho");
136 strut_content_Pos = modena_model_outputs_argPos(strutContentmodel, "fs");
137 modena_model_argPos_check(strutContentmodel);
138 
139 // thermal conductivity argPos
149 
150 // apparent viscosity
151 if (apparentViscosity) {
152  temp_rheopos = modena_model_inputs_argPos(rheologymodel, "T");
153  shear_rheopos = modena_model_inputs_argPos(rheologymodel, "shear");
154  conv_rheopos = modena_model_inputs_argPos(rheologymodel, "X");
155  m0_rheopos = modena_model_inputs_argPos(rheologymodel, "m0");
156  m1_rheopos = modena_model_inputs_argPos(rheologymodel, "m1");
157  // modena_model_argPos_check(rheologymodel);
158 }
159 
160 // bubble growth
161 Tbblgr1pos = modena_model_inputs_argPos(bblgr1, "T");
162 Rbblgr1pos = modena_model_inputs_argPos(bblgr1, "R");
163 c_1bblgr1pos = modena_model_inputs_argPos(bblgr1, "c");
164 p_1bblgr1pos = modena_model_inputs_argPos(bblgr1, "p");
166 Tbblgr2pos = modena_model_inputs_argPos(bblgr2, "T");
167 Rbblgr2pos = modena_model_inputs_argPos(bblgr2, "R");
168 c_2bblgr2pos = modena_model_inputs_argPos(bblgr2, "c");
169 p_2bblgr2pos = modena_model_inputs_argPos(bblgr2, "p");
171 
172 #endif
size_t source_CE_Ireac2_Pos
memory allocation for outputs of kinetics surrogate model
Definition: modenaData.H:160
size_t source_CE_PBA_Pos
memory allocation for outputs of kinetics surrogate model
Definition: modenaData.H:142
size_t source_CE_A1_Pos
memory allocation for outputs of kinetics surrogate model
Definition: modenaData.H:124
size_t strut_content_Pos
memory allocation for the strut content as the input of thermal conductivity surrogate model ...
Definition: modenaData.H:206
size_t m0_rheopos
memory allocation for the moment of order zero as the input of rheology surrogate model ...
Definition: modenaData.H:220
size_t CE_I2_Pos
memory allocation for inputs of kinetics surrogate model
Definition: modenaData.H:79
size_t source_CE_Breac_Pos
memory allocation for outputs of kinetics surrogate model
Definition: modenaData.H:145
size_t source_Bulk_Pos
memory allocation for outputs of kinetics surrogate model
Definition: modenaData.H:163
size_t modena_model_inputs_argPos(const modena_model_t *self, const char *name)
Function determining position of an argument in the input vector.
Definition: model.c:366
size_t X_CO2_Pos
memory allocation for the partial pressure of CO2 as the input of thermal conductivity surrogate mode...
Definition: modenaData.H:194
size_t source_CE_Areac0_Pos
memory allocation for outputs of kinetics surrogate model
Definition: modenaData.H:148
size_t temp_Pos
memory allocation for the temperature as the input of thermal conductivity surrogate model ...
Definition: modenaData.H:191
size_t porosity_Pos
memory allocation for the gas volume fraction as the input of thermal conductivity surrogate model ...
Definition: modenaData.H:182
size_t CE_Ireac0_Pos
memory allocation for inputs of kinetics surrogate model
Definition: modenaData.H:94
size_t CE_PBA_Pos
memory allocation for inputs of kinetics surrogate model
Definition: modenaData.H:82
size_t CE_Breac_Pos
memory allocation for inputs of kinetics surrogate model
Definition: modenaData.H:85
size_t X_N2_Pos
memory allocation for the partial pressure of N2 as the input of thermal conductivity surrogate model...
Definition: modenaData.H:203
size_t R_1_mass_Pos
memory allocation for inputs of kinetics surrogate model
Definition: modenaData.H:112
size_t cell_size_Pos
memory allocation for the bubble size as the input of thermal conductivity surrogate model ...
Definition: modenaData.H:185
size_t source_CE_I1_Pos
memory allocation for outputs of kinetics surrogate model
Definition: modenaData.H:136
modena_model_t * thermalConductivitymodel
pointer to the surrogate model for thermal conductivity
Definition: modenaData.H:22
size_t Catalyst_1_Pos
memory allocation for inputs of kinetics surrogate model
Definition: modenaData.H:58
size_t source_CE_B_Pos
memory allocation for outputs of kinetics surrogate model
Definition: modenaData.H:127
modena_model_t * modena_model_new(const char *modelId)
Function fetching a surrogate model from MongoDB.
Definition: model.c:281
int denMod
density mode, 1 = modena, 2 = constant
size_t CE_Areac1_Pos
memory allocation for inputs of kinetics surrogate model
Definition: modenaData.H:91
size_t X_Cyp_Pos
memory allocation for the partial pressure of cyclo-pentane as the input of thermal conductivity surr...
Definition: modenaData.H:197
size_t CE_I1_Pos
memory allocation for inputs of kinetics surrogate model
Definition: modenaData.H:76
size_t temp_rheopos
memory allocation for the temperature as the input of rheology surrogate model
Definition: modenaData.H:211
size_t source_CE_Ireac1_Pos
memory allocation for outputs of kinetics surrogate model
Definition: modenaData.H:157
size_t CE_Ireac2_Pos
memory allocation for inputs of kinetics surrogate model
Definition: modenaData.H:100
size_t source_CE_A0_Pos
memory allocation for outputs of kinetics surrogate model
Definition: modenaData.H:121
size_t CE_Areac0_Pos
memory allocation for inputs of kinetics surrogate model
Definition: modenaData.H:88
size_t source_CE_I2_Pos
memory allocation for outputs of kinetics surrogate model
Definition: modenaData.H:139
size_t m1_rheopos
memory allocation for the moment of order one as the input of rheology surrogate model ...
Definition: modenaData.H:223
size_t source_CE_I0_Pos
memory allocation for outputs of kinetics surrogate model
Definition: modenaData.H:133
size_t CE_I0_Pos
memory allocation for inputs of kinetics surrogate model
Definition: modenaData.H:73
size_t source_R_1_mass_Pos
memory allocation for outputs of kinetics surrogate model
Definition: modenaData.H:169
size_t source_CE_Ireac0_Pos
memory allocation for outputs of kinetics surrogate model
Definition: modenaData.H:154
size_t rho_foam_Pos
memory allocation for the foam density as the input of thermal conductivity surrogate model ...
Definition: modenaData.H:179
size_t conv_rheopos
memory allocation for the conversion as the input of rheology surrogate model
Definition: modenaData.H:217
size_t source_Catalyst_1_Pos
memory allocation for outputs of kinetics surrogate model
Definition: modenaData.H:118
size_t R_1_Pos
memory allocation for inputs of kinetics surrogate model
Definition: modenaData.H:106
size_t modena_model_outputs_argPos(const modena_model_t *self, const char *name)
Function determining position of a result in the output vector.
Definition: model.c:392
size_t Bulk_Pos
memory allocation for inputs of kinetics surrogate model
Definition: modenaData.H:103
size_t source_CE_Areac1_Pos
memory allocation for outputs of kinetics surrogate model
Definition: modenaData.H:151
size_t kineticTime_Pos
memory allocation for inputs of kinetics surrogate model
Definition: modenaData.H:55
size_t CE_A1_Pos
memory allocation for inputs of kinetics surrogate model
Definition: modenaData.H:64
size_t CE_B_Pos
memory allocation for inputs of kinetics surrogate model
Definition: modenaData.H:67
size_t strut_c_Pos
memory allocation for the strut content as the input of thermal conductivity surrogate model ...
Definition: modenaData.H:188
size_t shear_rheopos
memory allocation for the shear rate as the input of rheology surrogate model
Definition: modenaData.H:214
size_t source_CE_B2_Pos
memory allocation for outputs of kinetics surrogate model
Definition: modenaData.H:130
size_t CE_B2_Pos
memory allocation for inputs of kinetics surrogate model
Definition: modenaData.H:70
size_t X_O2_Pos
memory allocation for the partial pressure of O2 as the input of thermal conductivity surrogate model...
Definition: modenaData.H:200
void modena_model_argPos_check(const modena_model_t *self)
Function checking that the user has queried all input positions.
Definition: model.c:408
size_t CE_Ireac1_Pos
memory allocation for inputs of kinetics surrogate model
Definition: modenaData.H:97
size_t CE_A0_Pos
memory allocation for inputs of kinetics surrogate model
Definition: modenaData.H:61
size_t source_R_1_Pos
memory allocation for outputs of kinetics surrogate model
Definition: modenaData.H:166