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),
120 if (incompressiblePrimalSolver::readDict(
dict))
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();
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());
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
For cases which do no have a pressure boundary adjust the balance of fluxes to obey continuity....
dimensioned< Type > weightedAverage(const DimensionedField< scalar, GeoMesh > &weightField) const
Calculate and return weighted average.
void relax(const scalar alpha)
Relax field (for steady-state solution).
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
SIMPLE control class to supply convergence information/checks for the SIMPLE loop.
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
A special matrix type and solver, designed for finite volume solutions of scalar equations....
void relax(const scalar alpha)
Relax matrix (for steady-state solution).
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > flux() const
Return the face-flux field from the matrix.
SolverPerformance< Type > solve(const dictionary &)
Solve returning the solution statistics.
tmp< volScalarField > A() const
Return the central coefficient.
tmp< volScalarField > H1() const
Return H(1)
void setReference(const label celli, const Type &value, const bool forceReference=false)
Set reference level for solution.
tmp< GeometricField< Type, fvPatchField, volMesh > > H() const
Return the H operation source.
Mesh data needed to do the Finite Volume discretisation.
void constrain(fvMatrix< Type > &eqn)
Apply constraints to equation.
void correct(GeometricField< Type, fvPatchField, volMesh > &field)
Apply correction to field.
Base class for primal incompressible solvers.
const incompressibleVars & getIncoVars() const
Access to the incompressible variables set.
Base class for solution control classes.
const volScalarField & pInst() const
Return const reference to pressure.
Abstract base class for objective functions. No point in making this runTime selectable since its chi...
Base class for solution control classes.
virtual void postIter()
Steps to be executed before each main SIMPLE iteration.
autoPtr< SIMPLEControl > solverControl_
Solver control.
virtual void preIter()
Steps to be executed before each main SIMPLE iteration.
virtual void restoreInitValues()
Restore initial field values if necessary.
virtual bool writeData(Ostream &os) const
Write average iteration.
incompressibleVars & allocateVars()
Protected Member Functions.
virtual bool readDict(const dictionary &dict)
Read dict if updated.
virtual void mainIter()
The main SIMPLE iter.
incompressibleVars & incoVars_
Reference to incompressibleVars.
virtual void preLoop()
Functions to be called before loop.
void continuityErrors()
Compute continuity errors.
virtual void postLoop()
Functions to be called after loop.
virtual bool loop()
Looper (advances iters, time step)
virtual void solveIter()
Execute one iteration of the solution algorithm.
virtual void solve()
Main control loop.
autoPtr< variablesSet > vars_
Base variableSet pointer.
virtual const dictionary & dict() const
Return the solver dictionary.
fvMesh & mesh_
Reference to the mesh database.
A class for managing temporary objects.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
tmp< fvVectorMatrix > tUEqn(fvm::ddt(rho, U)+fvm::div(phi, U)+MRF.DDt(rho, U)+turbulence->divDevRhoReff(U)==fvOptions(rho, U))
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))())
OBJstream os(runTime.globalPath()/outputName)
Find the reference cell nearest (in index) to the given cell but which is not on a cyclic,...
compressible::turbulenceModel & turbulence
tmp< volScalarField > rAU
#define WarningInFunction
Report a warning using Foam::Warning.
static tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > interpolate(const GeometricField< Type, fvPatchField, volMesh > &tvf, const surfaceScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh > > grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > snGrad(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
tmp< surfaceScalarField > flux(const volVectorField &vvf)
Return the face-flux field obtained from the given volVectorField.
tmp< fvMatrix< Type > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
tmp< fvMatrix< Type > > div(const surfaceScalarField &flux, const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
bool adjustPhi(surfaceScalarField &phi, const volVectorField &U, volScalarField &p)
Adjust the balance of fluxes to obey continuity.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
static constexpr const zero Zero
Global zero (0)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
bool setRefCell(const volScalarField &field, const volScalarField &fieldRef, const dictionary &dict, label &refCelli, scalar &refValue, const bool forceReference=false)
If the field fieldRef needs referencing find the reference cell nearest.
constexpr char nl
The newline '\n' character (0x0a)
constexpr char tab
The tab '\t' character(0x09)
SolverPerformance< Type > solve(faMatrix< Type > &, const dictionary &)
Solve returning the solution statistics given convergence tolerance.
const bool momentumPredictor