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

How to create new incompressible Phi

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By bijan darbari

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 20, 2019, 11:37
Default How to create new incompressible Phi
  #1
Member
 
Bijan Darbari
Join Date: Nov 2015
Posts: 48
Rep Power: 10
bijan darbari is on a distinguished road
Hello


I want to calculate new incompressible face flux "phi" based on a different velocity ( named "Ve" ) and use this flux in solving a special equation.


So I make a new file "CreatePhie.H" in the solver folder and called it in "createfields.H":


Code:
surfaceScalarField phie
(
    IOobject
    (
        "phie",
        runTime.timeName(),
        mesh,
        IOobject::READ_IF_PRESENT,
        IOobject::AUTO_WRITE
    ),
    linearInterpolate(Ve) & mesh.Sf()
 );

Code:
#include "createPhi.H"
#include "createPhie.H"

but the results are incorrect!!


for testing, I defined "phie" based on velociy "U":
Code:
linearInterpolate(U) & mesh.Sf()
but the results are much different from that solved by "phi".


What's the problem?? and what's the way for definition new flux "phie"??
openfoam_aero likes this.
bijan darbari is offline   Reply With Quote

Old   June 6, 2022, 06:43
Default
  #2
Member
 
Uttam
Join Date: May 2020
Location: Southampton, United Kingdom
Posts: 34
Rep Power: 5
openfoam_aero is on a distinguished road
Quote:
Originally Posted by bijan darbari View Post
Hello


I want to calculate new incompressible face flux "phi" based on a different velocity ( named "Ve" ) and use this flux in solving a special equation.


So I make a new file "CreatePhie.H" in the solver folder and called it in "createfields.H":


Code:
surfaceScalarField phie
(
    IOobject
    (
        "phie",
        runTime.timeName(),
        mesh,
        IOobject::READ_IF_PRESENT,
        IOobject::AUTO_WRITE
    ),
    linearInterpolate(Ve) & mesh.Sf()
 );

Code:
#include "createPhi.H"
#include "createPhie.H"

but the results are incorrect!!


for testing, I defined "phie" based on velociy "U":
Code:
linearInterpolate(U) & mesh.Sf()
but the results are much different from that solved by "phi".


What's the problem?? and what's the way for definition new flux "phie"??
Where have you created the createPhie.H file? It should be in the new solver directory which is different from the directory of the library (~/OpenFOAM/src/finiteVolume/lnInclude/). If you create your createPhie.H in this directory, then it will change the existing directory file createPhi.H which contains the flux calculation based on the velocity U.
So copy the file to the directory of your new solver, change the name and then compile.

Another thing is that you should not change the object identifier "phi" to something of your choice. The reason is that phi is used later in continuityErrors.H to calculate the local and global continuity errors. Keep phi as it is (and do not change it to "phie") in createPhie.H and then try recompiling. This way, both files createPhi.H and createPhie.H will be run by the pre-processor directive and the fluxes will be processed separately by the continuityErrors.H header file.
openfoam_aero 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
[OpenFOAM.org] OpenFOAM build on Intel Xeon Phi asaijo OpenFOAM Installation 31 July 26, 2017 10:35
Summing phi over all faces in patch NewtoFOAM OpenFOAM Programming & Development 2 May 8, 2013 05:37
Recreation of phi file, icoFoam Madeleine P. Vincent OpenFOAM Running, Solving & CFD 0 May 7, 2012 11:17
Actuator disk model audrich FLUENT 0 September 21, 2009 07:06
Where's the singularity/mesh flaw? audrich FLUENT 3 August 4, 2009 01:07


All times are GMT -4. The time now is 11:20.