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/)
-   -   compressibleInterFoam (https://www.cfd-online.com/Forums/openfoam-programming-development/137925-compressibleinterfoam.html)

Sun June 25, 2014 10:45

compressibleInterFoam
 
Hi,
I am going through the compressibleInterFoam solver (VOf for 2 compressible, isothermal immiscible fluids). In the sub-cycling of the alpha equation (alphaEqnsSubCycle.H) there is this line of code:

Code:

volScalarField divU(fvc::div(fvc::absolute(phi, U)));
I cannot figure out what this line does. Any explanations or helps would be really appreciated.
Thanks.
Cheers!

Sun June 26, 2014 02:25

As far as I understand, it returns the given relative flux in absolute form. And i think this is how it does it. (fvcMeshPhi.C from line 151 to 183)

Code:

Foam::tmp<Foam::surfaceScalarField> Foam::fvc::absolute
 (
    const tmp<surfaceScalarField>& tphi,
    const volVectorField& U
)
{
    if (tphi().mesh().moving())
    {
        return tphi + fvc::meshPhi(U);
    }
    else
    {
        return tmp<surfaceScalarField>(tphi, true);
      }
  }
 
 
  Foam::tmp<Foam::surfaceScalarField> Foam::fvc::absolute
  (
      const tmp<surfaceScalarField>& tphi,
      const volScalarField& rho,
      const volVectorField& U
  )
  {
      if (tphi().mesh().moving())
      {
          return tphi + fvc::interpolate(rho)*fvc::meshPhi(rho, U);
      }
      else
      {
          return tmp<surfaceScalarField>(tphi, true);
      }
  }


I still don't know, though, why we need it for the alpha sub-cycling?


All times are GMT -4. The time now is 00:03.