33 #include "twoPhaseMixtureThermo.H" 50 const volScalarField& alpha1;
64 volScalarField &M0_, volScalarField &M1_,
65 volScalarField &M2_, volScalarField &alpha1_,
83 volScalarField alphaCutOff
89 IOobject::READ_IF_PRESENT,
93 dimensionedScalar(
"alphaCutOff", dimless, 0.5)
95 volScalarField insideFoam(pos(alphaCutOff - alpha1));
102 IOobject::READ_IF_PRESENT,
106 dimensionedScalar(
"mean_", dimless, 0.0)
108 forAll(mesh.C(), celli)
110 M0 = Foam::max(M0, dimensionedScalar(
"M0min", M0.dimensions(), SMALL));
111 M1 = Foam::max(M1, dimensionedScalar(
"M1min", M1.dimensions(), SMALL));
112 M2 = Foam::max(M2, dimensionedScalar(
"M2min", M2.dimensions(), SMALL));
113 mean_[celli] = scalar(2.0)*Foam::log(M1[celli]/M0[celli]) -
114 scalar(0.5)*Foam::log(M2[celli]/M0[celli]);
116 return (insideFoam*mean_);
125 volScalarField alphaCutOff
131 IOobject::READ_IF_PRESENT,
135 dimensionedScalar(
"alphaCutOff", dimless, 0.5)
137 volScalarField insideFoam(pos(alphaCutOff - alpha1));
138 volScalarField variance_
144 IOobject::READ_IF_PRESENT,
148 dimensionedScalar(
"variance_", dimless, 0.0)
150 forAll(mesh.C(), celli)
152 M0 = Foam::max(M0, dimensionedScalar(
"M0min", M0.dimensions(), SMALL));
153 M1 = Foam::max(M1, dimensionedScalar(
"M1min", M1.dimensions(), SMALL));
154 M2 = Foam::max(M2, dimensionedScalar(
"M2min", M2.dimensions(), SMALL));
158 scalar(0.5)*Foam::log(M2[celli]/M0[celli])
159 - Foam::log(M1[celli]/M0[celli])
162 if (variance_[celli] < 0.0)
164 variance_[celli] = 0.0;
167 return (insideFoam*variance_);
186 int main(
int argc,
char *argv[])
188 timeSelector::addOptions();
190 # include "setRootCase.H" 191 # include "createTime.H" 193 instantList timeDirs = timeSelector::select0(runTime, args);
195 # include "createMesh.H" 197 forAll(timeDirs, timeI)
199 runTime.setTime(timeDirs[timeI], timeI);
201 Info<<
"Time = " << runTime.timeName() << endl;
231 && M1header.headerOk()
232 && M2header.headerOk()
237 Info<<
" Reading M0" << endl;
238 volScalarField M0(M0header, mesh);
240 Info<<
" Reading M1" << endl;
241 volScalarField M1(M1header, mesh);
243 Info<<
" Reading M2" << endl;
244 volScalarField M2(M2header, mesh);
246 Info<<
" Calculating BSD properties ... " << endl;
248 twoPhaseMixtureThermo mixture(mesh);
249 volScalarField& alpha1(mixture.alpha1());
252 volScalarField BSDMean
268 volScalarField BSDVariance
285 Info<<
" Moments are not available." << endl;
290 Info<< nl <<
"ExecutionTime = " << runTime.elapsedCpuTime() <<
" s" 291 <<
" ClockTime = " << runTime.elapsedClockTime() <<
" s" 294 Info<<
"End\n" << endl;
this class is meant to compute the mean and variance of bubble/cell size distribution.
volScalarField meanBSD()
member function to calculate the mean of bubble size distribution
int main(int argc, char *argv[])
Reads parameters. Creates struts and walls. Saves foam morphology to a file.
BSDProperties(volScalarField &M0_, volScalarField &M1_, volScalarField &M2_, volScalarField &alpha1_, const fvMesh &mesh_)
volScalarField varianceBSD()
member function to compute the variance of bubble size distribution