Go to the documentation of this file.
45 incompressiblePrimalSolver,
53 Foam::incompressiblePrimalSolver::incompressiblePrimalSolver
56 const word& managerType,
63 dict.subOrEmptyDict(
"fieldReconstruction").
64 getOrDefault<scalar>(
"tolerance", 5.
e-5)
66 phiReconstructionIters_
68 dict.subOrEmptyDict(
"fieldReconstruction").
69 getOrDefault<label>(
"iters", 10)
81 const word& managerType,
86 auto cstrIter = dictionaryConstructorTablePtr_->cfind(solverType);
88 if (!cstrIter.found())
93 "incompressiblePrimalSolver",
95 *dictionaryConstructorTablePtr_
151 return vars_().useSolverNameForFields();
159 refCast<incompressibleVars>(
const_cast<variablesSet&
>(vars_()));
168 refCast<incompressibleVars>(
const_cast<variablesSet&
>(vars_()));
191 scalar contError(GREAT),
diff(GREAT);
192 for (label iter = 0; iter < phiReconstructionIters_; ++iter)
194 Info<<
"phi correction iteration " << iter <<
endl;
207 fvOptions_().constrain(
UEqn);
229 scalar contErrorNew =
230 mesh_.time().deltaTValue()*
233 Info<<
"sum local = " << contErrorNew <<
endl;
234 diff =
mag(contErrorNew - contError)/contError;
235 contError = contErrorNew;
237 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.
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
autoPtr< fv::optionList > fvOptions_
optionList for source terms addition
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 (uses stdout - output is on the master only)
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.
dictionary subOrEmptyDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX, const bool mandatory=false) const
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.