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

Limiting values inside volScalarField

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 18, 2011, 07:11
Default Limiting values inside volScalarField
  #1
New Member
 
Pekka Röyttä
Join Date: Nov 2010
Location: Singapore
Posts: 7
Rep Power: 15
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, 07:26
Default
  #2
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37
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 offline   Reply With Quote

Old   March 18, 2011, 07:36
Default
  #3
Cyp
Senior Member
 
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 299
Rep Power: 18
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, 07:50
Default Thanks
  #4
New Member
 
Pekka Röyttä
Join Date: Nov 2010
Location: Singapore
Posts: 7
Rep Power: 15
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


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
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 19:08
strange node values @ solid/fluid interface - help JB FLUENT 2 November 1, 2008 12:04
Modelling the Heat flow inside the curing oven Marios Vlad CFX 1 February 6, 2008 07:11
meshing F1 front wing Steve FLUENT 0 April 17, 2003 12:37


All times are GMT -4. The time now is 00:28.