CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   Implementation of div, laplacian, etc and variables (http://www.cfd-online.com/Forums/openfoam/66479-implementation-div-laplacian-etc-variables.html)

sven July 16, 2009 12:07

Implementation of div, laplacian, etc and variables
 
Hi everyone,

I want to edit the LaunderGibson RSTM provided with the normal OpenFOAM distribution. Before I can do this, I first need to understand the originally implemented model. For doing this I need to know where exactly, that is in which file of the OpenFOAM package the functions div, laplacian, etc are defined. Does anyone know in which file these are defined?
Furthermore, how can I figure out where variables like U or R are defined in OpenFOAM (that is again, in which file)?
Thanks for your help!

henrik July 18, 2009 06:52

Dear Sven,

Quote:

Before I can do this, I first need to understand the originally implemented model. For doing this
Don't think so ;)

Quote:

I need to know where exactly, that is in which file of the OpenFOAM package the functions div, laplacian, etc are defined. Does anyone know in which file these are defined?
The functions that you use on the top-level are defined in:

$FOAM_SRC/finiteVolume/lnInclude/fvmDiv.H
$FOAM_SRC/finiteVolume/lnInclude/fvmLaplacian.H

and so forth

The upwind-scheme, for example, is defined in line 132 of

$FOAM_SRC/finiteVolume/lnInclude/upwind.H

Quote:

Furthermore, how can I figure out where variables like U or R are defined in OpenFOAM (that is again, in which file)?
$FOAM_SRC/turbulenceModels/RAS/incompressible/LaunderGibsonRSTM/LaunderGibsonRSTM.H (line 100)

$FOAM_SOLVERS/incompressible/turbFoam/createFields.H (lines 15-27)

Hope this helps,

Henrik

sven July 19, 2009 15:31

First of all thanks for the reply. I scanned through the files you mentioned and I could find all of the definitions and all the variables I was looking for. But I want to see of what kind the variables are (array with size, scalar, etc.). I think this is defined by words like "volVectorField", so I guess there must be another file in which this volVectorField is defined. Is this correct? and if so, where can I find this file? Thanks a lot!

henrik July 19, 2009 18:18

Dear Sven,

R is instantiated in LaunderGibsonRSTM.C:

Code:

R_
(
    IOobject
    (
        "R",
        runTime_.timeName(),
        mesh_,
        IOobject::MUST_READ,
        IOobject::AUTO_WRITE
    ),
    mesh_
),

and U is instantiated in createFieds.H. As you can see, both files are read from disk and that is where all the information (values, dimensions, boundary conditions, etc.) is coming from.

Henrik


All times are GMT -4. The time now is 06:54.