pEqn.H
Go to the documentation of this file.
1
15{
16 volScalarField rAU(permeability/mu); //K/mu
17 surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));//rho/A on surface
18 volVectorField HbyA(U*0);
19
20 surfaceScalarField phig("phig",(fvc::interpolate(rho)*rhorAUf * g) & mesh.Sf());
21
22 surfaceScalarField phiHbyA
23 (
24 "phiHbyA",
25 phig
26 );
27 // Update the pressure BCs to ensure flux consistency
29
30 fvScalarMatrix p_rghDDtEqn
31 (
32 porosity*rho*betaT*fvm::ddt(p)
33 -porosity*rho*alphaP*fvc::ddt(T)
34 +fvc::div(phiHbyA)
35 );
36 while (pimple.correctNonOrthogonal())
37 {
38 fvScalarMatrix pEqn
39 (
40 p_rghDDtEqn - fvm::laplacian(rhorAUf, p)
41 );
42 pEqn.solve();
43 if (pimple.finalNonOrthogonalIter())
44 {
45 // option 2: using flux reconstruct velocity, magic function of reconstruct
46 phi = phiHbyA + pEqn.flux();
47 U = HbyA + rAU*fvc::reconstruct((phig + pEqn.flux())/rhorAUf);
48 U.correctBoundaryConditions();
49 }
50 }
51}
volScalarField & p
Definition: createFields.H:10
volScalarField porosity(IOobject("porosity", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), mesh, porosity0)
volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), mesh, dimensionedVector("U", dimensionSet(0, 1,-1, 0, 0, 0, 0), vector::zero))
volScalarField & T
Definition: createFields.H:12
volScalarField permeability(IOobject("permeability", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh)
surfaceScalarField phig("phig",(fvc::interpolate(rho) *rhorAUf *g) &mesh.Sf())
surfaceScalarField phiHbyA("phiHbyA", phig+MRF.zeroFilter(rhorAUf *fvc::ddtCorr(rho, U, phi, rhoUf)))
constrainPressure(p, rho, U, phiHbyA, rhorAUf, MRF)
fvScalarMatrix p_rghDDtEqn(porosity *rho *betaT *fvm::ddt(p) -porosity *rho *alphaP *fvc::ddt(T)+fvc::div(phiHbyA))
volVectorField HbyA(U *0)
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho *rAU))
mu
Definition: updateProps.H:3
alphaP
Definition: updateProps.H:5
betaT
Definition: updateProps.H:6
rho
Definition: updateProps.H:2