MoDeNa  1.0
Software framework facilitating sequential multi-scale modelling
KineticsFunctions.H
Go to the documentation of this file.
1 
108 double LliqMax (double &);
109 double ddT_LliqMax (double &);
110 double arrhenius (double &, double &, double &);
111 double BAdilution(double &, double &, double &);
112 double QKinW
113  (
114  double &, double &, double &, double &, double &, double &, double &
115  );
116 double henryCoefficient(double &T);
117 double bubbleRadius (const double m0, const double m1);
118 double partialPressureCO2
119  (
120  double &M_CO2, double &M_B, double &surfaceTension, double &wCO2_g,
121  double &wBA_g, double &p, double &R
122  );
123 double partialPressureBA
124  (
125  double &M_B, double &M_CO2, double &surfaceTension,
126  double &wBA_g_val, double &wCO2_g_val,
127  double &prsr, double &bubble_radius
128  );
129 double wCO2Max (double &M_CO2, double &M_liq, double &pCO2, double &henryCoeff);
130 double xBL (double &T, double &dxdT);
131 double wBL_D(double &xBL, double &M_B, double &M_NCO, double &L0);
132 double LmaxR11(double &tmptr);
133 double creamTemperature(double &xBL0, double &dxdT);
134 double dTdtFirstOrder(double &Tc, double &To, double &timeStep);
135 double dTdtSecondOrder(double &Tc, double &To, double &Too, double &timeStep);
136 double thermalDiffusivityGas(double &T);
137 double nodeRadius(const double &v);
138 
139 double LliqMax (double& tmptr)
140 {
141  // constants:
142  const double a = 0.0064, h = 0.0551, T0 = 298.0, ww = 17.8;
143  double lMax;
144  if (tmptr > T0)
145  {
146  double tempDummy = Foam::pow((tmptr-T0),2.0);
147  lMax = (a + h*Foam::exp((-tempDummy/(2.0*ww*ww))));
148  }
149  else
150  {
151  lMax = (a+h);
152  }
153  return (lMax);
154 }
155 
156 double ddT_LliqMax (double& tmptr)
157 {
158  // constants:
159  const double h = 0.0551, T0 = 298.0, ww = 17.8;
160  double tempDummy = Foam::pow((tmptr-T0),2.0);
161  return ((-h*(tmptr-T0)*Foam::exp((-tempDummy/(2.0*ww*ww))))/(ww*ww));
162 }
163 
164 double arrhenius (double& AOH, double& EOH, double& tempt)
165 {
166  const double R = 8.3145; // J/mol K
167  return (AOH*Foam::exp(-EOH/(R*tempt)));
168 }
169 
170 double BAdilution(double& L_l, double& rhoPoly, double& rhoBL)
171 {
172  return (1/(1+L_l*(rhoPoly/rhoBL)));
173 }
174 
175 double QKinW
176 (
177  double& AW, double& EW, double& tempi, double& Lliq,
178  double& rhoPoly, double& rhoBL
179 )
180 {
181  double R = 8.3145;
182  return (AW*(Foam::exp(-EW/(R*tempi)))*(1/(1+Lliq*(rhoPoly/rhoBL))));
183 }
184 
185 double henryCoefficient(double &T)
186 {
187  if (T < 600)
188  {
189  // constants
190  double a = 1.771e7;
191  double b = -1.134e5;
192  double c = 320.2;
193  double d = -0.2563;
194 
195  return (a + b*T + c*T*T + d*T*T*T);
196  }
197  else
198  {
199  return (8.5e6);
200  }
201 }
202 
203 double bubbleRadius (const double m0, const double m1)
204 {
205  if (m0 != 0.0 && m1 != 0.0)
206  {
207  double R;
208  R = Foam::pow((3.0*m1/(4.0*M_PI*m0)), 1.0/3.0);
209  return R;
210  }
211  else
212  {
213  return (30e-6);
214  }
215 
216 }
217 double partialPressureCO2
218 (
219  double &M_CO2, double &M_B, double &surfaceTension, double &wCO2_g,
220  double &wBA_g, double &p, double &R
221 )
222 {
223  double pCO2;
224  if (wCO2_g == 0.0)
225  {
226  pCO2 = SMALL;
227  }
228  else
229  {
230  pCO2 =
231  (
232  (wCO2_g/M_CO2)/(wBA_g/M_B + wCO2_g/M_CO2)
233  );
234  }
235 
236  return (1e5*pCO2);
237 }
238 double partialPressureBA
239 (
240  double &M_B, double &M_CO2, double &surfaceTension, double &wBA_g,
241  double &wCO2_g, double &p, double &R
242 )
243 {
244  double pBA;
245  if (wBA_g == 0.0)
246  {
247  pBA = SMALL;
248  }
249  else
250  {
251  pBA =
252 
253  (
254  (wBA_g/M_B)/(wBA_g/M_B + wCO2_g/M_CO2)
255  );
256  }
257  return (1e5*pBA);
258 }
259 
260 double wCO2Max (double &M_CO2, double &M_liq, double &pCO2, double &henryCoeff)
261 {
262  if ((henryCoeff - pCO2 ) > 0.0)
263  {
264  return ((M_CO2/M_liq)*(pCO2/(henryCoeff - pCO2)));
265  }
266  else
267  {
268  Info<< "\nWarning! Invalid wCO2Max value!" << endl;
269  Info<< "'wCO2Max' is replaced by a constant." << endl;
270  return (4.4e-4);
271  }
272 
273 }
274 
275 double xBL (double &T, double &dxdT)
276 {
277  double xBL_value;
278  xBL_value = dxdT*(T - 300.0) + 0.5;
279 
280  if (xBL_value < 0.0)
281  {
282  return (0.0);
283  }
284  else if (xBL_value > 0.5)
285  {
286  return (0.5);
287  }
288  else
289  {
290  return (xBL_value);
291  }
292 }
293 
294 double wBL_D(double &xBL, double &M_B, double &M_NCO, double &L0)
295 {
296  double Lm;
297  Lm = (xBL/(1.0 - xBL))*(M_B/M_NCO);
298 
299  if (Lm < 1.0e-4)
300  {
301  Lm = 1.0e-4;
302  }
303  return (Lm);
304 }
305 
306 double LmaxR11(double &tmptr)
307 {
308  // constants:
309  const double a = 1e-7, h = 4.293, T0 = 203.4, ww = 40.02;
310  double lMax;
311  if (tmptr > T0)
312  {
313  double tempDummy = Foam::pow((tmptr-T0),2.0);
314  lMax = (a + h*Foam::exp((-tempDummy/(2.0*ww*ww))));
315  }
316  else
317  {
318  lMax = (a+h);
319  }
320  return (lMax);
321 }
322 
323 double creamTemperature(double &xBL0, double &dxdT)
324 {
325  return ((xBL0-0.5)/dxdT + 300.0);
326 }
327 
328 double dTdtFirstOrder(double &Tc, double &To, double &timeStep)
329 {
330  return (mag(Tc - To)/(max(timeStep,ROOTVSMALL)));
331 }
332 double dTdtSecondOrder(double &Tc, double &To, double &Too, double &timeStep)
333 {
334  return (mag((3.0*Tc - 4*To + Too))/(max((2.0*timeStep),ROOTVSMALL)));
335 }
336 
337 double thermalDiffusivityGas(double &T)
338 {
339  return (2.56008e-3*std::pow(T,0.5)/(1+207.009/T))/1010/1.2;
340 }
341 double nodeRadius(const double &v)
342 {
343  return (Foam::pow(3.0*v/(4.0*M_PI), 1/3.0));
344 }
double partialPressureBA(double &M_B, double &M_CO2, double &surfaceTension, double &wBA_g_val, double &wCO2_g_val, double &prsr, double &bubble_radius)
partial pressure of blowing agent
double dTdtSecondOrder(double &Tc, double &To, double &Too, double &timeStep)
second order accurate dTdt
double henryCoefficient(double &T)
Henry coefficient for CO2.
double partialPressureCO2(double &M_CO2, double &M_B, double &surfaceTension, double &wCO2_g, double &wBA_g, double &p, double &R)
partial pressure of CO2
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 ddT_LliqMax(double &)
derivative of LliqMax with respect to temperature
double creamTemperature(double &xBL0, double &dxdT)
criticall temperature that foaming process starts
double bubbleRadius(const double m0, const double m1)
radius of bubbles based on the moments
Definition: bubbleRadius.h:28
double LliqMax(double &)
maximum allowable amount of liquid blowing agent (n-pentane) in liquid
real(dp), dimension(:), allocatable d
diffusion coefficients (for each dissolved gas)
Definition: globals.f90:106
double wBL_D(double &xBL, double &M_B, double &M_NCO, double &L0)
weight fraction of maximum allowable blowing agent (R-11) in liquid
double rhoPoly
density of the liquid polymer, kg/m3
double thermalDiffusivityGas(double &T)
thermal diffusivity of gas as a function of temperature
double arrhenius(double &, double &, double &)
Arrhenius function.
double nodeRadius(const double &v)
radius of bubbles at each node
Definition: bubbleRadius.h:38
double BAdilution(double &, double &, double &)
dilution term for the blowing agent (n-pentane)
double rhoBL
density of the blowing agent, kg/m3
double M_B
Molecular mass of blowing agent, kg/kmol.
double xBL(double &T, double &dxdT)
mole fraction of blowing agent (R-11) in liquid polymer
double QKinW(double &AW, double &EW, double &tempi, double &Lliq, double &rhoPoly, double &rhoBL)
arrhenius term times by dilution term
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
double dTdtFirstOrder(double &Tc, double &To, double &timeStep)
first order accurate dTdt