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

interFoam and scalarTransport function object with fvOptions sources

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 12, 2017, 07:08
Question interFoam and scalarTransport function object with fvOptions sources
  #1
Member
 
Join Date: Nov 2009
Posts: 56
Rep Power: 15
fusij is on a distinguished road
Hello all,

I am trying to simulate a passive scalar transport in a water-air two phase incompressible model with OpenFOAM-dev.

I am using the scalarTransport function object, the scalarField name is "s". I have added the 0/s file with appropriate boundary conditions and as such the function object operates as expected.

I would like to add scalar sources within my domain and therefore I have defined a scalarSemiImplicitSource fvOption source where I am only using the explicit term of the source.

My problem is that OpenFOAM tells me that my source is defined but never used.
Code:
    From function virtual void Foam::fv::option::checkApplied() const
    in file cfdTools/general/fvOptions/fvOption.C at line 125
    Source s defined for field s but never used
After reading the source code of the scalarTransport function object, my impression is that the fvOptions should be defined in a subdict of system/scalarTransportDict rather than in constant/fvOptions dict. Is that a correct understanding? I have tested both but neither works.

This is my fvOptions subdict
Code:
fvOptions       
{
    s
    {
        type            scalarSemiImplicitSource;

        timeStart       0;
        duration        100;
        selectionMode   points;
        points
        (
            (0 25 0)
        );

        volumeMode      absolute;
        injectionRateSuSp
        {
            s     (1000 0); // kg/s
        }
    }

}
Has anybody here used scalarTransport function object with fvOption sources using OpenFOAM-dev? Previous posts about this topic are for older versions of OF where you defined everything in your controlDict for the function object instead of using the #includeFunc directive. As I said before, the function object operates as expected but the sources are not "active" when running the simulation.
fusij is offline   Reply With Quote

Old   June 12, 2017, 08:31
Default
  #2
Member
 
Join Date: Nov 2009
Posts: 56
Rep Power: 15
fusij is on a distinguished road
I got everything working by including everything within the controlDict under functions
Code:
functions
{

    s
    {
        type            scalarTransport;
        libs            ("libsolverFunctionObjects.so");
        resetOnStartUp  no;
        field           s;

        fvOptions
        {
            s
            {
                type            scalarSemiImplicitSource;

                timeStart       0;
                duration        100;
                active          true;
                selectionMode   points;
                points
                (
                    (0 25 0)
                );

                volumeMode      absolute;
                injectionRateSuSp
                {
                    s     (1000 0); // kg/s
                }
            }
        }
Now the problem is that the scalar moves between phases. I was thinking about adding gravity as an explicit source to the scalarField and hopefully restrain my scalar then to the heavier phase as it lies beneath the lighter phase. That could be numerically unstable, do you have any ideas regarding how to negate the movement of the scalar between phases?
fusij is offline   Reply With Quote

Old   January 13, 2019, 11:28
Default
  #3
Member
 
Join Date: Aug 2018
Posts: 47
Rep Power: 6
foamF is on a distinguished road
May I know if you manage to find the way out for the movement of the scalar between phases? I encounter the similar problem, but in interMixingFoam.
foamF is offline   Reply With Quote

Old   June 16, 2020, 15:53
Question
  #4
Member
 
Rishikesh
Join Date: Apr 2016
Posts: 62
Rep Power: 8
mrishi is on a distinguished road
Sorry for the bump, but did anyone figure out the solution to this?
I encountered this when I created a scalar transport in interfoam solver, by looking at the implementation of corresponding functionObject, but encountered the same issue. I thought it had to do with something I did mistakenly but now it seems even the functionObject based implementation suffers from this - scalar escapes into the other phase.
mrishi is offline   Reply With Quote

Old   April 18, 2022, 08:12
Default
  #5
Senior Member
 
Join Date: Mar 2010
Location: Auckland, NZ
Posts: 168
Rep Power: 15
Jonathan is on a distinguished road
For anyone looking for this answer:

You can add the following to your controlDict configuration for scalarTransport Function Object to confine to one or other of the fields in a multiphase simulation.

Quote:
// Name of phase field to constrain scalar to, default = 'none'
phase none;
Jonathan is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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



All times are GMT -4. The time now is 04:53.