CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Adding line source term for scalar transport by fvOptions (https://www.cfd-online.com/Forums/openfoam-solving/152947-adding-line-source-term-scalar-transport-fvoptions.html)

wayne14 May 13, 2015 05:29

Adding line source term for scalar transport by fvOptions
 
Hi,

I have been trying to add a line source on the ground for scalar transport by fvOptions. My idea is to approximate the line source by a narrow area source. So I extract a faceSet from the lowerWall (the ground boundary) as follows:

Code:

actions
(
    {
        name    f0; //http://openfoamwiki.net/index.php/TopoSet
        type    faceSet;
        action  new;
        source  patchToFace;
        sourceInfo
        {
            name lowerWall;
        }
    }
    {
        name    f0;
        type    faceSet;  //2D
        action  subset;
        source  boxToFace;
        sourceInfo
        {
            boxes ((1.1076 0 0.4)(1.122 0 1.6)  (1.158 0 0.4)(1.1724 0 1.6));
        }
    }
);

And then I set the source strength in the fvOptions dictionary as follows:

Code:

scalarTracer //name
    {
        type            scalarSemiImplicitSource;
        active          true;
        selectionMode  all;  // all, cellSet, points, cellZone 
        cellSet      f0;//TSsourceCells;

       
        scalarSemiImplicitSourceCoeffs
        {
            volumeMode      specific; // absolute <quantity>; specific <quantity>/m^3
            injectionRateSuSp
            {
                TS      (0.2936 0); //kg/m^3/s  0.01/0.0340557
            }
        }
    }

My code runs well, but there is some important thing that confuses me:
My total source strength is 0.01 kg/s, the area of f0 is 0.0340557 m^2. Is it right to set TS as 0.01/0.0340557 with the volumeMode being 'specific' ?

By the way, if there is better ideas for a line source term, please tell me too.

Thank you!
Wayne

AbdelkaderDZ November 9, 2015 07:08

Re:Adding line source term for scalar transport by fvOptions
 
Dear wayne14,
I have the same problem, Have sresolved the your's? Please I need help
Kader

wayne14 November 9, 2015 09:12

Quote:

Originally Posted by AbdelkaderDZ (Post 572593)
Dear wayne14,
I have the same problem, Have sresolved the your's? Please I need help
Kader

Hi Korichi Abdelkader,

Yes, I have solved the problem.
But I need a little time to explain what I do, just let you know I will answer it.

Best wishes,
Yan Wang

wayne14 November 9, 2015 09:23

The idea mentioned in my previous post is somewhat strange, the more comfortable way to implement a line source (or whatever shape) is to have a suitable mesh, which matches exactly (or approximately) with the shape of your source term.

Here I will give three steps for the problem:

1. Pay attention to the source shape when you generate the mesh. Make the mesh matches with your source term.
2. Use topoSetDict to 'mark' all the cells the belong to your source term. Here is what I do:
Code:

actions
(

    {
        name    f0;
        type    cellSet; 
        action  new;
        source  boxToCell;
        sourceInfo
        {
          box (0.29286 -0.06 0)(0.30714 -0.057 0.03);
        }
    }
  {
        name    f0;
        type    cellZoneSet;
        action  new;
        source  setToCellZone;
        sourceInfo
        {
            set f0;          // name of the cellSet
        }
    }
);

3. Use fvOptions to set the intensity of your source term, like the following:
Code:

FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    location    "system";
    object      fvOptions;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
    scalarTracer //name
    {
        type            scalarSemiImplicitSource;
        active          true;
        selectionMode  cellZone;  // all, cellSet, points, cellZone
        cellZone      f0;//sourceCells;
       
        scalarSemiImplicitSourceCoeffs
        {
            volumeMode      absolute; // absolute <quantity>; specific <quantity>/m^3
            injectionRateSuSp
            {
                TS      (10 0); //kg/s 
            }
        }
    }

Hope it helpful,

Regards,
Yan Wang

AbdelkaderDZ November 9, 2015 10:03

Re:Adding line source term for scalar transport by fvOptions
 
Thank you Yan,
I will try it.
Kader

AbdelkaderDZ November 9, 2015 10:47

Re:Adding line source term for scalar transport by fvOptions
 
Hi Yan,
I have tried, I have error when excuting topset, I have 0 point new.
Thanks

wayne14 November 9, 2015 20:27

Quote:

Originally Posted by AbdelkaderDZ (Post 572633)
Hi Yan,
I have tried, I have error when excuting topset, I have 0 point new.
Thanks

Hi Kader,

Hope I am not having your name wrong.

When using topoSet, It's very important to make sure that the sourceInfo has been specified correctly.

For the below example, the centroid of all the cells belonging to the source term are within the 'box' region specified by vertex coordinates. Otherwise, no new cellZone will be generated.

Code:

  sourceInfo
        {
          box (0.29286 -0.06 0)(0.30714 -0.057 0.03);
        }

By the way, posting your error information may be helpful:)

Regards,
Yan Wang

AbdelkaderDZ November 17, 2015 09:28

Re:Adding line source term for scalar transport by fvOptions
 
It works, thank you

hiuluom June 25, 2019 10:33

Quote:

Originally Posted by wayne14 (Post 572617)
Code:

TS      (10 0); //kg/s

I would like to ask does the scalar transport have unit kg/s?


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