File multiphaseEulerPbeFoam/quadratureMethods/PDFTransportModels/univariatePDFTransportModel/univariatePDFTransportModel.C changed (mode: 100644) (index 9ac0824..2f312ee) |
... |
... |
Foam::PDFTransportModels::univariatePDFTransportModel |
49 |
49 |
facMin_(readScalar(dict.subDict("odeCoeffs").lookup("facMin"))), |
facMin_(readScalar(dict.subDict("odeCoeffs").lookup("facMin"))), |
50 |
50 |
facMax_(readScalar(dict.subDict("odeCoeffs").lookup("facMax"))), |
facMax_(readScalar(dict.subDict("odeCoeffs").lookup("facMax"))), |
51 |
51 |
minLocalDt_(readScalar(dict.subDict("odeCoeffs").lookup("minLocalDt"))), |
minLocalDt_(readScalar(dict.subDict("odeCoeffs").lookup("minLocalDt"))), |
|
52 |
|
localDt_(mesh.nCells(), mesh.time().deltaTValue()/10.0), |
52 |
53 |
quadrature_(name, mesh, support), |
quadrature_(name, mesh, support), |
53 |
54 |
momentAdvection_ |
momentAdvection_ |
54 |
55 |
( |
( |
|
... |
... |
void Foam::PDFTransportModels::univariatePDFTransportModel |
94 |
95 |
scalar localT = 0.0; |
scalar localT = 0.0; |
95 |
96 |
|
|
96 |
97 |
// Initialize the local step |
// Initialize the local step |
97 |
|
scalar localDt = globalDt/100.0; |
|
|
98 |
|
scalar localDt = localDt_[celli]; |
98 |
99 |
|
|
99 |
100 |
// Initialize RK parameters |
// Initialize RK parameters |
100 |
101 |
scalarList k1(nMoments, 0.0); |
scalarList k1(nMoments, 0.0); |
|
... |
... |
void Foam::PDFTransportModels::univariatePDFTransportModel |
229 |
230 |
break; |
break; |
230 |
231 |
} |
} |
231 |
232 |
|
|
|
233 |
|
localDt_[celli] = localDt; |
232 |
234 |
localT += localDt; |
localT += localDt; |
233 |
235 |
} |
} |
234 |
236 |
else |
else |
File multiphaseEulerPbeFoam/quadratureMethods/PDFTransportModels/velocityPDFTransportModel/velocityPDFTransportModel.C changed (mode: 100644) (index c5debc3..778a2c9) |
... |
... |
Foam::PDFTransportModels::velocityPDFTransportModel::velocityPDFTransportModel |
47 |
47 |
facMin_(readScalar(dict.subDict("odeCoeffs").lookup("facMin"))), |
facMin_(readScalar(dict.subDict("odeCoeffs").lookup("facMin"))), |
48 |
48 |
facMax_(readScalar(dict.subDict("odeCoeffs").lookup("facMax"))), |
facMax_(readScalar(dict.subDict("odeCoeffs").lookup("facMax"))), |
49 |
49 |
minLocalDt_(readScalar(dict.subDict("odeCoeffs").lookup("minLocalDt"))), |
minLocalDt_(readScalar(dict.subDict("odeCoeffs").lookup("minLocalDt"))), |
|
50 |
|
localDt_(mesh.nCells(), mesh.time().deltaTValue()/10.0), |
50 |
51 |
quadrature_(name, mesh, support), |
quadrature_(name, mesh, support), |
51 |
52 |
momentAdvection_ |
momentAdvection_ |
52 |
53 |
( |
( |
|
... |
... |
void Foam::PDFTransportModels::velocityPDFTransportModel::explicitMomentSource() |
89 |
90 |
scalar localT = 0.0; |
scalar localT = 0.0; |
90 |
91 |
|
|
91 |
92 |
// Initialize the local step |
// Initialize the local step |
92 |
|
scalar localDt = globalDt/100.0; |
|
|
93 |
|
scalar localDt = localDt_[celli]; |
93 |
94 |
|
|
94 |
95 |
// Initialize RK parameters |
// Initialize RK parameters |
95 |
96 |
scalarList k1(nMoments, 0.0); |
scalarList k1(nMoments, 0.0); |
|
... |
... |
void Foam::PDFTransportModels::velocityPDFTransportModel::explicitMomentSource() |
224 |
225 |
break; |
break; |
225 |
226 |
} |
} |
226 |
227 |
|
|
|
228 |
|
localDt_[celli] = localDt; |
227 |
229 |
localT += localDt; |
localT += localDt; |
228 |
230 |
} |
} |
229 |
231 |
else |
else |
File multiphaseEulerPbeFoam/quadratureMethods/momentInversion/multivariate/hyperbolic/hyperbolicConditionalMomentInversion.C changed (mode: 100644) (index 2ed61ca..f022d72) |
... |
... |
Foam::hyperbolicConditionalMomentInversion::hyperbolicConditionalMomentInversion |
116 |
116 |
}; |
}; |
117 |
117 |
|
|
118 |
118 |
|
|
|
119 |
|
Foam::label Foam::hyperbolicConditionalMomentInversion::getNMoments |
|
120 |
|
( |
|
121 |
|
const label nDims |
|
122 |
|
) const |
|
123 |
|
{ |
|
124 |
|
if (nDims == 1) |
|
125 |
|
{ |
|
126 |
|
return 5; |
|
127 |
|
} |
|
128 |
|
else if (nDims == 2) |
|
129 |
|
{ |
|
130 |
|
return 10; |
|
131 |
|
} |
|
132 |
|
else if (nDims == 3) |
|
133 |
|
{ |
|
134 |
|
return 16; |
|
135 |
|
} |
|
136 |
|
return 0; |
|
137 |
|
} |
|
138 |
|
|
|
139 |
|
|
|
140 |
|
Foam::labelListList Foam::hyperbolicConditionalMomentInversion::getMomentOrders |
|
141 |
|
( |
|
142 |
|
const label nDims |
|
143 |
|
) const |
|
144 |
|
{ |
|
145 |
|
if (nDims == 1) |
|
146 |
|
{ |
|
147 |
|
return {{0}, {1}, {2}, {3}, {4}}; |
|
148 |
|
} |
|
149 |
|
else if (nDims == 2) |
|
150 |
|
{ |
|
151 |
|
return twoDimMomentOrders; |
|
152 |
|
} |
|
153 |
|
else if (nDims == 3) |
|
154 |
|
{ |
|
155 |
|
return threeDimMomentOrders; |
|
156 |
|
} |
|
157 |
|
return {{}}; |
|
158 |
|
} |
|
159 |
|
|
|
160 |
|
|
|
161 |
|
Foam::label Foam::hyperbolicConditionalMomentInversion::getNNodes |
|
162 |
|
( |
|
163 |
|
const label nDims |
|
164 |
|
) const |
|
165 |
|
{ |
|
166 |
|
if (nDims == 1) |
|
167 |
|
{ |
|
168 |
|
return 3; |
|
169 |
|
} |
|
170 |
|
else if (nDims == 2) |
|
171 |
|
{ |
|
172 |
|
return 9; |
|
173 |
|
} |
|
174 |
|
else if (nDims == 3) |
|
175 |
|
{ |
|
176 |
|
return 27; |
|
177 |
|
} |
|
178 |
|
return 0; |
|
179 |
|
} |
|
180 |
|
|
|
181 |
|
|
|
182 |
|
Foam::labelListList Foam::hyperbolicConditionalMomentInversion::getNodeIndexes |
|
183 |
|
( |
|
184 |
|
const label nDims |
|
185 |
|
) const |
|
186 |
|
{ |
|
187 |
|
if (nDims == 1) |
|
188 |
|
{ |
|
189 |
|
return {{1}, {2}, {3}}; |
|
190 |
|
} |
|
191 |
|
else if (nDims == 2) |
|
192 |
|
{ |
|
193 |
|
return twoDimNodeIndexes; |
|
194 |
|
} |
|
195 |
|
else if (nDims == 3) |
|
196 |
|
{ |
|
197 |
|
return threeDimNodeIndexes; |
|
198 |
|
} |
|
199 |
|
return {{}}; |
|
200 |
|
} |
|
201 |
|
|
|
202 |
|
|
119 |
203 |
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // |
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // |
120 |
204 |
|
|
121 |
205 |
Foam::hyperbolicConditionalMomentInversion::hyperbolicConditionalMomentInversion |
Foam::hyperbolicConditionalMomentInversion::hyperbolicConditionalMomentInversion |
|
... |
... |
Foam::hyperbolicConditionalMomentInversion::hyperbolicConditionalMomentInversion |
125 |
209 |
) |
) |
126 |
210 |
: |
: |
127 |
211 |
nDimensions_(nDimensions), |
nDimensions_(nDimensions), |
128 |
|
nMoments_(nDimensions == 2 ? 10 : 16), |
|
129 |
|
nNodes_(nDimensions == 2 ? 9 : 27), |
|
|
212 |
|
nMoments_(getNMoments(nDimensions)), |
|
213 |
|
nNodes_(getNNodes(nDimensions)), |
130 |
214 |
support_("R"), |
support_("R"), |
131 |
|
moments_ |
|
132 |
|
( |
|
133 |
|
nMoments_, |
|
134 |
|
nDimensions == 2 ? twoDimMomentOrders : threeDimMomentOrders |
|
135 |
|
), |
|
136 |
|
abscissae_ |
|
137 |
|
( |
|
138 |
|
nNodes_, |
|
139 |
|
nDimensions == 2 ? twoDimNodeIndexes : threeDimNodeIndexes |
|
140 |
|
), |
|
141 |
|
weights_ |
|
142 |
|
( |
|
143 |
|
nNodes_, |
|
144 |
|
nDimensions == 2 ? twoDimNodeIndexes : threeDimNodeIndexes |
|
145 |
|
), |
|
|
215 |
|
moments_(nMoments_, getMomentOrders(nDimensions)), |
|
216 |
|
abscissae_(nNodes_, getNodeIndexes(nDimensions)), |
|
217 |
|
weights_(nNodes_, getNodeIndexes(nDimensions)), |
146 |
218 |
univariateInverter_ |
univariateInverter_ |
147 |
219 |
( |
( |
148 |
220 |
new hyperbolicMomentInversion(dict.subDict("basicQuadrature")) |
new hyperbolicMomentInversion(dict.subDict("basicQuadrature")) |
File multiphaseEulerPbeFoam/quadratureMethods/momentInversion/multivariate/hyperbolic/hyperbolicConditionalMomentInversion.H changed (mode: 100644) (index de39289..1de2655) |
... |
... |
class hyperbolicConditionalMomentInversion |
140 |
140 |
//- Reset inverter |
//- Reset inverter |
141 |
141 |
void reset(); |
void reset(); |
142 |
142 |
|
|
|
143 |
|
//- Return the number of moments given a number of dimensions |
|
144 |
|
label getNMoments(const label nDims) const; |
|
145 |
|
|
|
146 |
|
//- Return the moment orders give a number of dimensions |
|
147 |
|
labelListList getMomentOrders(const label nDims) const; |
|
148 |
|
|
|
149 |
|
//- Return the number of nodes given a number of dimensions |
|
150 |
|
label getNNodes(const label nDims) const; |
|
151 |
|
|
|
152 |
|
//- Return the node indexes give a number of dimensions |
|
153 |
|
labelListList getNodeIndexes(const label nDims) const; |
|
154 |
|
|
143 |
155 |
//- Disallow default bitwise copy construct |
//- Disallow default bitwise copy construct |
144 |
156 |
//hyperbolicConditionalMomentInversion(const hyperbolicConditionalMomentInversion&); |
//hyperbolicConditionalMomentInversion(const hyperbolicConditionalMomentInversion&); |
145 |
157 |
|
|
File multiphaseEulerPbeFoam/quadratureMethods/momentSets/univariateMomentSet/univariateMomentSet.C changed (mode: 100644) (index c043387..bc1e975) |
2 |
2 |
========= | |
========= | |
3 |
3 |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
4 |
4 |
\\ / O peration | |
\\ / O peration | |
5 |
|
\\ / A nd | Copyright (C) 2014-2018 Alberto Passalacqua |
|
|
5 |
|
\\ / A nd | Copyright (C) 2014-2019 Alberto Passalacqua |
6 |
6 |
\\/ M anipulation | |
\\/ M anipulation | |
7 |
7 |
------------------------------------------------------------------------------- |
------------------------------------------------------------------------------- |
8 |
8 |
License |
License |
|
... |
... |
void Foam::univariateMomentSet::checkRealizability |
419 |
419 |
|
|
420 |
420 |
if (support_ == "R") |
if (support_ == "R") |
421 |
421 |
{ |
{ |
422 |
|
if (beta_[zetai] < 0.0) |
|
|
422 |
|
if (beta_[zetai] <= 0.0) |
423 |
423 |
{ |
{ |
424 |
424 |
realizabilityChecked_ = true; |
realizabilityChecked_ = true; |
425 |
425 |
nRealizableMoments_ = 2*zetai; |
nRealizableMoments_ = 2*zetai; |
|
... |
... |
void Foam::univariateMomentSet::checkRealizability |
516 |
516 |
alpha_[nD] = zRecurrence[nD][nD + 1]/zRecurrence[nD][nD] |
alpha_[nD] = zRecurrence[nD][nD + 1]/zRecurrence[nD][nD] |
517 |
517 |
- zRecurrence[nD - 1][nD]/zRecurrence[nD - 1][nD - 1]; |
- zRecurrence[nD - 1][nD]/zRecurrence[nD - 1][nD - 1]; |
518 |
518 |
|
|
519 |
|
if (beta_[nD] < 0.0) |
|
|
519 |
|
if (beta_[nD] <= 0.0) |
520 |
520 |
{ |
{ |
521 |
521 |
realizabilityChecked_ = true; |
realizabilityChecked_ = true; |
522 |
522 |
nRealizableMoments_ = 2*nD; |
nRealizableMoments_ = 2*nD; |
File multiphaseEulerPbeFoam/quadratureMethods/populationBalanceModels/populationBalanceSubModels/collisionKernels/esBGKCollision/esBGKCollision.C changed (mode: 100644) (index 599e21b..7000a50) |
... |
... |
void Foam::populationBalanceSubModels::collisionKernels::esBGKCollision |
63 |
63 |
// Variances of velocities |
// Variances of velocities |
64 |
64 |
scalar sigma = max(moments(2)[celli]/m0 - uSqr, 0.0); |
scalar sigma = max(moments(2)[celli]/m0 - uSqr, 0.0); |
65 |
65 |
scalar sigma1 = (a1_ + b1_)*sigma; |
scalar sigma1 = (a1_ + b1_)*sigma; |
66 |
|
Theta_[celli] = sigma1/3.0; |
|
|
66 |
|
Theta_[celli] = sigma1; |
67 |
67 |
|
|
68 |
68 |
Meq_(0) = moments(0)[celli]; |
Meq_(0) = moments(0)[celli]; |
69 |
69 |
Meq_(1) = moments(1)[celli]; |
Meq_(1) = moments(1)[celli]; |
|
... |
... |
void Foam::populationBalanceSubModels::collisionKernels::esBGKCollision |
87 |
87 |
// Variances of velocities |
// Variances of velocities |
88 |
88 |
scalar sigma1 = max(moments(2,0)[celli]/m00 - uSqr, 0.0); |
scalar sigma1 = max(moments(2,0)[celli]/m00 - uSqr, 0.0); |
89 |
89 |
scalar sigma2 = max(moments(0,2)[celli]/m00 - vSqr, 0.0); |
scalar sigma2 = max(moments(0,2)[celli]/m00 - vSqr, 0.0); |
90 |
|
Theta_[celli] = (sigma1 + sigma2)/3.0; |
|
|
90 |
|
Theta_[celli] = (sigma1 + sigma2)/2.0; |
91 |
91 |
|
|
92 |
92 |
scalar sigma11 = a1_*Theta_[celli] + b1_*sigma1; |
scalar sigma11 = a1_*Theta_[celli] + b1_*sigma1; |
93 |
93 |
scalar sigma22 = a1_*Theta_[celli] + b1_*sigma2; |
scalar sigma22 = a1_*Theta_[celli] + b1_*sigma2; |
|
... |
... |
void Foam::populationBalanceSubModels::collisionKernels::esBGKCollision |
165 |
165 |
dimensionedScalar zeroVar("zero", sqr(dimVelocity), 0.0); |
dimensionedScalar zeroVar("zero", sqr(dimVelocity), 0.0); |
166 |
166 |
volScalarField sigma(max(moments(2)/m0 - uSqr, zeroVar)); |
volScalarField sigma(max(moments(2)/m0 - uSqr, zeroVar)); |
167 |
167 |
volScalarField sigma1((a1_ + b1_)*sigma); |
volScalarField sigma1((a1_ + b1_)*sigma); |
168 |
|
Theta_ = sigma1/3.0; |
|
|
168 |
|
Theta_ = sigma1; |
169 |
169 |
|
|
170 |
170 |
Meqf_(0) = moments(0); |
Meqf_(0) = moments(0); |
171 |
171 |
Meqf_(1) = moments(1); |
Meqf_(1) = moments(1); |
|
... |
... |
Foam::populationBalanceSubModels::collisionKernels::esBGKCollision |
280 |
280 |
mesh, |
mesh, |
281 |
281 |
dimensionedScalar("0", sqr(dimVelocity), 0.0) |
dimensionedScalar("0", sqr(dimVelocity), 0.0) |
282 |
282 |
), |
), |
283 |
|
dp_(readScalar(dict.lookup("d"))), |
|
|
283 |
|
dp_("d", dimLength, dict), |
284 |
284 |
zeta_(dict_.lookupOrDefault("zeta", 1.0)), |
zeta_(dict_.lookupOrDefault("zeta", 1.0)), |
285 |
285 |
Meqf_(quadrature.moments().size(), momentOrders_), |
Meqf_(quadrature.moments().size(), momentOrders_), |
286 |
286 |
Meq_(quadrature.moments().size(), momentOrders_) |
Meq_(quadrature.moments().size(), momentOrders_) |
|
... |
... |
Foam::populationBalanceSubModels::collisionKernels::esBGKCollision |
373 |
373 |
scalar c = quadrature_.moments()[0][celli]/0.63; |
scalar c = quadrature_.moments()[0][celli]/0.63; |
374 |
374 |
scalar gs0 = (2.0 - c)/(2.0*pow3(1.0 - c)) + 1.1603*c; |
scalar gs0 = (2.0 - c)/(2.0*pow3(1.0 - c)) + 1.1603*c; |
375 |
375 |
scalar tauC = |
scalar tauC = |
376 |
|
zeta_*sqrt(Foam::constant::mathematical::pi)*dp_ |
|
|
376 |
|
zeta_*sqrt(Foam::constant::mathematical::pi)*dp_.value() |
377 |
377 |
/max |
/max |
378 |
378 |
( |
( |
379 |
379 |
12.0*gs0*quadrature_.moments()[0][celli]*sqrt(Theta_[celli]), |
12.0*gs0*quadrature_.moments()[0][celli]*sqrt(Theta_[celli]), |