|
[Sponsors] |
June 7, 2016, 07:36 |
phi flux
|
#1 |
Member
Milad Setareh
Join Date: Oct 2012
Location: Tehran, Iran
Posts: 35
Rep Power: 14 |
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. |
|
June 7, 2016, 10:22 |
|
#2 |
New Member
Lorena Fernández Fernández
Join Date: May 2016
Location: Spain
Posts: 21
Rep Power: 10 |
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. |
|
June 8, 2016, 06:44 |
|
#3 | |
Member
Milad Setareh
Join Date: Oct 2012
Location: Tehran, Iran
Posts: 35
Rep Power: 14 |
Quote:
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. |
||
June 8, 2016, 07:40 |
|
#4 | |
New Member
Lorena Fernández Fernández
Join Date: May 2016
Location: Spain
Posts: 21
Rep Power: 10 |
Quote:
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(); Best regards, Lorena |
||
January 11, 2021, 06:01 |
|
#5 |
New Member
Join Date: Feb 2018
Posts: 2
Rep Power: 0 |
I know this is long overdue, but since I just stumbled on it, I'll try to answer:
As you rightly pointed out, (or 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 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); } |
|
|
|
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 08:30 |
read scalar field phi, get flux through faces | peterwy | OpenFOAM Programming & Development | 5 | April 28, 2017 20:40 |
Udf for moving heat flux in 2D cylindrical geometry | devia21 | Fluent UDF and Scheme Programming | 0 | April 20, 2015 01:27 |
Question about heat transfer coefficient setting for CFX | Anna Tian | CFX | 1 | June 16, 2013 07:28 |
mixerVesselAMI2D's mass is not balancing | sharonyue | OpenFOAM Running, Solving & CFD | 6 | June 10, 2013 10:34 |