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(U)
9  + turbulence->divDevReff(U)
10  ==
11  fvOptions(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  }
Foam::fvc::grad
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcGrad.C:52
trAU
tmp< volScalarField > trAU
Definition: UEqn.H:20
p
p
Definition: pEqn.H:62
phi
surfaceScalarField & phi
Definition: setRegionFluidFields.H:8
Foam::tensor
Tensor< scalar > tensor
Tensor of scalars.
Definition: tensor.H:51
pZones
IOporosityModelList pZones(mesh)
Foam::fvc::div
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcDiv.C:47
trTU
tmp< volTensorField > trTU
Definition: UEqn.H:21
U
U
Definition: pEqn.H:46
turbulence
autoPtr< compressible::turbulenceModel > turbulence
Definition: createFields.H:23
Foam::inv
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
Definition: dimensionedSphericalTensor.C:71
UEqn
tmp< fvVectorMatrix > UEqn(fvm::div(phi, U)+MRF.DDt(U)+turbulence->divDevReff(U)==fvOptions(U))
nUCorr
int nUCorr
Definition: createPorousZones.H:5
Foam::I
static const sphericalTensor I(1)
MRF
IOMRFZoneList & MRF
Definition: setRegionFluidFields.H:15
Foam::volVectorField
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:55
pressureImplicitPorosity
Switch pressureImplicitPorosity(false)
solve
solve(UEqn()==-fvc::grad(p))
fvOptions
fv::options & fvOptions
Definition: setRegionFluidFields.H:16