Go to the documentation of this file.
58 if (incoVars_.useSolverNameForFields())
61 <<
"useSolverNameForFields is set to true for primalSolver "
62 << solverName() <<
nl <<
tab
63 <<
"Appending variable names with the solver name" <<
nl <<
tab
64 <<
"Please adjust the necessary entries in fvSchemes and fvSolution"
76 mag(
contErr)().weightedAverage(mesh_.V()).value();
84 <<
", cumulative = " << cumulativeContErr_
94 const word& managerType,
100 incoVars_(allocateVars()),
101 MRF_(
mesh,
word(useSolverNameForFields() ? solverName() :
word::null)),
102 cumulativeContErr_(
Zero),
138 Info<<
"Time = " << mesh_.time().timeName() <<
"\n" <<
endl;
149 incoVars_.turbulence();
150 label&
pRefCell = solverControl_().pRefCell();
151 scalar&
pRefValue = solverControl_().pRefValue();
157 MRF_.correctBoundaryVelocity(
U);
191 if (solverControl_().consistent())
205 while (solverControl_().correctNonOrthogonal())
216 if (solverControl_().finalNonOrthogonalIter())
229 U.correctBoundaryConditions();
233 incoVars_.laminarTransport().correct();
240 solverControl_().write();
244 for (objective* obj : objectives_)
246 Info<< obj->objectiveName() <<
" : " << obj->J() <<
endl;
247 obj->accumulateJMean(solverControl_());
248 obj->writeInstantaneousValue();
252 incoVars_.computeMeanFields();
255 mesh_.time().printExecutionTime(
Info);
265 while (solverControl_().loop())
276 return solverControl_().loop();
282 incoVars_.restoreInitValues();
289 if (objectives_.empty())
291 objectives_ = getObjectiveFunctions();
296 incoVars_.resetMeanFields();
299 incoVars_.turbulence()->validate();
307 obj->writeInstantaneousSeparator();
317 os.
writeEntry(
"averageIter", solverControl_().averageIter());
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
void constrainPressure(volScalarField &p, const RhoType &rho, const volVectorField &U, const surfaceScalarField &phiHbyA, const RAUType &rhorAU, const MRFType &MRF)
tmp< GeometricField< Type, fvPatchField, volMesh > > H() const
tmp< volVectorField > constrainHbyA(const tmp< volVectorField > &tHbyA, const volVectorField &U, const volScalarField &p)
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > snGrad(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
volScalarField rAtU(1.0/(1.0/rAU - UEqn.H1()))
volScalarField::Internal contErr((fvc::ddt(rho)+fvc::div(rhoPhi) -(fvOptions(alpha1, mixture.thermo1().rho())&rho1) -(fvOptions(alpha2, mixture.thermo2().rho())&rho2))())
bool adjustPhi(surfaceScalarField &phi, const volVectorField &U, volScalarField &p)
const dictionary & simple
const bool momentumPredictor
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
tmp< volScalarField > rAU
A class for handling words, derived from Foam::string.
autoPtr< SIMPLEControl > solverControl_
void correct(GeometricField< Type, fvPatchField, volMesh > &field)
Info<< "Reading field U\n"<< endl;volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);volScalarField rho(IOobject("rho", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), thermo.rho());volVectorField rhoU(IOobject("rhoU", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), rho *U);volScalarField rhoE(IOobject("rhoE", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), rho *(e+0.5 *magSqr(U)));surfaceScalarField pos(IOobject("pos", runTime.timeName(), mesh), mesh, dimensionedScalar("pos", dimless, 1.0));surfaceScalarField neg(IOobject("neg", runTime.timeName(), mesh), mesh, dimensionedScalar("neg", dimless, -1.0));surfaceScalarField phi("phi", fvc::flux(rhoU));Info<< "Creating turbulence model\n"<< endl;autoPtr< compressible::turbulenceModel > turbulence(compressible::turbulenceModel::New(rho, U, phi, thermo))
A class for managing temporary objects.
static constexpr const zero Zero
void constrain(fvMatrix< Type > &eqn)
static options & New(const fvMesh &mesh)
Find the reference cell nearest (in index) to the given cell but which is not on a cyclic,...
const incompressibleVars & getIncoVars() const
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Ostream & endl(Ostream &os)
void setReference(const label celli, const Type &value, const bool forceReference=false)
For cases which do no have a pressure boundary adjust the balance of fluxes to obey continuity....
Base class for solution control classes.
const volScalarField & pInst() const
SolverPerformance< Type > solve(const dictionary &)
tmp< fvVectorMatrix > tUEqn(fvm::ddt(rho, U)+fvm::div(phi, U)+MRF.DDt(rho, U)+turbulence->divDevRhoReff(U)==fvOptions(rho, U))
fvMatrix< scalar > fvScalarMatrix
virtual bool writeData(Ostream &os) const
tmp< fvMatrix< Type > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
tmp< volScalarField > H1() const
void relax(const scalar alpha)
virtual bool readDict(const dictionary &dict)
bool setRefCell(const volScalarField &field, const volScalarField &fieldRef, const dictionary &dict, label &refCelli, scalar &refValue, const bool forceReference=false)
SolverPerformance< Type > solve(faMatrix< Type > &, Istream &)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
virtual void restoreInitValues()
Base class for primal incompressible solvers.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
OBJstream os(runTime.globalPath()/outputName)
Macros for easy insertion into run-time selection tables.
incompressibleVars & incoVars_
tmp< volScalarField > A() const
Mesh data needed to do the Finite Volume discretisation.
static tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > interpolate(const GeometricField< Type, fvPatchField, volMesh > &tvf, const surfaceScalarField &faceFlux, Istream &schemeData)
static autoPtr< SIMPLEControl > New(fvMesh &mesh, const word &managerType, const solver &solver)
GeometricField< vector, fvPatchField, volMesh > volVectorField
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
autoPtr< variablesSet > vars_
dimensioned< Type > weightedAverage(const DimensionedField< scalar, GeoMesh > &weightField) const
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
incompressibleVars & allocateVars()
void relax(const scalar alpha)
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Ostream & writeEntry(const keyType &key, const T &value)
virtual bool readDict(const dictionary &dict)
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
tmp< surfaceScalarField > flux(const volVectorField &vvf)
Generic GeometricField class.
tmp< fvMatrix< Type > > div(const surfaceScalarField &flux, const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Abstract base class for objective functions. No point in making this runTime selectable since its chi...
defineTypeNameAndDebug(combustionModel, 0)
#define WarningInFunction
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > flux() const
virtual const dictionary & dict() const
Base class for solution control classes.
SIMPLE control class to supply convergence information/checks for the SIMPLE loop.