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/)
-   -   Using scalarSemiImplicitSource with PisoFOAM (https://www.cfd-online.com/Forums/openfoam-solving/191877-using-scalarsemiimplicitsource-pisofoam.html)

RobertHB August 23, 2017 04:56

Using scalarSemiImplicitSource with PisoFOAM
 
Dear all,
i've managed to add a scalarTransport solver to my pisoFOAM simulation using the #includeFunc scalarTransport command.
This works fine as long as i have an inlet and can define an inlet condition for my scalar value s.

Now, for further simulations using cyclic boundaries, i want to implement a scalar source within my domain using the fvOptions dict and the scalarSemiImplicitSource entry. Following the approach taken in multiple thread here in the forum i added the following part to my fvOptions dict.

Code:

Tracer
{
    type            scalarSemiImplicitSource;
    active          true; //using yes doesn't change anything

    scalarSemiImplicitSourceCoeffs
    {
        selectionMode  points;
        volumeMode        absolute;
        points           
        (
            (32 29.1 0.5)
            (32 29.1 1)
            (32 29.1 1.5)
        );
       
        injectionRateSuSp
        {
            s  (1.0 0);
        }
    }
}

And the next line to my controlDict
Code:

libs 
(
      "libutilityFunctionObjects.so"
);

The entry is debugged to the point where the solver starts running, but it does not use the above defined scalar source. The following error is printed:

Quote:

--> FOAM Warning :
From function virtual void Foam::fv:: option::checkApplied() const
in file cfdTools/general/fvOptions/fvOption.C at line 118
Source Tracer defined for field s but never used
--> FOAM Warning :
From function virtual void Foam::fv:: option::checkApplied() const
in file cfdTools/general/fvOptions/fvOption.C at line 118
Source Tracer defined for field s but never used
So, the question is: Where did i make a mistake? Something seems to be wrong here.

PS: OpenFOAM 4.1 on Ubuntu 16.04 LTS

tomf August 24, 2017 04:40

Hi,

Just a quick response, but I think your scalar would be called Tracer, so I think you need to do this:

Code:

        injectionRateSuSp
        {
            Tracer  (1.0 0);
        }

Regards,
Tom

vs11 September 12, 2017 05:29

Hi Tom,

I have a similar question regarding fvOptions, I want to add source to the entire domain so i have set the selectionMode to "all". So, do i need to set explicitly the cellSet or cellZone or i can just comment it out like i have done here:

src
{
type scalarSemiImplicitSource;
active true;

scalarSemiImplicitSourceCoeffs
{
selectionMode all; // all, cellSet, cellZone, points
//cellSet c1;
volumeMode specific; // absolute;
injectionRateSuSp
{
src (1 0);
}
}
}

Best,
vaibhav

tomf September 12, 2017 05:33

Hi vaibhav,

I would suggest you try it first and if it does not work you can provide the error message so we can do debugging, but it seems unnecessary to give a cellZone or cellSet is you use the entire domain.

Regards,
Tom

vs11 September 12, 2017 05:36

Thanks Tom for your quick reply! I will try it out now.

RobertHB December 1, 2017 06:23

Hey Foamers,
i managed to include a scalar source term in my fvOptions using scalarSemiImplicitSource. But the scalar added by the source is unbounded. While any other inlet method (fixedValue, setFields) nicely bounds between 0 and 1, the scalar source exceeds the upper bound.

Any idea why that is?

RobertHB February 7, 2018 04:34

Please ignore the post #6. Obviously by adding a source, you add to the scalar field.

Coming back to the implemented linear equation S(x)=S_u+S_p*x where S_u ist the constant part and S_p modifying the scalar field x. If x is the present field/cell value or the weighted average of all neigbour cells (Pantakar, 1980), why is it that the only equation the fits to the sim. results is S(x)=S_u+S_p*\frac{x}{1.75}?
https://photos-3.dropbox.com/t/2/AAB...32&size_mode=5
The simulation shown above does not contain any transport. Neither diffusion nor advection. It simply shows the accumulation of the scalar quantity in one cell.
https://www.dropbox.com/s/2rtpm4y6pjh6psr/cddt.PNG

Madeinspace July 30, 2019 13:47

Hi Robert,

I did something very similar to add mass source term in interFoam. Simulation run fine but I don't see any sourcer term being added in the computation. Could you kindly look where I might have wronged. The fvOptions code is as:


injector1
{
timeStart 0.1;
duration 0.5;
selectionMode points;
points
(
(0.1 0.35 0.0)
);
}

options
{
massSource1
{
type scalarSemiImplicitSource;
active true;

scalarSemiImplicitSourceCoeffs
{
$injector1;

volumeMode absolute; //org
injectionRateSuSp
{

rho.water (1.0 0); // kg/s //didn't work


}
}
}
}

Madeinspace July 30, 2019 14:27

Hi Robert,

I did something very similar to add mass source term in interFoam. Simulation run fine but I don't see any source term being added in the computational domain when viewing in paraFoam. Could you kindly look where I might have wronged. The fvOptions code is as:


Code:

injector1
{
    timeStart      0.1;
    duration        0.5;
    selectionMode  points;
    points
    (
        (0.1 0.35 0.0)
    );
}

options
{
    massSource1
    {
        type            scalarSemiImplicitSource;
    active          true; //added from forum
       
        scalarSemiImplicitSourceCoeffs
        {
            $injector1;

            volumeMode          absolute;
            injectionRateSuSp
            {

                  rho.water      (1.0 0); // kg/s //


            }
        }
    }
}


RobertHB July 31, 2019 03:24

As a quick guess i'd say the options { } is not needed. Then your timing from injector1 should go into massSource1 {... in here ...}, whereas selectionMode and points should go into scalarSemiImplicitSourceCoeffs {... in here ...}.


Here is my working source (without timing):
Code:

scalarSource
{
    type scalarSemiImplicitSource;
    active true;

    scalarSemiImplicitSourceCoeffs
    {
        volumeMode    specific;
        selectionMode cellSet;
        cellSet c0;

        injectionRateSuSp
        {
            T (1 0);
        }

    }
 }


and here (LINK) is an OpenFOAM 7.0 example on implementing a timer. See if it helps.


All times are GMT -4. The time now is 14:52.