CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Post-Processing

scalarTransport

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 23, 2016, 10:51
Default scalarTransport
  #1
pez
New Member
 
Join Date: Feb 2016
Posts: 4
Rep Power: 10
pez is on a distinguished road
Hello all,

I'm trying to use a scalarTransport Function Object to track the concentration of particles leaving a water tank, but I keep getting errors. I'm using openFoam 3.0. In my controlDict, I've tried two approaches:

Code:
libs  (
      "libutilityFunctionObjects.so"
      );

functions
{
S
      {
          type            scalarTransport;
          outputControl   outputTime;
          resetOnStartUp  false;
          autoSchemes     true;
          fvOptions
          {
               S-01
               {
               type            scalarExplicitSetValue;
               active          true;
               selectionMode   cellZone;
               cellZone        sampleInlet;

               scalarExplicitSetValueCoeffs
                   {
                       injectionRate
                       {
                           U   1.0;
                       }
                   }
               }
          };
      }
}
I get the following error in log.pisoFoam:
--> FOAM FATAL IO ERROR:
keyword selectionMode is undefined in dictionary "IOstream.functions.S.fvOptions.S-01.scalarExplicitSetValueCoeffs"

The other approach I tried in ControlDict was this:

Code:
functions
{
  S
    {
        type            scalarTransport;
        functionObjectLibs ("libutilityFunctionObjects.so");
          enabled     true;
          outputControl   outputTime;
          setFormat       csv;
          write interval  1;
        resetOnStartUp  false;
        autoSchemes     true;
        write         true;
          log        true;

    DT 10e-9;
    fvOptions {};

    #includeEtc "caseDicts/postProcessing/scalarTransport/scalarTransportDict.cfg"
    }
}
With this approach, there's no errors, but there's no scalarTransport output in log.pisoFoam:

scalarTransport output:
smoothSolver: Solving for S, Initial residual = 0, Final residual = 0, No Iterations 0

my constant/transportProperties file looks like this:

Code:
transportModel  Newtonian;

nu              nu [ 0 2 -1 0 0 0 0 ] 1e-05;

CrossPowerLawCoeffs
{
    nu0             nu0 [ 0 2 -1 0 0 0 0 ] 1e-06;
    nuInf           nuInf [ 0 2 -1 0 0 0 0 ] 1e-06;
    m               m [ 0 0 1 0 0 0 0 ] 1;
    n               n [ 0 0 0 0 0 0 0 ] 1;
}

BirdCarreauCoeffs
{
    nu0             nu0 [ 0 2 -1 0 0 0 0 ] 1e-06;
    nuInf           nuInf [ 0 2 -1 0 0 0 0 ] 1e-06;
    k               k [ 0 0 1 0 0 0 0 ] 0;
    n               n [ 0 0 0 0 0 0 0 ] 1;
}
I'm not sure what to use for a field in the first approach and if I need to define it in a file in the 0 folder. I chose U for velocity. If anyone could share some wisdom on how to get scalarTransport output, I would greatly appreciate it.
pez is offline   Reply With Quote

Old   March 24, 2016, 04:45
Default
  #2
Senior Member
 
Tom Fahner
Join Date: Mar 2009
Location: Breda, Netherlands
Posts: 634
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,

The error output is actually quite useful.

Quote:
--> FOAM FATAL IO ERROR:
keyword selectionMode is undefined in dictionary "IOstream.functions.S.fvOptions.S-01.scalarExplicitSetValueCoeffs"
means that OpenFOAM expects a keyword selectionMode inside the scalarExplicitSetValueCoeffs subDict. So I would expect it works if you change your dict to:

Code:
S
      {
          type            scalarTransport;
          outputControl   outputTime;
          resetOnStartUp  false;
          autoSchemes     true;
          fvOptions
          {
               S-01
               {
                   type            scalarExplicitSetValue;
                   active          true;

                   scalarExplicitSetValueCoeffs
                   {
                       selectionMode   cellZone;
                       cellZone        sampleInlet;
                       injectionRate
                       {
                           U   1.0;
                       }
                   }
               }
          };
      }
}
Maybe some other error pops up, but this should at least solve your first problem.
tomf is offline   Reply With Quote

Old   March 28, 2016, 21:27
Default
  #3
pez
New Member
 
Join Date: Feb 2016
Posts: 4
Rep Power: 10
pez is on a distinguished road
Thanks so much! Your suggestion solved the first error.

Now, the pisoFoam log is returning
Code:
scalarTransport output:
smoothSolver:  Solving for S, Initial residual = 0, Final residual = 0, No Iterations 0
or
Code:
scalarTransport output:
--> FOAM Warning : 
    From function void option::checkApplied() const
    in file fvOption/fvOption.C at line 120
    Source S-01 defined for field U but never used
--> FOAM Warning : 
    From function void option::checkApplied() const
    in file fvOption/fvOption.C at line 120
    Source S-01 defined for field U but never used
smoothSolver:  Solving for S, Initial residual = 0, Final residual = 0, No Iterations 0
Why is there no output and what should I be using for my field? I chose velocity because I want to track particles that are flowing through and leaving the tank, but I'm honestly not sure what I should be using. Thanks!
pez is offline   Reply With Quote

Old   March 29, 2016, 04:05
Default
  #4
Senior Member
 
Tom Fahner
Join Date: Mar 2009
Location: Breda, Netherlands
Posts: 634
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
I think that you would need to use "S", since you are creating a source for the S field. So your source just generates 1 "S" per second and you velocity field is used to advect it through the domain.
tomf is offline   Reply With Quote

Old   March 29, 2016, 09:31
Default
  #5
pez
New Member
 
Join Date: Feb 2016
Posts: 4
Rep Power: 10
pez is on a distinguished road
Thanks for your reply. This post: http://www.cfd-online.com/Forums/ope...tsetvalue.html has a different variable for the field than the name of the function object.
Also, after further thought, I'm not sure I should use U since velocity is not a scalar and scalarTransport solves for a scalar. Do you have any other thoughts?
pez is offline   Reply With Quote

Old   March 29, 2016, 10:49
Default
  #6
Senior Member
 
Tom Fahner
Join Date: Mar 2009
Location: Breda, Netherlands
Posts: 634
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
The post you are referencing to is trying to achieve something else. Did you try my suggestion? Because I used a similar approach, which gave me the expected result (note I called my scalar "Lak" instead of "S":

Code:
    Lak
    {
        type    scalarTransport;
        functionObjectLibs ("libutilityFunctionObjects.so");
        outputControl outputTime;
        active          true;
        autoSchemes     false;
        nCorr           0;
        resetOnStartUp false;
        fvOptions
        
        {
            SetLak
            {
                type        scalarExplicitSetValue;
                active      true;

                scalarExplicitSetValueCoeffs
                {
                    injectionRate
                    {
                        selectionMode   cellZone;
                        cellZone    LakSet;
                        Lak         1;
                    }
                }
            }
            
        }
    }
tomf 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
fvOption scalarTransport and diffusivity Tobi OpenFOAM Running, Solving & CFD 0 March 15, 2016 09:21
fvOptions scalarTransport utility matthew.legg OpenFOAM Post-Processing 16 April 14, 2015 12:23
Radial diffusion in scalarTransport problem jr33 OpenFOAM 0 April 16, 2013 18:22
Regarding the adaptation of scalarTransport Foam as well as general openFOAM logic. HFonten1 OpenFOAM 0 August 10, 2010 13:05
Initialization in scalarTransport skabilan OpenFOAM Running, Solving & CFD 8 August 25, 2008 10:45


All times are GMT -4. The time now is 06:24.