UEqn.H
Go to the documentation of this file.
1  // Construct the Momentum equation
2 
3  tmp<fvVectorMatrix> tUEqn
4  (
5  fvm::div(phi, U)
6  + MRF.DDt(rho, U)
7  + turbulence->divDevTau(U)
8  ==
10  );
12 
13  UEqn.relax();
14 
15  // Include the porous media resistance and solve the momentum equation
16  // either implicit in the tensorial resistance or transport using by
17  // including the spherical part of the resistance in the momentum diagonal
18 
19  tmp<volScalarField> trAU;
20  tmp<volTensorField> trTU;
21 
23  {
24  tmp<volTensorField> tTU = tensor(I)*UEqn.A();
25  pZones.addResistance(UEqn, tTU.ref());
26  trTU = inv(tTU());
27  trTU.ref().rename("rAU");
28 
30 
31  volVectorField gradp(fvc::grad(p));
32 
33  for (int UCorr=0; UCorr<nUCorr; UCorr++)
34  {
35  U = trTU() & (UEqn.H() - gradp);
36  }
37  U.correctBoundaryConditions();
38 
40  }
41  else
42  {
43  pZones.addResistance(UEqn);
44 
46 
48 
50 
51  trAU = 1.0/UEqn.A();
52  trAU.ref().rename("rAU");
53  }
bool constrain(fvMatrix< Type > &eqn) const
Apply constraints to an equation.
tmp< fvMatrix< Type > > source(const VolField< Type > &field) const
Return source for an equation.
tmp< volTensorField > trTU
Definition: UEqn.H:20
solve(UEqn==-fvc::grad(p))
tmp< fvVectorMatrix > tUEqn(fvm::div(phi, U)+MRF.DDt(rho, U)+turbulence->divDevTau(U)==fvModels.source(rho, U))
tmp< volScalarField > trAU
Definition: UEqn.H:19
fvVectorMatrix & UEqn
Definition: UEqn.H:11
Foam::fvConstraints & fvConstraints(Foam::fvConstraints::New(mesh))
Foam::fvModels & fvModels(Foam::fvModels::New(mesh))
IOMRFZoneList MRF(mesh)
Switch pressureImplicitPorosity(false)
int nUCorr
Definition: createZones.H:5
IOporosityModelList pZones(mesh)
U
Definition: pEqn.H:72
tmp< VolField< typename outerProduct< vector, Type >::type > > grad(const SurfaceField< Type > &ssf)
Definition: fvcGrad.C:46
tmp< VolField< Type > > div(const SurfaceField< Type > &ssf)
Definition: fvcDiv.C:47
VolField< vector > volVectorField
Definition: volFieldsFwd.H:65
Tensor< scalar > tensor
Tensor of scalars.
Definition: tensor.H:51
static const Identity< scalar > I
Definition: Identity.H:93
fvMatrix< vector > fvVectorMatrix
Definition: fvMatricesFwd.H:45
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
autoPtr< incompressible::momentumTransportModel > turbulence(incompressible::momentumTransportModel::New(U, phi, viscosity))
volScalarField & p