30 #include "volFields.H"
31 #include "surfaceFields.H"
34 #include "addToRunTimeSelectionTable.H"
35 #include "coupledFvsPatchFields.H"
38 #include "emptyFvPatch.H"
39 #include "wedgeFvPatch.H"
40 #include "zeroGradientFvPatchFields.H"
60 const word& qgdCoeffsType,
62 const dictionary& dict
65 Info<<
"Selecting QGD coeffs evaluation approach type " << qgdCoeffsType << endl;
67 dictionaryConstructorTable::iterator cstrIter =
68 dictionaryConstructorTablePtr_->find(qgdCoeffsType);
70 if (cstrIter == dictionaryConstructorTablePtr_->end())
74 "QGDCoeffs::New(const word&, const fvMesh&)"
75 ) <<
"Unknown QGD coeffs evaluation approach type " << qgdCoeffsType << nl << nl
76 <<
"Valid model types are:" << nl
77 << dictionaryConstructorTablePtr_->sortedToc()
81 if (dict.found(qgdCoeffsType +
"Dict"))
83 return autoPtr<QGDCoeffs>
90 mesh.time().timeName(),
96 dict.subDict(qgdCoeffsType +
"Dict")
101 return autoPtr<QGDCoeffs>
108 mesh.time().timeName(),
124 mesh.time().timeName(),
126 IOobject::READ_IF_PRESENT,
130 if (aQGDHeader.typeHeaderOk<volScalarField>())
132 aQGDHeader.writeOpt() = IOobject::AUTO_WRITE;
145 tmp<volScalarField> newAlphaQGD
151 dimensionSet(0, 0, 0, 0, 0),
152 zeroGradientFvPatchScalarField::typeName
156 newAlphaQGD.ref().primitiveFieldRef() = 0.5;
157 newAlphaQGD.ref().correctBoundaryConditions();
165 regIOobject(io, false),
168 runTime_(mesh_.time()),
174 mesh.time().timeName(),
180 dimensionSet(1, -1, -1, 0, 0)
187 mesh.time().timeName(),
193 dimensionSet(1, -1, -1, 0, 0)
198 1.0 / mag(mesh.surfaceInterpolation::deltaCoeffs())
205 mesh.time().timeName(),
215 readOrCreateAlphaQGD(mesh)
223 mesh.time().timeName(),
229 dimensionSet(0, 0, 1, 0, 0)
234 linearInterpolate(tauQGD_)
241 mesh.time().timeName(),
247 dimensionSet(0, 0, 0, 0, 0)
254 mesh.time().timeName(),
256 IOobject::READ_IF_PRESENT,
260 dimensionSet(0, 0, 0, 0, 0)
274 tauQGD_.primitiveFieldRef()[celli] = 0.0;
275 muQGD_.primitiveFieldRef()[celli] = 0.0;
276 alphauQGD_.primitiveFieldRef()[celli] = 0.0;
277 ScQGD_.primitiveFieldRef()[celli] = 1.0;
278 PrQGD_.primitiveFieldRef()[celli] = 1.0;
280 forAll(tauQGD_.boundaryField(), patchi)
282 forAll(tauQGD_.boundaryField()[patchi], facei)
284 tauQGD_.boundaryFieldRef()[patchi][facei] =
286 muQGD_.boundaryFieldRef()[patchi][facei] =
288 alphauQGD_.boundaryFieldRef()[patchi][facei] =
290 PrQGD_.boundaryFieldRef()[patchi][facei] =
292 ScQGD_.boundaryFieldRef()[patchi][facei] =
303 forAll(hQGDf_.primitiveField(), iFace)
305 hown = mag(mesh.C()[mesh.owner()[iFace]] - mesh.Cf()[iFace]);
306 hnei = mag(mesh.C()[mesh.neighbour()[iFace]] - mesh.Cf()[iFace]);
307 hQGDf_.primitiveFieldRef()[iFace] = 2.0*min(hown, hnei);
310 forAll(mesh.boundary(), patchi)
312 const fvPatch& fvp = mesh.boundary()[patchi];
315 hQGDf_.boundaryFieldRef()[patchi] *= 2.0;
325 const cell& c = mesh.cells()[celli];
334 if (mesh.isInternalFace(fid))
336 hint += hQGDf_[fid] * mesh.magSf()[fid];
337 surf += mesh.magSf()[fid];
341 pid = mesh.boundaryMesh().whichPatch(fid);
346 !isA<emptyFvPatch>(mesh.boundary()[pid])
348 !isA<wedgeFvPatch>(mesh.boundary()[pid])
351 pfid = mesh.boundaryMesh()[pid].whichFace(fid);
353 hint += hQGDf_.boundaryField()[pid][pfid] *
354 mesh.magSf().boundaryField()[pid][pfid];
355 surf += mesh.magSf().boundaryField()[pid][pfid];
361 hQGD_.primitiveFieldRef()[celli] = hint / surf;
364 forAll(mesh.boundary(), patchi)
368 !isA<emptyFvPatch>(mesh.boundary()[patchi])
373 hQGD_.boundaryFieldRef()[patchi] = hQGDf_.boundaryField()[patchi] * 1.0;
virtual void updateQGDLength(const fvMesh &)
defineRunTimeSelectionTable(QGDCoeffs, dictionary)
QGDCoeffs(const IOobject &io, const fvMesh &mesh, const dictionary &dict)
Construct from components.
const volScalarField & muQGD() const
const surfaceScalarField & hQGDf() const
static autoPtr< QGDCoeffs > New(const word &qgdCoeffsType, const fvMesh &mesh, const dictionary &dict)
Return a reference to the selected fvscStencil model.
const volScalarField & tauQGD() const
const surfaceScalarField & tauQGDf() const
const volScalarField & alphauQGD() const
tmp< volScalarField > readOrCreateAlphaQGD(const fvMesh &)
Abstract base class for classes implementing thermophysical properties of gases and fluids governed b...
virtual void correct(const QGDThermo &)
const volScalarField & hQGD() const
defineTypeNameAndDebug(constScPrModel1, 0)