All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
UEqn.H
Go to the documentation of this file.
1  // Construct the Momentum equation
2 
3  MRF.correctBoundaryVelocity(U);
4 
5  tmp<fvVectorMatrix> tUEqn
6  (
7  fvm::div(phi, U)
8  + MRF.DDt(U)
9  + turbulence->divDevSigma(U)
10  ==
11  fvModels.source(U)
12  );
13  fvVectorMatrix& UEqn = tUEqn.ref();
14 
15  UEqn.relax();
16 
17  // Include the porous media resistance and solve the momentum equation
18  // either implicit in the tensorial resistance or transport using by
19  // including the spherical part of the resistance in the momentum diagonal
20 
21  tmp<volScalarField> trAU;
22  tmp<volTensorField> trTU;
23 
25  {
26  tmp<volTensorField> tTU = tensor(I)*UEqn.A();
27  pZones.addResistance(UEqn, tTU.ref());
28  trTU = inv(tTU());
29  trTU.ref().rename("rAU");
30 
32 
33  volVectorField gradp(fvc::grad(p));
34 
35  for (int UCorr=0; UCorr<nUCorr; UCorr++)
36  {
37  U = trTU() & (UEqn.H() - gradp);
38  }
39  U.correctBoundaryConditions();
40 
42  }
43  else
44  {
45  pZones.addResistance(UEqn);
46 
48 
49  solve(UEqn == -fvc::grad(p));
50 
52 
53  trAU = 1.0/UEqn.A();
54  trAU.ref().rename("rAU");
55  }
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcGrad.C:52
IOMRFZoneList & MRF
solve(UEqn==-fvc::grad(p))
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcDiv.C:47
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:58
tmp< volTensorField > trTU
Definition: UEqn.H:22
static const Identity< scalar > I
Definition: Identity.H:93
Foam::fvConstraints & fvConstraints
phi
Definition: correctPhi.H:3
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))
Definition: createFields.H:94
tmp< fvVectorMatrix > tUEqn(fvm::ddt(rho, U)+fvm::div(phi, U)+MRF.DDt(rho, U)+turbulence->divDevTau(U)==fvModels.source(rho, U))
bool constrain(fvMatrix< Type > &eqn) const
Apply constraints to an equation.
Foam::fvModels & fvModels
U
Definition: pEqn.H:72
fvMatrix< vector > fvVectorMatrix
Definition: fvMatricesFwd.H:45
volScalarField & p
Switch pressureImplicitPorosity(false)
Tensor< scalar > tensor
Tensor of scalars.
Definition: tensor.H:51
tmp< volScalarField > trAU
Definition: UEqn.H:21
int nUCorr
Definition: createZones.H:5
IOporosityModelList pZones(mesh)