|
[Sponsors] |
March 18, 2011, 08:11 |
Limiting values inside volScalarField
|
#1 |
New Member
Pekka Röyttä
Join Date: Nov 2010
Location: Singapore
Posts: 7
Rep Power: 16 |
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);} } } Code:
volScalarField Tmp = cD(D)*cPrt(D); PrtLimiter(Tmp); Code:
myChannelFoam2: symbol lookup error: .../lib/linux64GccDPOpt/libHTdynamicSmagorinskyModel.so: undefined symbol: _ZN4Foam14incompressible9LESModels20HTdynamicSmagorinsky10PrtLimiterERNS_14GeometricFieldIdNS_12fvPatchFieldENS_7volMeshEEE 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 |
|
March 18, 2011, 08:26 |
|
#2 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,903
Rep Power: 37 |
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) Niels |
|
March 18, 2011, 08:36 |
|
#3 |
Senior Member
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 299
Rep Power: 18 |
Hi!
I think you can use the .max() and .min() fonction of a volScalarField: Code:
Prt.max(Low) Prt.min(Lup) Cyp |
|
March 18, 2011, 08:50 |
Thanks
|
#4 |
New Member
Pekka Röyttä
Join Date: Nov 2010
Location: Singapore
Posts: 7
Rep Power: 16 |
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 |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
exact face values | RubenG | Main CFD Forum | 0 | June 22, 2009 12: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 13:37 |