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/)
-   -   Why is new convection theme used is the rhoEqn ? (https://www.cfd-online.com/Forums/openfoam-programming-development/145323-why-new-convection-theme-used-rhoeqn.html)

xianqiejiao December 2, 2014 23:28

Why is new convection theme used is the rhoEqn ?
 
Hi Everyone,

While I am reading the code I got from my friend, I find following code:

Code:

tmpPhi=phi;
tmp<fv::convectionScheme<scalar> > mvConvection
(
    fv::convectionScheme<scalar>::New
    (
        mesh,
        fields,
        tmpPhi,
        mesh.divScheme("div(phi,Yh)")
    )
);

//Density equation
fvScalarMatrix rhoEqn
(
    fvm::ddt(rho) +  mvConvection->fvmDiv(tmpPhi, rho)
);

rhoEqn.solve();

It seems that this code has created a new convection themes, and apply it like
Code:

turbulence->divDevRhoReff(rho, U)
My first question is that what is the difference between this new rho equation and its original form?

And latter, the new convection theme is used again as following:

Code:

fvScalarMatrix YEqn
(
    fvm::ddt(rho,Y)
    + urho*mvConvection->fvmDiv(tmpPhi, Y)
    + fvm::laplacian(Dcoeff,Y)
);

where urho is defined as

Code:

const dimensionedScalar urho  //for tmpPhi = phi || rhoPhi
    (
        "urho",
        dimensionSet(1,-3,0,0,0,0,0),
        scalar(1.0)
    );

My second question is why the new convection theme is used again here and why do we need the "urho".

Have anyone met this before?


All times are GMT -4. The time now is 18:09.