db7fac3f24
git-svn-id: https://openfoam-extend.svn.sourceforge.net/svnroot/openfoam-extend/trunk/Core/OpenFOAM-1.5-dev@1731 e4e07f05-0c2f-0410-a05a-b8ba57e0c909
31 lines
768 B
C
31 lines
768 B
C
{
|
|
tmp<fv::convectionScheme<scalar> > divRho
|
|
(
|
|
fv::convectionScheme<scalar>::New
|
|
(
|
|
mesh,
|
|
phi,
|
|
mesh.divScheme("div(phi,rho)")
|
|
)
|
|
);
|
|
|
|
solve
|
|
(
|
|
fvm::ddt(rho)
|
|
+ divRho->fvmDiv(phi, rho)
|
|
);
|
|
|
|
rhoPhi = divRho->flux(phi, rho);
|
|
|
|
Info<< "rho: " << max(rho).value() << tab << min(rho).value() << tab
|
|
<< "p:" << max(p).value() << tab << min(p).value() << endl;
|
|
|
|
volScalarField rhog = max(p*psig, 0.1*rhogSat);
|
|
volScalarField rhol = rholSat + (p - pSat)*psil;
|
|
|
|
gamma = min(max((rhol - rho)/(rhol - rhog), scalar(0)), scalar(1));
|
|
|
|
psiByRho =
|
|
(gamma*rhog + (scalar(1) - gamma)*rhol)
|
|
*(gamma*psig/rhog + (scalar(1) - gamma)*psil/rhol)/rho;
|
|
}
|