CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

Limiting values inside volScalarField

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

Reply
 
LinkBack Thread Tools Display Modes
Old   March 18, 2011, 08:11
Default Limiting values inside volScalarField
  #1
New Member
 
Pekka Röyttä
Join Date: Nov 2010
Location: Gothenburg, Sweden
Posts: 6
Rep Power: 6
PekkaRo is on a distinguished road
Hi all,

I am implementing passive scalar transport to dynamic Smagorinsky model, and I have run into trouble. In order to keep my solver steady I need to clip the insane values of turbulent Prandtl numbers, that are inevitable at least with the Lilly formulation. To that end I wrote the following.

Code:
    void PrtLimiter(volScalarField& Prt)
    {
        scalar Lup= 2.0;
        scalar Llo= 0.0;
            
        forAll(Prt,i)
        {
            if (Prt[i]<Llo){Prt.replace(i,Llo);}
            if (Prt[i]>Lup){Prt.replace(i,Lup);}
            
        }
       
    }
And called it like this:

Code:
 volScalarField Tmp = cD(D)*cPrt(D);
 PrtLimiter(Tmp);
I also made the necessary declaration in my .H-file. As you can guess, it doesn't work. It compiles, but at the run time I get the following.

Code:
myChannelFoam2: symbol lookup error: .../lib/linux64GccDPOpt/libHTdynamicSmagorinskyModel.so: undefined symbol: _ZN4Foam14incompressible9LESModels20HTdynamicSmagorinsky10PrtLimiterERNS_14GeometricFieldIdNS_12fvPatchFieldENS_7volMeshEEE
I would be most grateful, if someone could tell me how to deal with this?

To those who are interested in the model, I did some modifications to avoid doing division with very small numbers that's why the constants are multiplied, not divided, and a 1/2 is missing.

-Pekka
PekkaRo is offline   Reply With Quote

Old   March 18, 2011, 08:26
Default
  #2
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,607
Rep Power: 25
ngj will become famous soon enoughngj will become famous soon enough
Hi Pekka

It sounds like PrtLimiter is a method of some object, so in your C-file, is should read

Code:
void <nameOfMyObject>::PtrLimiter(scalarField & Prt)
Bests

Niels
ngj is online now   Reply With Quote

Old   March 18, 2011, 08:36
Default
  #3
Cyp
Senior Member
 
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 229
Rep Power: 9
Cyp is on a distinguished road
Hi!

I think you can use the .max() and .min() fonction of a volScalarField:

Code:
Prt.max(Low)
Prt.min(Lup)
Best,
Cyp
Cyp is offline   Reply With Quote

Old   March 18, 2011, 08:50
Default Thanks
  #4
New Member
 
Pekka Röyttä
Join Date: Nov 2010
Location: Gothenburg, Sweden
Posts: 6
Rep Power: 6
PekkaRo is on a distinguished road
Thank you both,

Niels was right and with the input from Cyp I don't even need the function. I tested it already and it works beautifully.

Thanks again,
-Pekka
PekkaRo is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
exact face values RubenG Main CFD Forum 0 June 22, 2009 11:09
OpenFOAM on MinGW crosscompiler hosted on Linux allenzhao OpenFOAM Installation 127 January 30, 2009 20:08
strange node values @ solid/fluid interface - help JB FLUENT 2 November 1, 2008 13:04
Modelling the Heat flow inside the curing oven Marios Vlad CFX 1 February 6, 2008 08:11
meshing F1 front wing Steve FLUENT 0 April 17, 2003 12:37


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