Go to the documentation of this file.
46 incompressiblePrimalSolver,
54 Foam::incompressiblePrimalSolver::incompressiblePrimalSolver
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_
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;
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
Base class for adjoint solvers.
tmp< GeometricField< Type, fvPatchField, volMesh > > H() const
Return the H operation source.
List< objective * > getObjectiveFunctions() const
Return the list of objectives assodicated with this solver.
bool adjustPhi(surfaceScalarField &phi, const volVectorField &U, volScalarField &p)
Adjust the balance of fluxes to obey continuity.
tmp< surfaceScalarField > flux(const volVectorField &vvf)
Return the face-flux field obtained from the given volVectorField.
tmp< volScalarField > rAU
A class for handling words, derived from Foam::string.
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.
const word & primalSolverName() const
Return the primal solver name.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
void constrain(fvMatrix< Type > &eqn)
Apply constraints to equation.
static options & New(const fvMesh &mesh)
Construct fvOptions and register to database if not present.
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
const surfaceScalarField & phi() const
Return const reference to volume flux.
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Ostream & endl(Ostream &os)
Add newline and flush stream.
const volScalarField & p() const
Return const reference to pressure.
For cases which do no have a pressure boundary adjust the balance of fluxes to obey continuity....
Base class for creating a set of variables.
scalar diff(const triad &A, const triad &B)
Return a quantity of the difference between two triads.
#define FatalIOErrorInLookup(ios, lookupTag, lookupName, lookupTable)
Report an error message using Foam::FatalIOError.
tmp< fvVectorMatrix > tUEqn(fvm::ddt(rho, U)+fvm::div(phi, U)+MRF.DDt(rho, U)+turbulence->divDevRhoReff(U)==fvOptions(rho, U))
messageStream Info
Information stream (stdout output on master, null elsewhere)
tmp< fvMatrix< Type > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
void relax(const scalar alpha)
Relax matrix (for steady-state solution).
DynamicList< T, SizeMin > & append(const T &val)
Append an element to the end of this list.
virtual bool readDict(const dictionary &dict)
Read dict if updated.
const volVectorField & U() const
Return const reference to velocity.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Macros for easy insertion into run-time selection tables.
bool useSolverNameForFields() const
Should solver name be appended to fields.
virtual void correctBoundaryConditions()
Update boundary conditions.
tmp< volScalarField > A() const
Return the central coefficient.
Mesh data needed to do the Finite Volume discretisation.
const autoPtr< incompressible::turbulenceModel > & turbulence() const
Return const reference to the turbulence model.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
const objectiveManager & getObjectiveManager() const
Return a const reference to the objective manager.
virtual bool readDict(const dictionary &dict)
Base class for primal solvers.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
const dimensionedScalar e
Elementary charge.
A special matrix type and solver, designed for finite volume solutions of scalar equations....
void correctBoundaryConditions()
correct boundaryconditions for all volFields
const incompressibleVars & getIncoVars() const
Access to the incompressible variables set.
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)
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > flux() const
Return the face-flux field from the matrix.
virtual const dictionary & dict() const
Return the solver dictionary.
Base class for solution control classes.
PtrList< objective > & getObjectiveFunctions()
Return reference to objective functions.
static autoPtr< incompressiblePrimalSolver > New(fvMesh &mesh, const word &managerType, const dictionary &dict)
Return a reference to the selected incompressible primal solver.