UEqn.H
Go to the documentation of this file.
1  // Construct the Momentum equation
2 
3  MRF.correctBoundaryVelocity(U);
4 
5  tmp<fvVectorMatrix> UEqn
6  (
7  fvm::div(phi, U)
8  + MRF.DDt(rho, U)
9  + turbulence->divDevRhoReff(U)
10  ==
11  fvOptions(rho, U)
12  );
13 
14  UEqn().relax();
15 
16  // Include the porous media resistance and solve the momentum equation
17  // either implicit in the tensorial resistance or transport using by
18  // including the spherical part of the resistance in the momentum diagonal
19 
20  tmp<volScalarField> trAU;
21  tmp<volTensorField> trTU;
22 
24  {
25  tmp<volTensorField> tTU = tensor(I)*UEqn().A();
26  pZones.addResistance(UEqn(), tTU());
27  trTU = inv(tTU());
28  trTU().rename("rAU");
29 
30  fvOptions.constrain(UEqn());
31 
32  volVectorField gradp(fvc::grad(p));
33 
34  for (int UCorr=0; UCorr<nUCorr; UCorr++)
35  {
36  U = trTU() & (UEqn().H() - gradp);
37  }
38  U.correctBoundaryConditions();
39 
40  fvOptions.correct(U);
41  }
42  else
43  {
44  pZones.addResistance(UEqn());
45 
46  fvOptions.constrain(UEqn());
47 
48  solve(UEqn() == -fvc::grad(p));
49 
50  fvOptions.correct(U);
51 
52  trAU = 1.0/UEqn().A();
53  trAU().rename("rAU");
54  }
int nUCorr
Definition: createZones.H:5
tmp< volTensorField > trTU
Definition: UEqn.H:21
Tensor< scalar > tensor
Tensor of scalars.
Definition: tensor.H:51
solve(UEqn()==-fvc::grad(p))
static const sphericalTensor I(1)
autoPtr< compressible::turbulenceModel > turbulence
Definition: createFields.H:23
IOporosityModelList pZones(mesh)
fv::IOoptionList & fvOptions
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
IOMRFZoneList & MRF
fvVectorMatrix UEqn(fvm::ddt(rho, U)+fvm::div(phi, U)+turbulence->divDevRhoReff(U)==fvOptions(rho, U))
volScalarField & p
Definition: createFields.H:51
Switch pressureImplicitPorosity(false)
surfaceScalarField & phi
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:55
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcDiv.C:47
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcGrad.C:52
tmp< volScalarField > trAU
Definition: UEqn.H:20
U
Definition: pEqn.H:82