31 #include "addToRunTimeSelectionTable.H"
32 #include "fvcSmooth.H"
34 #include "primitiveMeshTools.H"
57 const dictionary& dict
60 QGDCoeffs(io, mesh, dict),
66 qgdAspectRatioThreshold_(1.5),
68 cqSc_(mesh.V().size(), 0.0),
69 constScCellSetPtr_(nullptr)
71 scalar ScQGD = 0.0, PrQGD = 1.0;
73 dict.lookup(
"ScQGD") >> ScQGD;
74 dict.lookup(
"PrQGD") >> PrQGD;
76 ScQGD_.primitiveFieldRef() = ScQGD;
77 PrQGD_.primitiveFieldRef() = PrQGD;
79 ScQGD_.boundaryFieldRef() = ScQGD;
80 PrQGD_.boundaryFieldRef() = PrQGD;
82 if (dict.found(
"smoothCoeff"))
89 dict.lookup(
"rC") >>
rC_;
92 if (dict.found(
"minSc"))
94 dict.lookup(
"minSc") >>
minSc_;
97 if (dict.found(
"maxSc"))
99 dict.lookup(
"maxSc") >>
maxSc_;
102 if (dict.found(
"badQualitySc"))
107 if (dict.found(
"maxAspectRatio"))
112 scalarField openness(mesh.V().size(), 0);
113 scalarField aspectRatio(mesh.V().size(), 1);
115 primitiveMeshTools::cellClosedness
125 forAll(aspectRatio, iCell)
134 if (dict.found(
"constScCellSet"))
136 word constScCellSet (dict.lookup(
"constScCellSet"));
200 const volScalarField& cSound = qgdThermo.
c();
201 const volScalarField&
p = qgdThermo.
p();
202 const volScalarField
rho(qgdThermo.
rho()*1.0);
204 this->tauQGDf_= linearInterpolate(this->aQGD_)
205 / linearInterpolate(cSound) * hQGDf_;
207 this->tauQGD_ = this->aQGD_ * this->hQGD_ / cSound;
212 (1.0 - rC_) * ScQGD_;
215 max(this->ScQGD_, minSc_);
217 min(this->ScQGD_, maxSc_);
219 this->ScQGD_.primitiveFieldRef() =
220 max(this->ScQGD_.primitiveField(), cqSc_);
222 if (constScCellSetPtr_.valid())
224 const cellSet& constScCells = constScCellSetPtr_();
226 forAllConstIter(cellSet, constScCells, iter)
228 ScQGD_[iter.key()] = constSc_;
232 fvc::smooth(this->ScQGD_, smoothCoeff_);
234 Info<<
"max/min ScQGD: "
235 << max(this->ScQGD_).value() <<
"/"
236 << min(this->ScQGD_).value() << endl;
238 if (runTime_.outputTime())
240 this->ScQGD_.write();
244 forAll(p.primitiveField(), celli)
246 muQGD_.primitiveFieldRef()[celli] =
247 p.primitiveField()[celli] *
248 ScQGD_.primitiveField()[celli] *
249 tauQGD_.primitiveField()[celli];
251 alphauQGD_.primitiveFieldRef()[celli] = muQGD_.primitiveField()[celli] /
252 PrQGD_.primitiveField()[celli];
255 forAll(p.boundaryField(), patchi)
257 forAll(p.boundaryField()[patchi], facei)
259 muQGD_.boundaryFieldRef()[patchi][facei] =
260 p.boundaryField()[patchi][facei] *
261 ScQGD_.boundaryField()[patchi][facei] *
262 tauQGD_.boundaryField()[patchi][facei];
264 alphauQGD_.boundaryFieldRef()[patchi][facei] =
265 muQGD_.boundaryFieldRef()[patchi][facei] /
266 PrQGD_.boundaryField()[patchi][facei];
virtual const volScalarField & c() const =0
virtual tmp< volScalarField > rho() const =0
varScModel5(const IOobject &io, const fvMesh &mesh, const dictionary &dict)
autoPtr< cellSet > constScCellSetPtr_
scalar qgdAspectRatioThreshold_
Abstract base class for classes implementing thermophysical properties of gases and fluids governed b...
volScalarField rho(IOobject("rho", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), thermo.rho())
virtual const volScalarField & p() const =0
tmp< surfaceVectorField > grad(const volScalarField &vF)
addToRunTimeSelectionTable(QGDCoeffs, constScPrModel1, dictionary)
defineTypeNameAndDebug(constScPrModel1, 0)
void correct(const QGDThermo &)