CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   thermo.rho() -= psi*p_rgh in buoyantPimpleFoam (https://www.cfd-online.com/Forums/openfoam-programming-development/162478-thermo-rho-psi-p_rgh-buoyantpimplefoam.html)

wayne14 November 11, 2015 00:18

thermo.rho() -= psi*p_rgh in buoyantPimpleFoam
 
Hi everyone,

I already have a good understanding of buoyantSimpleFoam, but in the pEqn.H of buoyantPimpleFoam, the following code makes it difficult to understand the logic of the solver:
Code:

// Thermodynamic density needs to be updated by psi*d(p) after the
    // pressure solution - done in 2 parts. Part 1:
    thermo.rho() -= psi*p_rgh;

    volScalarField rAU(1.0/UEqn.A());
    surfaceScalarField rAUf("rAUf", fvc::interpolate(rho*rAU));

    volVectorField HbyA("HbyA", U);
    HbyA = rAU*UEqn.H();

    surfaceScalarField phig(-rAUf*ghf*fvc::snGrad(rho)*mesh.magSf());

Why we need thermo.rho() -= psi*p_rgh ?

Many thanks,
Yan Wang

wayne14 November 21, 2015 01:50

Quote:

Originally Posted by wayne14 (Post 572862)
Hi everyone,

I already have a good understanding of buoyantSimpleFoam, but in the pEqn.H of buoyantPimpleFoam, the following code makes it difficult to understand the logic of the solver:
Code:

// Thermodynamic density needs to be updated by psi*d(p) after the
    // pressure solution - done in 2 parts. Part 1:
    thermo.rho() -= psi*p_rgh;

    volScalarField rAU(1.0/UEqn.A());
    surfaceScalarField rAUf("rAUf", fvc::interpolate(rho*rAU));

    volVectorField HbyA("HbyA", U);
    HbyA = rAU*UEqn.H();

    surfaceScalarField phig(-rAUf*ghf*fvc::snGrad(rho)*mesh.magSf());

Why we need thermo.rho() -= psi*p_rgh ?

Many thanks,
Yan Wang


It seems that I have solved the question.


All times are GMT -4. The time now is 15:52.