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

what is the purpose of rhoMin and rhoMax in fvsolution

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 29, 2012, 10:09
Default what is the purpose of rhoMin and rhoMax in fvsolution
  #1
Senior Member
 
Mihai Pruna
Join Date: Apr 2010
Location: Boston
Posts: 195
Rep Power: 16
mihaipruna is on a distinguished road
I noticed the simulation aborts if the limits are breached, but why are units specified there as well?
rhoMin rhoMin [1 -3 0 0 0] 0.01;
rhoMax rhoMax [1 -3 0 0 0] 100.0;
mihaipruna is offline   Reply With Quote

Old   June 30, 2012, 07:12
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Mihai,

The units are probably supplied for the sake of completeness, while also making it easier to access when reading the dictionary file.
This way it's not necessary to first read the value to a "scalar" variable and then add dimensions by creating a "dimensionedScalar" based on the first one. These dimensions are necessary for field operations, since the "rho" field has dimensions itself.

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   July 2, 2012, 09:06
Default
  #3
Senior Member
 
Mihai Pruna
Join Date: Apr 2010
Location: Boston
Posts: 195
Rep Power: 16
mihaipruna is on a distinguished road
I think I understand. Is it because rho is derived?
mihaipruna is offline   Reply With Quote

Old   July 2, 2012, 09:19
Default
  #4
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Example: https://github.com/OpenFOAM/OpenFOAM...createFields.H

Code:
autoPtr<basicPsiThermo> pThermo
    (
        basicPsiThermo::New(mesh)
    );
    basicPsiThermo& thermo = pThermo();

    volScalarField rho
    (
        IOobject
        (
            "rho",
            runTime.timeName(),
            mesh,
            IOobject::READ_IF_PRESENT,
            IOobject::AUTO_WRITE
        ),
        thermo.rho()
    );

//....

    dimensionedScalar rhoMax(simple.dict().lookup("rhoMax"));
    dimensionedScalar rhoMin(simple.dict().lookup("rhoMin"));
As you can see, this makes it easier to read from the dictionary file. As for the "rho" field, it's initialized with the "basicPsiThermo" based structure... which I'll leave to you as an exercise: http://foam.sourceforge.net/docs/cpp/index.html

edit: forgot to mention: rho is used here: https://github.com/OpenFOAM/OpenFOAM...pleFoam/pEqn.H
__________________

Last edited by wyldckat; July 2, 2012 at 09:20. Reason: see "edit:"
wyldckat 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 06:17.