CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

phi flux

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Lorena2fdez

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 7, 2016, 06:36
Default phi flux
  #1
Member
 
Milad Setareh
Join Date: Oct 2012
Location: Tehran, Iran
Posts: 35
Rep Power: 13
milad653279 is on a distinguished road
Dear foamer

I am confused about phi in openfoam. as you know, convection term in incompressible Navier-Stokes is div(UU). in openfoam is writen by div (phi,U) which phi= interpolate (U) & mesh.sf(). why does phi product mesh.sf()???!!! I think that phi must be U (phi=U) NOT phi=U*sf(). please help me at it.
milad653279 is offline   Reply With Quote

Old   June 7, 2016, 09:22
Default
  #2
New Member
 
Lorena Fernández Fernández
Join Date: May 2016
Location: Spain
Posts: 21
Rep Power: 9
Lorena2fdez is on a distinguished road
Hi Milad,

In openFoam you use
div ( psi , phi )
where
psi is an explicit SurfaceScalarField
phi is an implicit Vol<type>Field

fvc::interpolate() or fvm:interpolate(): generates a face flux field (surfaceScalarField) from a cell based volumetric field (volScalarField).
mesh.Sf(): return the face area magnitude of a face flux field (surfaceScalarField).

For your case U is a volScalarField and phi is its respective surfaceScalarField.

Best regards,
Lorena.
lpz456 likes this.
Lorena2fdez is offline   Reply With Quote

Old   June 8, 2016, 05:44
Default
  #3
Member
 
Milad Setareh
Join Date: Oct 2012
Location: Tehran, Iran
Posts: 35
Rep Power: 13
milad653279 is on a distinguished road
Quote:
Originally Posted by Lorena2fdez View Post
Hi Milad,

In openFoam you use
div ( psi , phi )
where
psi is an explicit SurfaceScalarField
phi is an implicit Vol<type>Field

fvc::interpolate() or fvm:interpolate(): generates a face flux field (surfaceScalarField) from a cell based volumetric field (volScalarField).
mesh.Sf(): return the face area magnitude of a face flux field (surfaceScalarField).

For your case U is a volScalarField and phi is its respective surfaceScalarField.

Best regards,
Lorena.

Dear Lorena
OF integrates momentum equation over a cell, I think if phi is (phi=interpolate (U) & mesh.sf()) is wrong because the value of surface area is product twice into equation. once in phi and other time when OF integrates from equation.
milad653279 is offline   Reply With Quote

Old   June 8, 2016, 06:40
Default
  #4
New Member
 
Lorena Fernández Fernández
Join Date: May 2016
Location: Spain
Posts: 21
Rep Power: 9
Lorena2fdez is on a distinguished road
Quote:
Originally Posted by milad653279 View Post
Dear Lorena
OF integrates momentum equation over a cell, I think if phi is (phi=interpolate (U) & mesh.sf()) is wrong because the value of surface area is product twice into equation. once in phi and other time when OF integrates from equation.
Probably the solver is thinking for don't make twice the product into equation. When the solver integrates the equation if it has a SurfaceScalarField, It won't make the product by value of surface area, again.

Maybe it help you, in a manual about OpenFOAM I saw a description of phi used for solve the Navier-Stokes equations:
In OpenFOAM, it's common that phi is the flux of velocity u . Other times, phi represents the flux of rho*u.

I saw the code of different solver in OpenFOAM and it's usual to do that product when it interpolate a field. For example (in KinematicSingleLayer.C):
Code:
... fvc::interpolate(rho_*gTan()) & regionMesh().Sf() ...
phiAdd += fvc::interpolate(pp) * fvc::snGrad(delta_) * regionMesh().magSf();
phi_ = fvc::interpolate(deltaRho_*U_) & regionMesh().Sf();
I don't know more about this subject but it's really strange a fail like that in the code.

Best regards,
Lorena
Lorena2fdez is offline   Reply With Quote

Old   January 11, 2021, 05:01
Default
  #5
New Member
 
Join Date: Feb 2018
Posts: 2
Rep Power: 0
turbulo is on a distinguished road
I know this is long overdue, but since I just stumbled on it, I'll try to answer:

As you rightly pointed out, \phi = \mathbf{U} \cdot \mathbf{S}_f (or \phi = \rho \mathbf{U} \cdot \mathbf{S}_f depending on the solver), but, for instance, if you look at fvmDiv in gaussConvectionScheme.C you'll see that OpenFOAM doesn't compute the integral of the divergence itself, but constructs a coefficients matrix (an fvMatrix in OF parlance) from phi and the velocity simply by multiplying them, there is no extra \mathbf{S}_f involved. I'll let you see for yourself (gaussConvectionScheme.C):

Code:
    forAll(vf.boundaryField(), patchi)
    {
        const fvPatchField<Type>& psf = vf.boundaryField()[patchi];
        const fvsPatchScalarField& patchFlux = faceFlux.boundaryField()[patchi];
        const fvsPatchScalarField& pw = weights.boundaryField()[patchi];

        fvm.internalCoeffs()[patchi] = patchFlux*psf.valueInternalCoeffs(pw);
        fvm.boundaryCoeffs()[patchi] = -patchFlux*psf.valueBoundaryCoeffs(pw);
    }
turbulo is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Radiation in semi-transparent media with surface-to-surface model? mpeppels CFX 11 August 22, 2019 07:30
read scalar field phi, get flux through faces peterwy OpenFOAM Programming & Development 5 April 28, 2017 19:40
Udf for moving heat flux in 2D cylindrical geometry devia21 Fluent UDF and Scheme Programming 0 April 20, 2015 00:27
Question about heat transfer coefficient setting for CFX Anna Tian CFX 1 June 16, 2013 06:28
mixerVesselAMI2D's mass is not balancing sharonyue OpenFOAM Running, Solving & CFD 6 June 10, 2013 09:34


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