mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev
This commit is contained in:
@ -39,15 +39,8 @@
|
|||||||
|
|
||||||
#include "compressibleCreatePhi.H"
|
#include "compressibleCreatePhi.H"
|
||||||
|
|
||||||
dimensionedScalar rhoMax
|
dimensionedScalar rhoMax(pimple.dict().lookup("rhoMax"));
|
||||||
(
|
dimensionedScalar rhoMin(pimple.dict().lookup("rhoMin"));
|
||||||
mesh.solutionDict().subDict("PIMPLE").lookup("rhoMax")
|
|
||||||
);
|
|
||||||
|
|
||||||
dimensionedScalar rhoMin
|
|
||||||
(
|
|
||||||
mesh.solutionDict().subDict("PIMPLE").lookup("rhoMin")
|
|
||||||
);
|
|
||||||
|
|
||||||
Info<< "Creating turbulence model\n" << endl;
|
Info<< "Creating turbulence model\n" << endl;
|
||||||
autoPtr<compressible::turbulenceModel> turbulence
|
autoPtr<compressible::turbulenceModel> turbulence
|
||||||
|
|||||||
@ -46,10 +46,13 @@ int main(int argc, char *argv[])
|
|||||||
#include "setRootCase.H"
|
#include "setRootCase.H"
|
||||||
#include "createTime.H"
|
#include "createTime.H"
|
||||||
#include "createMesh.H"
|
#include "createMesh.H"
|
||||||
|
|
||||||
|
pimpleControl pimple(mesh);
|
||||||
|
|
||||||
#include "createFields.H"
|
#include "createFields.H"
|
||||||
#include "initContinuityErrs.H"
|
#include "initContinuityErrs.H"
|
||||||
|
|
||||||
pimpleControl pimple(mesh);
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Info<< "\nStarting time loop\n" << endl;
|
Info<< "\nStarting time loop\n" << endl;
|
||||||
|
|
||||||
|
|||||||
@ -48,12 +48,13 @@ int main(int argc, char *argv[])
|
|||||||
#include "setRootCase.H"
|
#include "setRootCase.H"
|
||||||
#include "createTime.H"
|
#include "createTime.H"
|
||||||
#include "createMesh.H"
|
#include "createMesh.H"
|
||||||
|
|
||||||
|
pimpleControl pimple(mesh);
|
||||||
|
|
||||||
#include "createFields.H"
|
#include "createFields.H"
|
||||||
#include "createZones.H"
|
#include "createZones.H"
|
||||||
#include "initContinuityErrs.H"
|
#include "initContinuityErrs.H"
|
||||||
|
|
||||||
pimpleControl pimple(mesh);
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Info<< "\nStarting time loop\n" << endl;
|
Info<< "\nStarting time loop\n" << endl;
|
||||||
|
|||||||
@ -42,17 +42,10 @@
|
|||||||
|
|
||||||
label pRefCell = 0;
|
label pRefCell = 0;
|
||||||
scalar pRefValue = 0.0;
|
scalar pRefValue = 0.0;
|
||||||
setRefCell(p, mesh.solutionDict().subDict("SIMPLE"), pRefCell, pRefValue);
|
setRefCell(p, simple.dict(), pRefCell, pRefValue);
|
||||||
|
|
||||||
dimensionedScalar rhoMax
|
dimensionedScalar rhoMax(simple.dict().lookup("rhoMax"));
|
||||||
(
|
dimensionedScalar rhoMin(simple.dict().lookup("rhoMin"));
|
||||||
mesh.solutionDict().subDict("SIMPLE").lookup("rhoMax")
|
|
||||||
);
|
|
||||||
|
|
||||||
dimensionedScalar rhoMin
|
|
||||||
(
|
|
||||||
mesh.solutionDict().subDict("SIMPLE").lookup("rhoMin")
|
|
||||||
);
|
|
||||||
|
|
||||||
Info<< "Creating turbulence model\n" << endl;
|
Info<< "Creating turbulence model\n" << endl;
|
||||||
autoPtr<compressible::RASModel> turbulence
|
autoPtr<compressible::RASModel> turbulence
|
||||||
|
|||||||
@ -9,13 +9,7 @@
|
|||||||
if (pZones.size())
|
if (pZones.size())
|
||||||
{
|
{
|
||||||
// nUCorrectors for pressureImplicitPorosity
|
// nUCorrectors for pressureImplicitPorosity
|
||||||
if (mesh.solutionDict().subDict("SIMPLE").found("nUCorrectors"))
|
simple.dict().readIfPresent("nUCorrectors", nUCorr);
|
||||||
{
|
|
||||||
nUCorr = readInt
|
|
||||||
(
|
|
||||||
mesh.solutionDict().subDict("SIMPLE").lookup("nUCorrectors")
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (nUCorr > 0)
|
if (nUCorr > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -45,12 +45,13 @@ int main(int argc, char *argv[])
|
|||||||
#include "setRootCase.H"
|
#include "setRootCase.H"
|
||||||
#include "createTime.H"
|
#include "createTime.H"
|
||||||
#include "createMesh.H"
|
#include "createMesh.H"
|
||||||
|
|
||||||
|
simpleControl simple(mesh);
|
||||||
|
|
||||||
#include "createFields.H"
|
#include "createFields.H"
|
||||||
#include "createZones.H"
|
#include "createZones.H"
|
||||||
#include "initContinuityErrs.H"
|
#include "initContinuityErrs.H"
|
||||||
|
|
||||||
simpleControl simple(mesh);
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Info<< "\nStarting time loop\n" << endl;
|
Info<< "\nStarting time loop\n" << endl;
|
||||||
|
|||||||
@ -42,11 +42,12 @@ int main(int argc, char *argv[])
|
|||||||
#include "setRootCase.H"
|
#include "setRootCase.H"
|
||||||
#include "createTime.H"
|
#include "createTime.H"
|
||||||
#include "createMesh.H"
|
#include "createMesh.H"
|
||||||
#include "createFields.H"
|
|
||||||
#include "initContinuityErrs.H"
|
|
||||||
|
|
||||||
simpleControl simple(mesh);
|
simpleControl simple(mesh);
|
||||||
|
|
||||||
|
#include "createFields.H"
|
||||||
|
#include "initContinuityErrs.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Info<< "\nStarting time loop\n" << endl;
|
Info<< "\nStarting time loop\n" << endl;
|
||||||
|
|||||||
@ -41,17 +41,10 @@
|
|||||||
|
|
||||||
label pRefCell = 0;
|
label pRefCell = 0;
|
||||||
scalar pRefValue = 0.0;
|
scalar pRefValue = 0.0;
|
||||||
setRefCell(p, mesh.solutionDict().subDict("SIMPLE"), pRefCell, pRefValue);
|
setRefCell(p, simple.dict(), pRefCell, pRefValue);
|
||||||
|
|
||||||
dimensionedScalar rhoMax
|
dimensionedScalar rhoMax(simple.dict().lookup("rhoMax"));
|
||||||
(
|
dimensionedScalar rhoMin(simple.dict().lookup("rhoMin"));
|
||||||
mesh.solutionDict().subDict("SIMPLE").lookup("rhoMax")
|
|
||||||
);
|
|
||||||
|
|
||||||
dimensionedScalar rhoMin
|
|
||||||
(
|
|
||||||
mesh.solutionDict().subDict("SIMPLE").lookup("rhoMin")
|
|
||||||
);
|
|
||||||
|
|
||||||
Info<< "Creating turbulence model\n" << endl;
|
Info<< "Creating turbulence model\n" << endl;
|
||||||
autoPtr<compressible::RASModel> turbulence
|
autoPtr<compressible::RASModel> turbulence
|
||||||
|
|||||||
@ -44,11 +44,12 @@ int main(int argc, char *argv[])
|
|||||||
#include "setRootCase.H"
|
#include "setRootCase.H"
|
||||||
#include "createTime.H"
|
#include "createTime.H"
|
||||||
#include "createMesh.H"
|
#include "createMesh.H"
|
||||||
#include "createFields.H"
|
|
||||||
#include "initContinuityErrs.H"
|
|
||||||
|
|
||||||
simpleControl simple(mesh);
|
simpleControl simple(mesh);
|
||||||
|
|
||||||
|
#include "createFields.H"
|
||||||
|
#include "initContinuityErrs.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Info<< "\nStarting time loop\n" << endl;
|
Info<< "\nStarting time loop\n" << endl;
|
||||||
|
|||||||
@ -59,36 +59,37 @@ bool Foam::pimpleControl::criteriaSatisfied()
|
|||||||
bool firstIter = corr_ == 1;
|
bool firstIter = corr_ == 1;
|
||||||
|
|
||||||
bool achieved = true;
|
bool achieved = true;
|
||||||
const dictionary& solverDict = mesh_.solverPerformanceDict();
|
bool checked = false; // safety that some checks were indeed performed
|
||||||
|
|
||||||
|
const dictionary& solverDict = mesh_.solverPerformanceDict();
|
||||||
forAllConstIter(dictionary, solverDict, iter)
|
forAllConstIter(dictionary, solverDict, iter)
|
||||||
{
|
{
|
||||||
const word& variableName = iter().keyword();
|
const word& variableName = iter().keyword();
|
||||||
label fieldI = applyToField(variableName);
|
const label fieldI = applyToField(variableName);
|
||||||
if (fieldI != -1)
|
if (fieldI != -1)
|
||||||
{
|
{
|
||||||
const List<lduMatrix::solverPerformance> sp(iter().stream());
|
const List<lduMatrix::solverPerformance> sp(iter().stream());
|
||||||
const scalar residual = sp.last().initialResidual();
|
const scalar residual = sp.last().initialResidual();
|
||||||
|
|
||||||
|
checked = true;
|
||||||
|
|
||||||
if (firstIter)
|
if (firstIter)
|
||||||
{
|
{
|
||||||
residualControl_[fieldI].initialResidual =
|
residualControl_[fieldI].initialResidual =
|
||||||
sp.first().initialResidual();
|
sp.first().initialResidual();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool absCheck = residual < residualControl_[fieldI].absTol;
|
const bool absCheck = residual < residualControl_[fieldI].absTol;
|
||||||
|
|
||||||
bool relCheck = false;
|
bool relCheck = false;
|
||||||
|
|
||||||
scalar relative = 0.0;
|
scalar relative = 0.0;
|
||||||
if (!firstIter)
|
if (!firstIter)
|
||||||
{
|
{
|
||||||
scalar iniRes =
|
const scalar iniRes =
|
||||||
residualControl_[fieldI].initialResidual
|
residualControl_[fieldI].initialResidual
|
||||||
+ ROOTVSMALL;
|
+ ROOTVSMALL;
|
||||||
|
|
||||||
relative = residual/iniRes;
|
relative = residual/iniRes;
|
||||||
|
|
||||||
relCheck = relative < residualControl_[fieldI].relTol;
|
relCheck = relative < residualControl_[fieldI].relTol;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -110,7 +111,7 @@ bool Foam::pimpleControl::criteriaSatisfied()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return achieved;
|
return checked && achieved;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -129,7 +130,13 @@ Foam::pimpleControl::pimpleControl(fvMesh& mesh)
|
|||||||
if (nOuterCorr_ > 1)
|
if (nOuterCorr_ > 1)
|
||||||
{
|
{
|
||||||
Info<< nl;
|
Info<< nl;
|
||||||
if (!residualControl_.empty())
|
if (residualControl_.empty())
|
||||||
|
{
|
||||||
|
Info<< algorithmName_ << ": no residual control data found. "
|
||||||
|
<< "Calculations will employ " << nOuterCorr_
|
||||||
|
<< " corrector loops" << nl << endl;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
Info<< algorithmName_ << ": max iterations = " << nOuterCorr_
|
Info<< algorithmName_ << ": max iterations = " << nOuterCorr_
|
||||||
<< endl;
|
<< endl;
|
||||||
@ -142,12 +149,6 @@ Foam::pimpleControl::pimpleControl(fvMesh& mesh)
|
|||||||
}
|
}
|
||||||
Info<< endl;
|
Info<< endl;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
Info<< algorithmName_ << ": no residual control data found. " << nl
|
|
||||||
<< "Calculations will employ " << nOuterCorr_
|
|
||||||
<< " corrector loops" << nl << endl;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -69,10 +69,10 @@ protected:
|
|||||||
|
|
||||||
// Protected Member Functions
|
// Protected Member Functions
|
||||||
|
|
||||||
//- Read constrols from fvSolution dictionary
|
//- Read controls from fvSolution dictionary
|
||||||
virtual void read();
|
virtual void read();
|
||||||
|
|
||||||
//- Return true if all convergence checks are satified
|
//- Return true if all convergence checks are satisfied
|
||||||
virtual bool criteriaSatisfied();
|
virtual bool criteriaSatisfied();
|
||||||
|
|
||||||
//- Disallow default bitwise copy construct
|
//- Disallow default bitwise copy construct
|
||||||
|
|||||||
@ -50,17 +50,20 @@ bool Foam::simpleControl::criteriaSatisfied()
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool achieved = true;
|
bool achieved = true;
|
||||||
const dictionary& solverDict = mesh_.solverPerformanceDict();
|
bool checked = false; // safety that some checks were indeed performed
|
||||||
|
|
||||||
|
const dictionary& solverDict = mesh_.solverPerformanceDict();
|
||||||
forAllConstIter(dictionary, solverDict, iter)
|
forAllConstIter(dictionary, solverDict, iter)
|
||||||
{
|
{
|
||||||
const word& variableName = iter().keyword();
|
const word& variableName = iter().keyword();
|
||||||
label fieldI = applyToField(variableName);
|
const label fieldI = applyToField(variableName);
|
||||||
if (fieldI != -1)
|
if (fieldI != -1)
|
||||||
{
|
{
|
||||||
const List<lduMatrix::solverPerformance> sp(iter().stream());
|
const List<lduMatrix::solverPerformance> sp(iter().stream());
|
||||||
const scalar residual = sp.first().initialResidual();
|
const scalar residual = sp.first().initialResidual();
|
||||||
|
|
||||||
|
checked = true;
|
||||||
|
|
||||||
bool absCheck = residual < residualControl_[fieldI].absTol;
|
bool absCheck = residual < residualControl_[fieldI].absTol;
|
||||||
achieved = achieved && absCheck;
|
achieved = achieved && absCheck;
|
||||||
|
|
||||||
@ -75,7 +78,7 @@ bool Foam::simpleControl::criteriaSatisfied()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return achieved;
|
return checked && achieved;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -90,7 +93,13 @@ Foam::simpleControl::simpleControl(fvMesh& mesh)
|
|||||||
|
|
||||||
Info<< nl;
|
Info<< nl;
|
||||||
|
|
||||||
if (residualControl_.size() > 0)
|
if (residualControl_.empty())
|
||||||
|
{
|
||||||
|
Info<< algorithmName_ << ": no convergence criteria found. "
|
||||||
|
<< "Calculations will run for " << mesh_.time().endTime().value()
|
||||||
|
<< " steps." << nl << endl;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
Info<< algorithmName_ << ": convergence criteria" << nl;
|
Info<< algorithmName_ << ": convergence criteria" << nl;
|
||||||
forAll(residualControl_, i)
|
forAll(residualControl_, i)
|
||||||
@ -101,12 +110,6 @@ Foam::simpleControl::simpleControl(fvMesh& mesh)
|
|||||||
}
|
}
|
||||||
Info<< endl;
|
Info<< endl;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
Info<< algorithmName_ << ": no convergence criteria found. "
|
|
||||||
<< "Calculations will run for " << mesh_.time().endTime().value()
|
|
||||||
<< " steps." << nl << endl;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -59,10 +59,10 @@ protected:
|
|||||||
|
|
||||||
// Protected Member Functions
|
// Protected Member Functions
|
||||||
|
|
||||||
//- Read constrols from fvSolution dictionary
|
//- Read controls from fvSolution dictionary
|
||||||
void read();
|
void read();
|
||||||
|
|
||||||
//- Return true if all convergence checks are satified
|
//- Return true if all convergence checks are satisfied
|
||||||
bool criteriaSatisfied();
|
bool criteriaSatisfied();
|
||||||
|
|
||||||
//- Disallow default bitwise copy construct
|
//- Disallow default bitwise copy construct
|
||||||
|
|||||||
@ -40,7 +40,7 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class solutionControl Declaration
|
Class solutionControl Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
class solutionControl
|
class solutionControl
|
||||||
@ -78,19 +78,19 @@ protected:
|
|||||||
//- Flag to indicate to solve for momentum
|
//- Flag to indicate to solve for momentum
|
||||||
bool momentumPredictor_;
|
bool momentumPredictor_;
|
||||||
|
|
||||||
//- Flag to indictae to solve using transonic algorithm
|
//- Flag to indicate to solve using transonic algorithm
|
||||||
bool transonic_;
|
bool transonic_;
|
||||||
|
|
||||||
|
|
||||||
// Protected Member Functions
|
// Protected Member Functions
|
||||||
|
|
||||||
//- Read constrols from fvSolution dictionary
|
//- Read controls from fvSolution dictionary
|
||||||
virtual void read(const bool absTolOnly);
|
virtual void read(const bool absTolOnly);
|
||||||
|
|
||||||
//- Return index of field in residualControl_ if present
|
//- Return index of field in residualControl_ if present
|
||||||
virtual label applyToField(const word& fieldName) const;
|
virtual label applyToField(const word& fieldName) const;
|
||||||
|
|
||||||
//- Return true if all convergence checks are satified
|
//- Return true if all convergence checks are satisfied
|
||||||
virtual bool criteriaSatisfied() = 0;
|
virtual bool criteriaSatisfied() = 0;
|
||||||
|
|
||||||
//- Store previous iteration fields
|
//- Store previous iteration fields
|
||||||
@ -142,7 +142,7 @@ public:
|
|||||||
//- Flag to indicate to solve for momentum
|
//- Flag to indicate to solve for momentum
|
||||||
inline bool momentumPredictor() const;
|
inline bool momentumPredictor() const;
|
||||||
|
|
||||||
//- Flag to indictae to solve using transonic algorithm
|
//- Flag to indicate to solve using transonic algorithm
|
||||||
inline bool transonic() const;
|
inline bool transonic() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -227,7 +227,6 @@ void mappedFieldFvPatchField<Type>::updateCoeffs()
|
|||||||
|
|
||||||
const fieldType& nbrField = sampleField();
|
const fieldType& nbrField = sampleField();
|
||||||
|
|
||||||
const mapDistribute& distMap = mappedPatchBase::map();
|
|
||||||
newValues = nbrField.boundaryField()[nbrPatchID];
|
newValues = nbrField.boundaryField()[nbrPatchID];
|
||||||
this->distribute(newValues);
|
this->distribute(newValues);
|
||||||
|
|
||||||
|
|||||||
@ -114,8 +114,8 @@ bool Foam::SurfaceFilmModel<CloudType>::transferParcel
|
|||||||
"bool Foam::SurfaceFilmModel<CloudType>::transferParcel"
|
"bool Foam::SurfaceFilmModel<CloudType>::transferParcel"
|
||||||
"("
|
"("
|
||||||
"parcelType&, "
|
"parcelType&, "
|
||||||
"const label, "
|
"const polyPatch&, "
|
||||||
"const bool&"
|
"bool&"
|
||||||
")"
|
")"
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -156,11 +156,9 @@ void Foam::SurfaceFilmModel<CloudType>::inject(TrackData& td)
|
|||||||
const label filmPatchI = filmPatches[i];
|
const label filmPatchI = filmPatches[i];
|
||||||
const label primaryPatchI = primaryPatches[i];
|
const label primaryPatchI = primaryPatches[i];
|
||||||
|
|
||||||
const mappedPatchBase& mapPatch = filmModel.mappedPatches()[filmPatchI];
|
|
||||||
|
|
||||||
const labelList& injectorCellsPatch = pbm[primaryPatchI].faceCells();
|
const labelList& injectorCellsPatch = pbm[primaryPatchI].faceCells();
|
||||||
|
|
||||||
cacheFilmFields(filmPatchI, primaryPatchI, mapPatch, filmModel);
|
cacheFilmFields(filmPatchI, primaryPatchI, filmModel);
|
||||||
|
|
||||||
const vectorField& Cf = mesh.C().boundaryField()[primaryPatchI];
|
const vectorField& Cf = mesh.C().boundaryField()[primaryPatchI];
|
||||||
const vectorField& Sf = mesh.Sf().boundaryField()[primaryPatchI];
|
const vectorField& Sf = mesh.Sf().boundaryField()[primaryPatchI];
|
||||||
@ -172,13 +170,11 @@ void Foam::SurfaceFilmModel<CloudType>::inject(TrackData& td)
|
|||||||
{
|
{
|
||||||
const label cellI = injectorCellsPatch[j];
|
const label cellI = injectorCellsPatch[j];
|
||||||
|
|
||||||
// The position is at the cell centre, which could be
|
// The position could bein any tet of the decomposed cell,
|
||||||
// in any tet of the decomposed cell, so arbitrarily
|
// so arbitrarily choose the first face of the cell as the
|
||||||
// choose the first face of the cell as the tetFace
|
// tetFace and the first point on the face after the base
|
||||||
// and the first point on the face after the base
|
// point as the tetPt. The tracking will pick the cell
|
||||||
// point as the tetPt. The tracking will
|
// consistent with the motion in the first tracking step.
|
||||||
// pick the cell consistent with the motion in the
|
|
||||||
// first tracking step.
|
|
||||||
const label tetFaceI = this->owner().mesh().cells()[cellI][0];
|
const label tetFaceI = this->owner().mesh().cells()[cellI][0];
|
||||||
const label tetPtI = 1;
|
const label tetPtI = 1;
|
||||||
|
|
||||||
@ -208,14 +204,22 @@ void Foam::SurfaceFilmModel<CloudType>::inject(TrackData& td)
|
|||||||
|
|
||||||
setParcelProperties(*pPtr, j);
|
setParcelProperties(*pPtr, j);
|
||||||
|
|
||||||
// Check new parcel properties
|
if (pPtr->nParticle() > 0.001)
|
||||||
// td.cloud().checkParcelProperties(*pPtr, 0.0, true);
|
{
|
||||||
td.cloud().checkParcelProperties(*pPtr, 0.0, false);
|
// Check new parcel properties
|
||||||
|
// td.cloud().checkParcelProperties(*pPtr, 0.0, true);
|
||||||
|
td.cloud().checkParcelProperties(*pPtr, 0.0, false);
|
||||||
|
|
||||||
// Add the new parcel to the cloud
|
// Add the new parcel to the cloud
|
||||||
td.cloud().addParticle(pPtr);
|
td.cloud().addParticle(pPtr);
|
||||||
|
|
||||||
nParcelsInjected_++;
|
nParcelsInjected_++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// TODO: cache mass and re-distribute?
|
||||||
|
delete pPtr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -227,26 +231,25 @@ void Foam::SurfaceFilmModel<CloudType>::cacheFilmFields
|
|||||||
(
|
(
|
||||||
const label filmPatchI,
|
const label filmPatchI,
|
||||||
const label primaryPatchI,
|
const label primaryPatchI,
|
||||||
const mappedPatchBase& mapPatch,
|
|
||||||
const regionModels::surfaceFilmModels::surfaceFilmModel& filmModel
|
const regionModels::surfaceFilmModels::surfaceFilmModel& filmModel
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
massParcelPatch_ = filmModel.cloudMassTrans().boundaryField()[filmPatchI];
|
massParcelPatch_ = filmModel.cloudMassTrans().boundaryField()[filmPatchI];
|
||||||
mapPatch.distribute(massParcelPatch_);
|
filmModel.toPrimary(filmPatchI, massParcelPatch_);
|
||||||
|
|
||||||
diameterParcelPatch_ =
|
diameterParcelPatch_ =
|
||||||
filmModel.cloudDiameterTrans().boundaryField()[filmPatchI];
|
filmModel.cloudDiameterTrans().boundaryField()[filmPatchI];
|
||||||
mapPatch.distribute(diameterParcelPatch_);
|
filmModel.toPrimary(filmPatchI, diameterParcelPatch_);
|
||||||
|
|
||||||
UFilmPatch_ = filmModel.Us().boundaryField()[filmPatchI];
|
UFilmPatch_ = filmModel.Us().boundaryField()[filmPatchI];
|
||||||
mapPatch.distribute(UFilmPatch_);
|
filmModel.toPrimary(filmPatchI, UFilmPatch_);
|
||||||
|
|
||||||
rhoFilmPatch_ = filmModel.rho().boundaryField()[filmPatchI];
|
rhoFilmPatch_ = filmModel.rho().boundaryField()[filmPatchI];
|
||||||
mapPatch.distribute(rhoFilmPatch_);
|
filmModel.toPrimary(filmPatchI, rhoFilmPatch_);
|
||||||
|
|
||||||
deltaFilmPatch_[primaryPatchI] =
|
deltaFilmPatch_[primaryPatchI] =
|
||||||
filmModel.delta().boundaryField()[filmPatchI];
|
filmModel.delta().boundaryField()[filmPatchI];
|
||||||
mapPatch.distribute(deltaFilmPatch_[primaryPatchI]);
|
filmModel.toPrimary(filmPatchI, deltaFilmPatch_[primaryPatchI]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -116,7 +116,6 @@ protected:
|
|||||||
(
|
(
|
||||||
const label filmPatchI,
|
const label filmPatchI,
|
||||||
const label primaryPatchI,
|
const label primaryPatchI,
|
||||||
const mappedPatchBase& mapPatch,
|
|
||||||
const regionModels::surfaceFilmModels::surfaceFilmModel& filmModel
|
const regionModels::surfaceFilmModels::surfaceFilmModel& filmModel
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -643,7 +643,6 @@ void Foam::ThermoSurfaceFilm<CloudType>::cacheFilmFields
|
|||||||
(
|
(
|
||||||
const label filmPatchI,
|
const label filmPatchI,
|
||||||
const label primaryPatchI,
|
const label primaryPatchI,
|
||||||
const mappedPatchBase& mapPatch,
|
|
||||||
const regionModels::surfaceFilmModels::surfaceFilmModel& filmModel
|
const regionModels::surfaceFilmModels::surfaceFilmModel& filmModel
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -651,15 +650,14 @@ void Foam::ThermoSurfaceFilm<CloudType>::cacheFilmFields
|
|||||||
(
|
(
|
||||||
filmPatchI,
|
filmPatchI,
|
||||||
primaryPatchI,
|
primaryPatchI,
|
||||||
mapPatch,
|
|
||||||
filmModel
|
filmModel
|
||||||
);
|
);
|
||||||
|
|
||||||
TFilmPatch_ = filmModel.Ts().boundaryField()[filmPatchI];
|
TFilmPatch_ = filmModel.Ts().boundaryField()[filmPatchI];
|
||||||
mapPatch.distribute(TFilmPatch_);
|
filmModel.toPrimary(filmPatchI, TFilmPatch_);
|
||||||
|
|
||||||
CpFilmPatch_ = filmModel.Cp().boundaryField()[filmPatchI];
|
CpFilmPatch_ = filmModel.Cp().boundaryField()[filmPatchI];
|
||||||
mapPatch.distribute(CpFilmPatch_);
|
filmModel.toPrimary(filmPatchI, CpFilmPatch_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -227,7 +227,6 @@ protected:
|
|||||||
(
|
(
|
||||||
const label filmPatchI,
|
const label filmPatchI,
|
||||||
const label primaryPatchI,
|
const label primaryPatchI,
|
||||||
const mappedPatchBase& distMap,
|
|
||||||
const regionModels::surfaceFilmModels::surfaceFilmModel&
|
const regionModels::surfaceFilmModels::surfaceFilmModel&
|
||||||
filmModel
|
filmModel
|
||||||
);
|
);
|
||||||
|
|||||||
@ -119,6 +119,37 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::checkPatches
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class SourcePatch, class TargetPatch>
|
||||||
|
bool Foam::AMIInterpolation<SourcePatch, TargetPatch>::distributed
|
||||||
|
(
|
||||||
|
const primitivePatch& srcPatch,
|
||||||
|
const primitivePatch& tgtPatch
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (Pstream::parRun())
|
||||||
|
{
|
||||||
|
List<label> facesPresentOnProc(Pstream::nProcs(), 0);
|
||||||
|
if ((srcPatch.size() > 0) || (tgtPatch.size() > 0))
|
||||||
|
{
|
||||||
|
facesPresentOnProc[Pstream::myProcNo()] = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
facesPresentOnProc[Pstream::myProcNo()] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
Pstream::gatherList(facesPresentOnProc);
|
||||||
|
Pstream::scatterList(facesPresentOnProc);
|
||||||
|
if (sum(facesPresentOnProc) > 1)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class SourcePatch, class TargetPatch>
|
template<class SourcePatch, class TargetPatch>
|
||||||
Foam::label
|
Foam::label
|
||||||
Foam::AMIInterpolation<SourcePatch, TargetPatch>::calcOverlappingProcs
|
Foam::AMIInterpolation<SourcePatch, TargetPatch>::calcOverlappingProcs
|
||||||
@ -1160,7 +1191,7 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::update
|
|||||||
{
|
{
|
||||||
static label patchI = 0;
|
static label patchI = 0;
|
||||||
|
|
||||||
if (Pstream::parRun())
|
if (Pstream::parRun() && distributed(srcPatch, tgtPatch))
|
||||||
{
|
{
|
||||||
// convert local addressing to global addressing
|
// convert local addressing to global addressing
|
||||||
globalIndex globalSrcFaces(srcPatch.size());
|
globalIndex globalSrcFaces(srcPatch.size());
|
||||||
|
|||||||
@ -167,6 +167,13 @@ class AMIInterpolation
|
|||||||
|
|
||||||
// Parallel functionality
|
// Parallel functionality
|
||||||
|
|
||||||
|
//- Return true if faces are spread over multiple domains
|
||||||
|
bool distributed
|
||||||
|
(
|
||||||
|
const primitivePatch& srcPatch,
|
||||||
|
const primitivePatch& tgtPatch
|
||||||
|
);
|
||||||
|
|
||||||
label calcOverlappingProcs
|
label calcOverlappingProcs
|
||||||
(
|
(
|
||||||
const List<treeBoundBoxList>& procBb,
|
const List<treeBoundBoxList>& procBb,
|
||||||
|
|||||||
@ -339,6 +339,26 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//- Wrapper around map/interpolate data distribution
|
||||||
|
template<class Type>
|
||||||
|
void reverseDistribute(List<Type>& lst) const
|
||||||
|
{
|
||||||
|
switch (mode_)
|
||||||
|
{
|
||||||
|
case NEARESTPATCHFACEAMI:
|
||||||
|
{
|
||||||
|
lst = AMI().interpolateToTarget(Field<Type>(lst.xfer()));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
label cSize = patch_.size();
|
||||||
|
map().reverseDistribute(cSize, lst);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//- Return reference to the parallel distribution map
|
//- Return reference to the parallel distribution map
|
||||||
const mapDistribute& map() const
|
const mapDistribute& map() const
|
||||||
{
|
{
|
||||||
|
|||||||
@ -151,13 +151,11 @@ void Foam::filmPyrolysisTemperatureCoupledFvPatchScalarField::updateCoeffs()
|
|||||||
|
|
||||||
const label filmPatchI = filmModel.regionPatchID(patchI);
|
const label filmPatchI = filmModel.regionPatchID(patchI);
|
||||||
|
|
||||||
const mappedPatchBase& filmMap = filmModel.mappedPatches()[filmPatchI];
|
|
||||||
|
|
||||||
scalarField deltaFilm = filmModel.delta().boundaryField()[filmPatchI];
|
scalarField deltaFilm = filmModel.delta().boundaryField()[filmPatchI];
|
||||||
filmMap.distribute(deltaFilm);
|
filmModel.toPrimary(filmPatchI, deltaFilm);
|
||||||
|
|
||||||
scalarField TFilm = filmModel.Ts().boundaryField()[filmPatchI];
|
scalarField TFilm = filmModel.Ts().boundaryField()[filmPatchI];
|
||||||
filmMap.distribute(TFilm);
|
filmModel.toPrimary(filmPatchI, TFilm);
|
||||||
|
|
||||||
|
|
||||||
// Retrieve pyrolysis model
|
// Retrieve pyrolysis model
|
||||||
@ -166,10 +164,8 @@ void Foam::filmPyrolysisTemperatureCoupledFvPatchScalarField::updateCoeffs()
|
|||||||
|
|
||||||
const label pyrPatchI = pyrModel.regionPatchID(patchI);
|
const label pyrPatchI = pyrModel.regionPatchID(patchI);
|
||||||
|
|
||||||
const mappedPatchBase& pyrMap = pyrModel.mappedPatches()[pyrPatchI];
|
|
||||||
|
|
||||||
scalarField TPyr = pyrModel.T().boundaryField()[pyrPatchI];
|
scalarField TPyr = pyrModel.T().boundaryField()[pyrPatchI];
|
||||||
pyrMap.distribute(TPyr);
|
pyrModel.toPrimary(pyrPatchI, TPyr);
|
||||||
|
|
||||||
|
|
||||||
forAll(deltaFilm, i)
|
forAll(deltaFilm, i)
|
||||||
|
|||||||
@ -154,13 +154,11 @@ void Foam::filmPyrolysisVelocityCoupledFvPatchVectorField::updateCoeffs()
|
|||||||
|
|
||||||
const label filmPatchI = filmModel.regionPatchID(patchI);
|
const label filmPatchI = filmModel.regionPatchID(patchI);
|
||||||
|
|
||||||
const mappedPatchBase& filmMap = filmModel.mappedPatches()[filmPatchI];
|
|
||||||
|
|
||||||
scalarField deltaFilm = filmModel.delta().boundaryField()[filmPatchI];
|
scalarField deltaFilm = filmModel.delta().boundaryField()[filmPatchI];
|
||||||
filmMap.distribute(deltaFilm);
|
filmModel.toPrimary(filmPatchI, deltaFilm);
|
||||||
|
|
||||||
vectorField UFilm = filmModel.Us().boundaryField()[filmPatchI];
|
vectorField UFilm = filmModel.Us().boundaryField()[filmPatchI];
|
||||||
filmMap.distribute(UFilm);
|
filmModel.toPrimary(filmPatchI, UFilm);
|
||||||
|
|
||||||
|
|
||||||
// Retrieve pyrolysis model
|
// Retrieve pyrolysis model
|
||||||
@ -172,10 +170,8 @@ void Foam::filmPyrolysisVelocityCoupledFvPatchVectorField::updateCoeffs()
|
|||||||
|
|
||||||
const label pyrPatchI = pyrModel.regionPatchID(patchI);
|
const label pyrPatchI = pyrModel.regionPatchID(patchI);
|
||||||
|
|
||||||
const mappedPatchBase& pyrMap = pyrModel.mappedPatches()[pyrPatchI];
|
|
||||||
|
|
||||||
scalarField phiPyr = pyrModel.phiGas().boundaryField()[pyrPatchI];
|
scalarField phiPyr = pyrModel.phiGas().boundaryField()[pyrPatchI];
|
||||||
pyrMap.distribute(phiPyr);
|
pyrModel.toPrimary(pyrPatchI, phiPyr);
|
||||||
|
|
||||||
|
|
||||||
const surfaceScalarField& phi =
|
const surfaceScalarField& phi =
|
||||||
|
|||||||
@ -93,8 +93,6 @@ void Foam::regionModels::regionModel::initialise()
|
|||||||
DynamicList<label> primaryPatchIDs;
|
DynamicList<label> primaryPatchIDs;
|
||||||
DynamicList<label> intCoupledPatchIDs;
|
DynamicList<label> intCoupledPatchIDs;
|
||||||
const polyBoundaryMesh& rbm = regionMesh().boundaryMesh();
|
const polyBoundaryMesh& rbm = regionMesh().boundaryMesh();
|
||||||
const polyBoundaryMesh& pbm = primaryMesh().boundaryMesh();
|
|
||||||
mappedPatches_.setSize(rbm.size());
|
|
||||||
|
|
||||||
forAll(rbm, patchI)
|
forAll(rbm, patchI)
|
||||||
{
|
{
|
||||||
@ -116,19 +114,6 @@ void Foam::regionModels::regionModel::initialise()
|
|||||||
|
|
||||||
const label primaryPatchI = mapPatch.samplePolyPatch().index();
|
const label primaryPatchI = mapPatch.samplePolyPatch().index();
|
||||||
primaryPatchIDs.append(primaryPatchI);
|
primaryPatchIDs.append(primaryPatchI);
|
||||||
|
|
||||||
mappedPatches_.set
|
|
||||||
(
|
|
||||||
patchI,
|
|
||||||
new mappedPatchBase
|
|
||||||
(
|
|
||||||
pbm[primaryPatchI],
|
|
||||||
regionMesh().name(),
|
|
||||||
mapPatch.mode(),
|
|
||||||
regionPatch.name(),
|
|
||||||
vector::zero
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -212,8 +197,7 @@ Foam::regionModels::regionModel::regionModel(const fvMesh& mesh)
|
|||||||
regionMeshPtr_(NULL),
|
regionMeshPtr_(NULL),
|
||||||
coeffs_(dictionary::null),
|
coeffs_(dictionary::null),
|
||||||
primaryPatchIDs_(),
|
primaryPatchIDs_(),
|
||||||
intCoupledPatchIDs_(),
|
intCoupledPatchIDs_()
|
||||||
mappedPatches_()
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -244,8 +228,7 @@ Foam::regionModels::regionModel::regionModel
|
|||||||
regionMeshPtr_(NULL),
|
regionMeshPtr_(NULL),
|
||||||
coeffs_(subOrEmptyDict(modelName + "Coeffs")),
|
coeffs_(subOrEmptyDict(modelName + "Coeffs")),
|
||||||
primaryPatchIDs_(),
|
primaryPatchIDs_(),
|
||||||
intCoupledPatchIDs_(),
|
intCoupledPatchIDs_()
|
||||||
mappedPatches_()
|
|
||||||
{
|
{
|
||||||
if (active_)
|
if (active_)
|
||||||
{
|
{
|
||||||
@ -290,8 +273,7 @@ Foam::regionModels::regionModel::regionModel
|
|||||||
regionMeshPtr_(NULL),
|
regionMeshPtr_(NULL),
|
||||||
coeffs_(dict.subOrEmptyDict(modelName + "Coeffs")),
|
coeffs_(dict.subOrEmptyDict(modelName + "Coeffs")),
|
||||||
primaryPatchIDs_(),
|
primaryPatchIDs_(),
|
||||||
intCoupledPatchIDs_(),
|
intCoupledPatchIDs_()
|
||||||
mappedPatches_()
|
|
||||||
{
|
{
|
||||||
if (active_)
|
if (active_)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -117,9 +117,6 @@ protected:
|
|||||||
//- List of patch IDs internally coupled with the primary region
|
//- List of patch IDs internally coupled with the primary region
|
||||||
labelList intCoupledPatchIDs_;
|
labelList intCoupledPatchIDs_;
|
||||||
|
|
||||||
//- List of patch map info
|
|
||||||
PtrList<mappedPatchBase> mappedPatches_;
|
|
||||||
|
|
||||||
|
|
||||||
// Protected member functions
|
// Protected member functions
|
||||||
|
|
||||||
@ -212,13 +209,29 @@ public:
|
|||||||
// primary region
|
// primary region
|
||||||
inline const labelList& intCoupledPatchIDs() const;
|
inline const labelList& intCoupledPatchIDs() const;
|
||||||
|
|
||||||
//- Return the list of patch map info
|
|
||||||
inline const PtrList<mappedPatchBase>& mappedPatches() const;
|
|
||||||
|
|
||||||
//- Return region ID corresponding to primaryPatchID
|
//- Return region ID corresponding to primaryPatchID
|
||||||
inline label regionPatchID(const label primaryPatchID) const;
|
inline label regionPatchID(const label primaryPatchID) const;
|
||||||
|
|
||||||
|
|
||||||
|
// Helper
|
||||||
|
|
||||||
|
//- Convert a local region field to the primary region
|
||||||
|
template<class Type>
|
||||||
|
void toPrimary
|
||||||
|
(
|
||||||
|
const label regionPatchI,
|
||||||
|
List<Type>& regionField
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Convert a primary region field to the local region
|
||||||
|
template<class Type>
|
||||||
|
void toRegion
|
||||||
|
(
|
||||||
|
const label regionPatchI,
|
||||||
|
List<Type>& primaryFieldField
|
||||||
|
) const;
|
||||||
|
|
||||||
|
|
||||||
// Evolution
|
// Evolution
|
||||||
|
|
||||||
//- Pre-evolve region
|
//- Pre-evolve region
|
||||||
@ -249,6 +262,12 @@ public:
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#ifdef NoRepository
|
||||||
|
#include "regionModelTemplates.C"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -132,13 +132,6 @@ Foam::regionModels::regionModel::intCoupledPatchIDs() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::PtrList<Foam::mappedPatchBase>&
|
|
||||||
Foam::regionModels::regionModel::mappedPatches() const
|
|
||||||
{
|
|
||||||
return mappedPatches_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline Foam::label Foam::regionModels::regionModel::regionPatchID
|
inline Foam::label Foam::regionModels::regionModel::regionPatchID
|
||||||
(
|
(
|
||||||
const label primaryPatchID
|
const label primaryPatchID
|
||||||
|
|||||||
@ -0,0 +1,80 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
void Foam::regionModels::regionModel::toPrimary
|
||||||
|
(
|
||||||
|
const label regionPatchI,
|
||||||
|
List<Type>& regionField
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
forAll(intCoupledPatchIDs_, i)
|
||||||
|
{
|
||||||
|
if (intCoupledPatchIDs_[i] == regionPatchI)
|
||||||
|
{
|
||||||
|
const mappedPatchBase& mpb =
|
||||||
|
refCast<const mappedPatchBase>
|
||||||
|
(
|
||||||
|
regionMesh().boundaryMesh()[regionPatchI]
|
||||||
|
);
|
||||||
|
mpb.reverseDistribute(regionField);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FatalErrorIn("const void toPrimary(const label, List<Type>&) const")
|
||||||
|
<< "Region patch ID " << regionPatchI << " not found in region mesh"
|
||||||
|
<< abort(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
void Foam::regionModels::regionModel::toRegion
|
||||||
|
(
|
||||||
|
const label regionPatchI,
|
||||||
|
List<Type>& primaryField
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
forAll(intCoupledPatchIDs_, i)
|
||||||
|
{
|
||||||
|
if (intCoupledPatchIDs_[i] == regionPatchI)
|
||||||
|
{
|
||||||
|
const mappedPatchBase& mpb =
|
||||||
|
refCast<const mappedPatchBase>
|
||||||
|
(
|
||||||
|
regionMesh().boundaryMesh()[regionPatchI]
|
||||||
|
);
|
||||||
|
mpb.distribute(primaryField);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FatalErrorIn("const void toRegion(const label, List<Type>&) const")
|
||||||
|
<< "Region patch ID " << regionPatchI << " not found in region mesh"
|
||||||
|
<< abort(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -158,11 +158,9 @@ void alphatFilmWallFunctionFvPatchScalarField::updateCoeffs()
|
|||||||
|
|
||||||
const label filmPatchI = filmModel.regionPatchID(patchI);
|
const label filmPatchI = filmModel.regionPatchID(patchI);
|
||||||
|
|
||||||
const mappedPatchBase& filmMap = filmModel.mappedPatches()[filmPatchI];
|
|
||||||
|
|
||||||
tmp<volScalarField> mDotFilm(filmModel.primaryMassTrans());
|
tmp<volScalarField> mDotFilm(filmModel.primaryMassTrans());
|
||||||
scalarField mDotFilmp = mDotFilm().boundaryField()[filmPatchI];
|
scalarField mDotFilmp = mDotFilm().boundaryField()[filmPatchI];
|
||||||
filmMap.distribute(mDotFilmp);
|
filmModel.toPrimary(filmPatchI, mDotFilmp);
|
||||||
|
|
||||||
// Retrieve RAS turbulence model
|
// Retrieve RAS turbulence model
|
||||||
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
|
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
|
||||||
|
|||||||
@ -70,11 +70,9 @@ tmp<scalarField> mutkFilmWallFunctionFvPatchScalarField::calcUTau
|
|||||||
|
|
||||||
const label filmPatchI = filmModel.regionPatchID(patchI);
|
const label filmPatchI = filmModel.regionPatchID(patchI);
|
||||||
|
|
||||||
const mappedPatchBase& filmMap = filmModel.mappedPatches()[filmPatchI];
|
|
||||||
|
|
||||||
tmp<volScalarField> mDotFilm(filmModel.primaryMassTrans());
|
tmp<volScalarField> mDotFilm(filmModel.primaryMassTrans());
|
||||||
scalarField mDotFilmp = mDotFilm().boundaryField()[filmPatchI];
|
scalarField mDotFilmp = mDotFilm().boundaryField()[filmPatchI];
|
||||||
filmMap.distribute(mDotFilmp);
|
filmModel.toPrimary(filmPatchI, mDotFilmp);
|
||||||
|
|
||||||
|
|
||||||
// Retrieve RAS turbulence model
|
// Retrieve RAS turbulence model
|
||||||
|
|||||||
@ -827,7 +827,7 @@ void kinematicSingleLayer::preEvolveRegion()
|
|||||||
// availableMass_ = mass();
|
// availableMass_ = mass();
|
||||||
availableMass_ = netMass();
|
availableMass_ = netMass();
|
||||||
cloudMassTrans_ == dimensionedScalar("zero", dimMass, 0.0);
|
cloudMassTrans_ == dimensionedScalar("zero", dimMass, 0.0);
|
||||||
cloudDiameterTrans_ == dimensionedScalar("zero", dimLength, -1.0);
|
cloudDiameterTrans_ == dimensionedScalar("zero", dimLength, 0.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -139,7 +139,7 @@ void drippingInjection::correct
|
|||||||
{
|
{
|
||||||
// Mass below minimum threshold - cannot be injected
|
// Mass below minimum threshold - cannot be injected
|
||||||
massToInject[cellI] = 0.0;
|
massToInject[cellI] = 0.0;
|
||||||
diameterToInject[cellI] = -1.0;
|
diameterToInject[cellI] = 0.0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -705,12 +705,11 @@ tmp<DimensionedField<scalar, volMesh> > thermoSingleLayer::Srho() const
|
|||||||
forAll(intCoupledPatchIDs(), i)
|
forAll(intCoupledPatchIDs(), i)
|
||||||
{
|
{
|
||||||
const label filmPatchI = intCoupledPatchIDs()[i];
|
const label filmPatchI = intCoupledPatchIDs()[i];
|
||||||
const mappedPatchBase& filmMap = mappedPatches_[filmPatchI];
|
|
||||||
|
|
||||||
scalarField patchMass =
|
scalarField patchMass =
|
||||||
primaryMassPCTrans_.boundaryField()[filmPatchI];
|
primaryMassPCTrans_.boundaryField()[filmPatchI];
|
||||||
|
|
||||||
filmMap.distribute(patchMass);
|
toPrimary(filmPatchI, patchMass);
|
||||||
|
|
||||||
const label primaryPatchI = primaryPatchIDs()[i];
|
const label primaryPatchI = primaryPatchIDs()[i];
|
||||||
const unallocLabelList& cells =
|
const unallocLabelList& cells =
|
||||||
@ -761,12 +760,11 @@ tmp<DimensionedField<scalar, volMesh> > thermoSingleLayer::Srho
|
|||||||
forAll(intCoupledPatchIDs_, i)
|
forAll(intCoupledPatchIDs_, i)
|
||||||
{
|
{
|
||||||
const label filmPatchI = intCoupledPatchIDs_[i];
|
const label filmPatchI = intCoupledPatchIDs_[i];
|
||||||
const mappedPatchBase& filmMap = mappedPatches_[filmPatchI];
|
|
||||||
|
|
||||||
scalarField patchMass =
|
scalarField patchMass =
|
||||||
primaryMassPCTrans_.boundaryField()[filmPatchI];
|
primaryMassPCTrans_.boundaryField()[filmPatchI];
|
||||||
|
|
||||||
filmMap.distribute(patchMass);
|
toPrimary(filmPatchI, patchMass);
|
||||||
|
|
||||||
const label primaryPatchI = primaryPatchIDs()[i];
|
const label primaryPatchI = primaryPatchIDs()[i];
|
||||||
const unallocLabelList& cells =
|
const unallocLabelList& cells =
|
||||||
@ -812,12 +810,11 @@ tmp<DimensionedField<scalar, volMesh> > thermoSingleLayer::Sh() const
|
|||||||
forAll(intCoupledPatchIDs_, i)
|
forAll(intCoupledPatchIDs_, i)
|
||||||
{
|
{
|
||||||
const label filmPatchI = intCoupledPatchIDs_[i];
|
const label filmPatchI = intCoupledPatchIDs_[i];
|
||||||
const mappedPatchBase& filmMap = mappedPatches_[filmPatchI];
|
|
||||||
|
|
||||||
scalarField patchEnergy =
|
scalarField patchEnergy =
|
||||||
primaryEnergyPCTrans_.boundaryField()[filmPatchI];
|
primaryEnergyPCTrans_.boundaryField()[filmPatchI];
|
||||||
|
|
||||||
filmMap.distribute(patchEnergy);
|
toPrimary(filmPatchI, patchEnergy);
|
||||||
|
|
||||||
const label primaryPatchI = primaryPatchIDs()[i];
|
const label primaryPatchI = primaryPatchIDs()[i];
|
||||||
const unallocLabelList& cells =
|
const unallocLabelList& cells =
|
||||||
|
|||||||
Reference in New Issue
Block a user