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->divDevReff(U)
10  ==
11  fvOptions(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 
31  fvOptions.constrain(UEqn);
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 
41  fvOptions.correct(U);
42  }
43  else
44  {
45  pZones.addResistance(UEqn);
46 
47  fvOptions.constrain(UEqn);
48 
49  solve(UEqn == -fvc::grad(p));
50 
51  fvOptions.correct(U);
52 
53  trAU = 1.0/UEqn.A();
54  trAU.ref().rename("rAU");
55  }
autoPtr< compressible::turbulenceModel > turbulence
Definition: createFields.H:23
surfaceScalarField & phi
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcGrad.C:52
U
Definition: pEqn.H:83
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)
tmp< fvVectorMatrix > tUEqn(fvm::ddt(rho, U)+fvm::div(phi, U)+MRF.DDt(rho, U)+turbulence->divDevRhoReff(U)==fvOptions(rho, U))
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:55
tmp< volTensorField > trTU
Definition: UEqn.H:22
fv::options & fvOptions
IOMRFZoneList & MRF
static const Identity< scalar > I
Definition: Identity.H:93
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)