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

Using scalarSemiImplicitSource with PisoFOAM

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By tomf

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 23, 2017, 05:56
Default Using scalarSemiImplicitSource with PisoFOAM
  #1
Senior Member
 
Robert
Join Date: May 2015
Location: Bremen, GER
Posts: 292
Rep Power: 12
RobertHB is on a distinguished road
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
RobertHB is offline   Reply With Quote

Old   August 24, 2017, 05:40
Default
  #2
Senior Member
 
Tom Fahner
Join Date: Mar 2009
Location: Breda, Netherlands
Posts: 647
Rep Power: 32
tomf will become famous soon enoughtomf will become famous soon enough
Send a message via MSN to tomf Send a message via Skype™ to tomf
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 and jadidi.cfd like this.
tomf is offline   Reply With Quote

Old   September 12, 2017, 06:29
Default
  #3
New Member
 
vs
Join Date: Jul 2017
Posts: 3
Rep Power: 9
vs11 is on a distinguished road
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
vs11 is offline   Reply With Quote

Old   September 12, 2017, 06:33
Default
  #4
Senior Member
 
Tom Fahner
Join Date: Mar 2009
Location: Breda, Netherlands
Posts: 647
Rep Power: 32
tomf will become famous soon enoughtomf will become famous soon enough
Send a message via MSN to tomf Send a message via Skype™ to tomf
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
tomf is offline   Reply With Quote

Old   September 12, 2017, 06:36
Default
  #5
New Member
 
vs
Join Date: Jul 2017
Posts: 3
Rep Power: 9
vs11 is on a distinguished road
Thanks Tom for your quick reply! I will try it out now.
vs11 is offline   Reply With Quote

Old   December 1, 2017, 07:23
Default
  #6
Senior Member
 
Robert
Join Date: May 2015
Location: Bremen, GER
Posts: 292
Rep Power: 12
RobertHB is on a distinguished road
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?

Last edited by RobertHB; December 1, 2017 at 09:51.
RobertHB is offline   Reply With Quote

Old   February 7, 2018, 05:34
Default
  #7
Senior Member
 
Robert
Join Date: May 2015
Location: Bremen, GER
Posts: 292
Rep Power: 12
RobertHB is on a distinguished road
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}?

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.
RobertHB is offline   Reply With Quote

Old   July 30, 2019, 14:47
Default
  #8
Member
 
James
Join Date: Jan 2014
Posts: 38
Rep Power: 12
Madeinspace is on a distinguished road
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 is offline   Reply With Quote

Old   July 30, 2019, 15:27
Default
  #9
Member
 
James
Join Date: Jan 2014
Posts: 38
Rep Power: 12
Madeinspace is on a distinguished road
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 //


            }
        }
    }
}
Madeinspace is offline   Reply With Quote

Old   July 31, 2019, 04:24
Default
  #10
Senior Member
 
Robert
Join Date: May 2015
Location: Bremen, GER
Posts: 292
Rep Power: 12
RobertHB is on a distinguished road
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.
__________________
If you liked my answer to your question, please consider leaving a "Like" in return
RobertHB 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
Differences in solution method for pisoFoam and buoyantBoussinesqPisoFoam mchurchf OpenFOAM 7 August 6, 2023 10:12
uRANS - laminar simulation using pisoFoam cyln OpenFOAM 1 July 15, 2017 19:28
How can I get stedaystate solution from pisoFoam? mykkujinu2201 OpenFOAM Running, Solving & CFD 1 December 8, 2015 08:37
pisoFoam, pimpleFoam - Fluent user's questions RodriguezFatz OpenFOAM Running, Solving & CFD 0 September 4, 2013 05:26
pisoFoam compiling error with OF 1.7.1 on MAC OSX Greg Givogue OpenFOAM Programming & Development 3 March 4, 2011 18:18


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