UEqns.H
Go to the documentation of this file.
1 #include "MRFCorrectBCs.H"
2 
3 PtrList<fvVectorMatrix> UEqns(fluid.phases().size());
4 autoPtr<multiphaseSystem::dragCoeffFields> dragCoeffs(fluid.dragCoeffs());
5 
6 label phasei = 0;
7 for (phaseModel& phase : fluid.phases())
8 {
9  const volScalarField& alpha = phase;
10  volVectorField& U = phase.U();
11 
12  volScalarField nuEff(turbulence->nut() + phase.nu());
13 
14  UEqns.set
15  (
16  phasei,
17  new fvVectorMatrix
18  (
19  fvm::ddt(alpha, U)
20  + fvm::div(phase.alphaPhi(), U)
21 
22  + (alpha/phase.rho())*fluid.Cvm(phase)*
23  (
24  fvm::ddt(U)
25  + fvm::div(phase.phi(), U)
26  - fvm::Sp(fvc::div(phase.phi()), U)
27  )
28 
29  - fvm::laplacian(alpha*nuEff, U)
30  - fvc::div
31  (
32  alpha*(nuEff*dev(T(fvc::grad(U))) /*- ((2.0/3.0)*I)*k*/),
33  "div(Rc)"
34  )
35  ==
36  //- fvm::Sp(fluid.dragCoeff(phase, dragCoeffs())/phase.rho(), U)
37  //- (alpha*phase.rho())*fluid.lift(phase)
38  //+
39  (alpha/phase.rho())*fluid.Svm(phase)
40  - fvm::Sp
41  (
42  slamDampCoeff
43  *max
44  (
45  mag(U()) - maxSlamVelocity,
47  )
48  /cbrt(mesh.V()),
49  U
50  )
51  )
52  );
53  MRF.addAcceleration
54  (
55  alpha*(1 + (1/phase.rho())*fluid.Cvm(phase)),
56  UEqns[phasei]
57  );
58  //UEqns[phasei].relax();
59 
60  ++phasei;
61 }
twoPhaseSystem & fluid
label phasei
Definition: UEqns.H:6
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:40
tmp< GeometricField< Type, faPatchField, areaMesh > > div(const GeometricField< Type, faePatchField, edgeMesh > &ssf)
Definition: facDiv.C:43
autoPtr< multiphaseSystem::dragCoeffFields > dragCoeffs(fluid.dragCoeffs())
tmp< GeometricField< Type, faPatchField, areaMesh > > ddt(const dimensioned< Type > dt, const faMesh &mesh)
Definition: facDdt.C:40
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:82
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:81
dynamicFvMesh & mesh
dimensionedSymmTensor dev(const dimensionedSymmTensor &dt)
IOMRFZoneList & MRF
tmp< GeometricField< Type, faPatchField, areaMesh > > laplacian(const GeometricField< Type, faPatchField, areaMesh > &vf, const word &name)
Definition: facLaplacian.C:40
dimensionedScalar cbrt(const dimensionedScalar &ds)
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("pos", dimless, 1.0));surfaceScalarField neg(IOobject("neg", runTime.timeName(), mesh), mesh, dimensionedScalar("neg", dimless, -1.0));surfaceScalarField phi("phi", fvc::flux(rhoU));Info<< "Creating turbulence model\"<< endl;autoPtr< compressible::turbulenceModel > turbulence(compressible::turbulenceModel::New(rho, U, phi, thermo))
Definition: createFields.H:94
const volScalarField & T
U
Definition: pEqn.H:72
PtrList< fvVectorMatrix > UEqns(fluid.phases().size())
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
fvMatrix< vector > fvVectorMatrix
Definition: fvMatricesFwd.H:40
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
tmp< GeometricField< typename outerProduct< vector, Type >::type, faPatchField, areaMesh >> grad(const GeometricField< Type, faePatchField, edgeMesh > &ssf)
Definition: facGrad.C:51
zeroField Sp
Definition: alphaSuSp.H:2
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:127
const dimensionSet dimVelocity