59 GeometricField<Type, fvPatchField, volMesh>& vf,
72 int main(
int argc,
char *argv[])
79 #include "createControl.H" 80 #include "createFields.H" 81 #include "initContinuityErrs.H" 88 Info<<
"\nStarting time loop\n" <<
endl;
100 mesh.fieldRelaxationFactor(
"alpha")
112 tmp<fvVectorMatrix>
tUEqn 140 while (
simple.correctNonOrthogonal())
155 if (
simple.finalNonOrthogonalIter())
161 #include "continuityErrs.H" 168 U.correctBoundaryConditions();
187 tmp<fvVectorMatrix> tUaEqn
190 - adjointTransposeConvection
208 HbyAa = rAUa*UaEqn.H();
214 while (
simple.correctNonOrthogonal())
221 paEqn.setReference(paRefCell, paRefValue);
224 if (
simple.finalNonOrthogonalIter())
226 phia = phiHbyAa - paEqn.flux();
237 Ua.correctBoundaryConditions();
246 Info<<
"ExecutionTime = "
pressureReference & pressureReference
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
fvMatrix< scalar > fvScalarMatrix
#define forAll(list, i)
Loop across all elements in list.
const labelList & inletCells
dimensionedScalar lambda(laminarTransport.lookup("lambda"))
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
void constrainPressure(volScalarField &p, const RhoType &rho, const volVectorField &U, const surfaceScalarField &phiHbyA, const RAUType &rhorAU, const MRFType &MRF)
volScalarField alpha(IOobject("alpha", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
virtual void correct()
Correct the fvModels.
Ostream & endl(Ostream &os)
Add newline and flush stream.
zeroCells(alpha, inletCells)
GeometricField< vector, fvPatchField, volMesh > volVectorField
tmp< GeometricField< Type, fvPatchField, volMesh > > laplacian(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.
dimensionedScalar alphaMax(laminarTransport.lookup("alphaMax"))
dimensionedScalar zeroAlpha("0", dimless/dimTime, 0.0)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Foam::fvConstraints & fvConstraints
List< label > labelList
A List of labels.
tmp< volVectorField > constrainHbyA(const tmp< volVectorField > &tHbyA, const volVectorField &U, const volScalarField &p)
Info<< "Reading field U\"<< 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(dimless, 1.0));surfaceScalarField neg(IOobject("neg", runTime.timeName(), mesh), mesh, dimensionedScalar(dimless, -1.0));surfaceScalarField phi("phi", fvc::flux(rhoU));Info<< "Creating turbulence model\"<< endl;autoPtr< compressible::momentumTransportModel > turbulence(compressible::momentumTransportModel::New(rho, U, phi, thermo))
Declare and initialise the cumulative adjoint continuity error.
tmp< fvVectorMatrix > tUEqn(fvm::ddt(rho, U)+fvm::div(phi, U)+MRF.DDt(rho, U)+turbulence->divDevTau(U)==fvModels.source(rho, U))
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
const tmp< volScalarField::Internal > & Sp
bool constrain(fvMatrix< Type > &eqn) const
Apply constraints to an equation.
Foam::fvModels & fvModels
tmp< volScalarField > rAU
fvMatrix< vector > fvVectorMatrix
Calculates and prints the continuity errors.
tmp< surfaceScalarField > flux(const volVectorField &vvf)
Return the face-flux field obtained from the given volVectorField.
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Execute application functionObjects to post-process existing results.
singlePhaseTransportModel laminarTransport(U, phi)
simpleControl simple(mesh)