CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Doubt in scalarTransportFoam... (http://www.cfd-online.com/Forums/openfoam-solving/119794-doubt-scalartransportfoam.html)

AB08 June 25, 2013 07:03

Doubt in scalarTransportFoam...
 
Hi I m new to OpenFoam nd need sm help........
What is the function of fvOptions in the following??



#include "fvCFD.H"
#include "fvIOoptionList.H"
#include "simpleControl.H"

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

int main(int argc, char *argv[])
{
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createFields.H"
#include "createFvOptions.H"

simpleControl simple(mesh);

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

Info<< "\nCalculating scalar transport\n" << endl;

#include "CourantNo.H"

while (simple.loop())
{
Info<< "Time = " << runTime.timeName() << nl << endl;

while (simple.correctNonOrthogonal())
{
solve
(
fvm::ddt(T)
+ fvm::div(phi, T)
- fvm::laplacian(DT, T)
==
fvOptions(T)
);
}

runTime.write();
}

Info<< "End\n" << endl;

return 0;
}

Hiroshiman June 25, 2013 10:59

Hi,
fvOptions is a new feature of OF2.2.0 :
http://www.openfoam.org/version2.2.0/fvOptions.php

Here it contains the source term of the scalar transport equation.

AB08 June 25, 2013 16:16

ok... thnx Hiroshiman :)

bbmorales August 13, 2013 05:40

Hello, colleagues

As of OF 2.2.0, the source term of scalarTransportFoam can be described in the file fvControl, due the code lines

solve
(
fvm::ddt(T)
+ fvm::div(phi, T)
- fvm::laplacian(DT, T)
==
fvOptions(T)
);

My question is:

Using fvOptions, how to build a point source term?

I wasn't able to find documentation or examples of it.
I don't even know which optin of fvOptions to use.

Where can I find do documentation on this?

Many thanks

bbmorales October 8, 2013 05:19

[SOLUTION]

https://github.com/OpenFOAM/OpenFOAM...stem/fvOptions - you can see some examples here

to define a source point, add these lines in the fvOption file.

Code:

scalarTracer                          //this is only the name of the object, can be anything
{
  type                      scalarSemiImplicitSource;                             
  active                    true;    //turns on and off the source
  timeStart                0;        //starting time
  duration                  1;        //duration in seconds
  selectionMode            points;  //it could be also a cellZone
  points                            //list of coordinates of the source terms
  (
      (0.1 0 0)
  );

  scalarSemiImplicitSourceCoeffs
  {
      volumeMode            absolute;  //    - absolute: values are given as \<quantity\> specific: values are given as \<quantity\>/m3
      injectionRateSuSp                // just a name
      {
        T                  (0.01 0);  // T - scalar variable. First value = S_u (explicit source term); Second value = S_p.
      }
    }
}

Cheers

Hiroshiman October 8, 2013 07:41

Hi,
thank you for sharing, that can be useful.

Regards.


All times are GMT -4. The time now is 17:25.