57 const word& managerType,
64 dict.subOrEmptyDict(
"fieldReconstruction").
65 getOrDefault<scalar>(
"tolerance", 5.e-5)
67 phiReconstructionIters_
69 dict.subOrEmptyDict(
"fieldReconstruction").
70 getOrDefault<label>(
"iters", 10)
81 const word& managerType,
86 auto* ctorPtr = dictionaryConstructorTable(solverType);
93 "incompressiblePrimalSolver",
95 *dictionaryConstructorTablePtr_
111 if (primalSolver::readDict(
dict))
149 return vars_().useSolverNameForFields();
157 refCast<incompressibleVars>(
const_cast<variablesSet&
>(vars_()));
166 refCast<incompressibleVars>(
const_cast<variablesSet&
>(vars_()));
190 scalar contError(GREAT),
diff(GREAT);
191 for (label iter = 0; iter < phiReconstructionIters_; ++iter)
193 Info<<
"phi correction iteration " << iter <<
endl;
228 scalar contErrorNew =
229 mesh_.time().deltaTValue()*
232 Info<<
"sum local = " << contErrorNew <<
endl;
233 diff =
mag(contErrorNew - contError)/contError;
234 contError = contErrorNew;
236 if (
diff < phiReconstructionTol_)
break;
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....
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
void append(const T &val)
Copy append an element to the end of this list.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
Base class for adjoint solvers.
const objectiveManager & getObjectiveManager() const
Return a const reference to the objective manager.
const word & primalSolverName() const
Return the primal solver name.
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,...
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
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.
tmp< volScalarField > A() const
Return the central coefficient.
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.
Base class for primal incompressible solvers.
List< objective * > getObjectiveFunctions() const
Return the list of objectives assodicated with this solver.
const incompressibleVars & getIncoVars() const
Access to the incompressible variables set.
virtual bool readDict(const dictionary &dict)
Read dict if updated.
bool useSolverNameForFields() const
Should solver name be appended to fields.
virtual void correctBoundaryConditions()
Update boundary conditions.
Base class for solution control classes.
const volVectorField & U() const
Return const reference to velocity.
const volScalarField & p() const
Return const reference to pressure.
const surfaceScalarField & phi() const
Return const reference to volume flux.
const autoPtr< incompressible::turbulenceModel > & turbulence() const
Return const reference to the turbulence model.
void correctBoundaryConditions()
correct boundaryconditions for all volFields
PtrList< objective > & getObjectiveFunctions()
Return reference to objective functions.
Abstract base class for objective functions. No point in making this runTime selectable since its chi...
Base class for primal solvers.
A class for managing temporary objects.
Base class for creating a set of variables.
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))
#define FatalIOErrorInLookup(ios, lookupTag, lookupName, lookupTable)
Report an error message using Foam::FatalIOError.
compressible::turbulenceModel & turbulence
tmp< volScalarField > rAU
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)
scalar diff(const triad &A, const triad &B)
Return a quantity of the difference between two triads.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define defineRunTimeSelectionTable(baseType, argNames)
Define run-time selection table.