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

How to get the max value of the whole field

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes
  • 1 Post By dmoroian
  • 1 Post By ngj
  • 2 Post By braennstroem

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 16, 2008, 05:23
Default Hi every: i am interested in
  #1
Senior Member
 
wayne.zhang
Join Date: Mar 2009
Location: Shanghai, Shanghai, P.R.China
Posts: 309
Rep Power: 18
waynezw0618 is on a distinguished road
Send a message via MSN to waynezw0618 Send a message via Skype™ to waynezw0618
Hi every:
i am interested in the SST model,but i always a get a strange result --in terms of a "streak of higher value F1 appearing away from the wall in the outer regions of the boundary layer" whenever i modify the mesh.it appears as it is of "SST",and according the help of my friend,i turn to the paper of A.Herllsten (AIAA98-2554),according to the paper
"a better behavior is obtained when CDkwmin is made proportional to the maximum value of cross-diffusion term detected in the flow field"
so how can i get the "maximum value of cross-diffusion term detected in the flow field" by modify the basic SST model in the OF?,is there any function to get the max value of the flow field?

yours wayne
thanks!
waynezw0618 is offline   Reply With Quote

Old   June 16, 2008, 05:30
Default Hi Wayne, To get the maximum
  #2
Senior Member
 
dmoroian's Avatar
 
Dragos
Join Date: Mar 2009
Posts: 648
Rep Power: 20
dmoroian is on a distinguished road
Hi Wayne,
To get the maximum value of a field, you can use max(field).

Dragos
songwukong likes this.
dmoroian is offline   Reply With Quote

Old   June 16, 2008, 05:44
Default And to add to Dragos' note, I
  #3
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,902
Rep Power: 37
ngj will become famous soon enoughngj will become famous soon enough
And to add to Dragos' note, I can recommend the Programmers Guide pp 23-25, which gives a list of algebraic tensor operations.

/ Niels
songwukong likes this.
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request.
ngj is offline   Reply With Quote

Old   June 16, 2008, 12:22
Default gMax could help!? label buf
  #4
Senior Member
 
Fabian Braennstroem
Join Date: Mar 2009
Posts: 407
Rep Power: 19
braennstroem is on a distinguished road
gMax could help!?

label buffmin = findMin(scalarFlds1);
Info << "max: " << gMax(scalarFlds1[buffmin].internalField()) << endl;
shereez234 and Mirza8 like this.
braennstroem is offline   Reply With Quote

Old   June 17, 2008, 06:07
Default Hi thanks; i have made some m
  #5
Senior Member
 
wayne.zhang
Join Date: Mar 2009
Location: Shanghai, Shanghai, P.R.China
Posts: 309
Rep Power: 18
waynezw0618 is on a distinguished road
Send a message via MSN to waynezw0618 Send a message via Skype™ to waynezw0618
Hi thanks;
i have made some modification of SST model :
*---------------------------------------------------------------------------*/

#include "kOmegaSST.H"
#include "addToRunTimeSelectionTable.H"
#include "wallFvPatch.H"

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

namespace Foam
{
namespace turbulenceModels
{

// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //

defineTypeNameAndDebug(kOmegaSSTRC, 0);
addToRunTimeSelectionTable(turbulenceModel, kOmegaSSTRC, dictionary);

// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //

tmp<volscalarfield> kOmegaSSTRC::F1(const volScalarField& CDkOmega,const volScalarField& CDkOmegalim) const
{
volScalarField CDkOmegaPlus = max
(
CDkOmega,
CDkOmegalim
);//**modification** use the CDkOmegalim instead of 1.0e-10


volScalarField arg1 = min
(
....
}

tmp<volscalarfield> kOmegaSSTRC::F2() const
{
...
}


// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

kOmegaSSTRC::kOmegaSSTRC
.....
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //

tmp<volsymmtensorfield> kOmegaSSTRC::R() const
{
....
}


tmp<fvvectormatrix> kOmegaSSTRC::divR(volVectorField& U) const
{
....
}


bool kOmegaSSTRC::read()
{
....
}


void kOmegaSSTRC::correct()
{
transportModel_.correct();

if (!turbulence_)
{
return;
}

turbulenceModel::correct();

if (mesh_.moving())
{
y_.correct();
}

volScalarField S2 = mag(symm(fvc::grad(U_)));
volScalarField OMEGA2 = mag(skew(fvc::grad(U_)));
volScalarField G = nut_*2*S2*OMEGA2;//**modification** Production limitation of Kato and Launder


//# include "kOmegaWallFunctionsI.H"

volScalarField CDkOmega =
(2*alphaOmega2)*(fvc::grad(k_) & fvc::grad(omega_))/omega_;
//**modification** define the limitation of the CDkw by the maximum value of cross section term in the flow field (AIAA98-2554)
volScalarField CDkOmegalim =
1.0e-8*gmax((2*alphaOmega2)*(fvc::grad(k_) & fvc::grad(omega_))/omega_);

//**modification** get the F1 from CDkOmega and CDkOmegalim
volScalarField F1 = this->F1(CDkOmega,CDkOmegalim);

//**modification** rotation and curve modification of SST model by Richardeson number defined in the A.Hellsten`s paper(AIAA A98-32817
volScalarField Ri = mag(skew(fvc::grad(U_)))/mag(symm(fvc::grad(U_)))*(mag(skew(fvc::grad(U_)))/mag( symm(fvc::grad(U_)))-1);

volScalarField F4 = pow(1+3.6*Ri,-1);


// Turbulent frequency equation
tmp<fvscalarmatrix> omegaEqn
(
fvm::ddt(omega_)
+ fvm::div(phi_, omega_)
- F4*::Sp(fvc::div(phi_), omega_)
- fvm::laplacian(DomegaEff(F1), omega_)
==
gamma(F1)*2*S2*OMEGA2
- fvm::Sp(beta(F1)*omega_, omega_)
- fvm::SuSp
(
(F1 - scalar(1))*CDkOmega/omega_,
omega_
)
);

omegaEqn().relax();

.....

}


but when i do the wmake there is lots of error message

+ wmake libso incompressible
Making dependency list for source file kOmegaSSTRC/kOmegaSSTRC.C
SOURCE=kOmegaSSTRC/kOmegaSSTRC.C ; g++ -m64 -Dlinux64 -DDP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -march=opteron -O3 -DNoRepository -ftemplate-depth-40 -I/home/waynezw0618/OpenFOAM/OpenFOAM-1.4.1/src/finiteVolume/lnInclude -I/home/waynezw0618/OpenFOAM/OpenFOAM-1.4.1/src/meshTools/lnInclude -I/home/waynezw0618/OpenFOAM/OpenFOAM-1.4.1/src/transportModels -IlnInclude -I. -I/home/waynezw0618/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/kOmegaSSTRC.o
kOmegaSSTRC/kOmegaSSTRC.C:40: error: 'kOmegaSSTRC' has not been declared
kOmegaSSTRC/kOmegaSSTRC.C:40: error: 'kOmegaSSTRC' has not been declared
kOmegaSSTRC/kOmegaSSTRC.C:40: error: 'kOmegaSSTRC' has not been declared
kOmegaSSTRC/kOmegaSSTRC.C:40: error: 'kOmegaSSTRC' has not been declared
kOmegaSSTRC/kOmegaSSTRC.C:45: error: 'kOmegaSSTRC' has not been declared
kOmegaSSTRC/kOmegaSSTRC.C:45: error: non-member function 'Foam::tmp<foam::geometricfield<double,> > Foam::turbulenceModels::F1(const Foam::volScalarField&, const Foam::volScalarField&)' cannot have cv-qualifier
kOmegaSSTRC/kOmegaSSTRC.C: In function 'Foam::tmp<foam::geometricfield<double,> > Foam::turbulenceModels::F1(const Foam::volScalarField&, const Foam::volScalarField&)':
kOmegaSSTRC/kOmegaSSTRC.C:59: error: 'betaStar' was not declared in this scope
kOmegaSSTRC/kOmegaSSTRC.C:59: error: 'k_' was not declared in this scope
kOmegaSSTRC/kOmegaSSTRC.C:59: error: 'omega_' was not declared in this scope
kOmegaSSTRC/kOmegaSSTRC.C:59: error: 'y_' was not declared in this scope
kOmegaSSTRC/kOmegaSSTRC.C:60: error: 'nu' was not declared in this scope
kOmegaSSTRC/kOmegaSSTRC.C:62: error: 'alphaOmega2' was not declared in this scope
kOmegaSSTRC/kOmegaSSTRC.C: At global scope:
kOmegaSSTRC/kOmegaSSTRC.C:70: error: 'kOmegaSSTRC' has not been declared
kOmegaSSTRC/kOmegaSSTRC.C:70: error: non-member function 'Foam::tmp<foam::geometricfield<double,> > Foam::turbulenceModels::F2()' cannot have cv-qualifier
kOmegaSSTRC/kOmegaSSTRC.C: In function 'Foam::tmp<foam::geometricfield<double,> > Foam::turbulenceModels::F2()':
kOmegaSSTRC/kOmegaSSTRC.C:76: error: 'betaStar' was not declared in this scope
kOmegaSSTRC/kOmegaSSTRC.C:76: error: 'k_' was not declared in this scope
kOmegaSSTRC/kOmegaSSTRC.C:76: error: 'omega_' was not declared in this scope
kOmegaSSTRC/kOmegaSSTRC.C:76: error: 'y_' was not declared in this scope
kOmegaSSTRC/kOmegaSSTRC.C:77: error: 'nu' was not declared in this scope
kOmegaSSTRC/kOmegaSSTRC.C: At global scope:
kOmegaSSTRC/kOmegaSSTRC.C:88: error: 'kOmegaSSTRC' has not been declared
kOmegaSSTRC/kOmegaSSTRC.C:93: error: ISO C++ forbids declaration of 'kOmegaSSTRC' with no type
kOmegaSSTRC/kOmegaSSTRC.C: In function 'int Foam::turbulenceModels::kOmegaSSTRC(const Foam::volVectorField&, const Foam::surfaceScalarField&, Foam::transportModel&)':
kOmegaSSTRC/kOmegaSSTRC.C:94: error: only constructors take base initializers
kOmegaSSTRC/kOmegaSSTRC.C:97: error: 'turbulenceModelCoeffs_' was not declared in this scope
kOmegaSSTRC/kOmegaSSTRC.C:114: error: 'mesh_' was not declared in this scope
kOmegaSSTRC/kOmegaSSTRC.C:121: error: 'runTime_' was not declared in this scope
kOmegaSSTRC/kOmegaSSTRC.C:142: error: 'a1' was not declared in this scope
kOmegaSSTRC/kOmegaSSTRC.C:142: error: 'k_' was not declared in this scope
kOmegaSSTRC/kOmegaSSTRC.C:142: error: 'omega_' was not declared in this scope
kOmegaSSTRC/kOmegaSSTRC.C:142: error: 'omegaSmall_' was not declared in this scope
kOmegaSSTRC/kOmegaSSTRC.C:142: error: 'U_' was not declared in this scope
kOmegaSSTRC/kOmegaSSTRC.C:145: warning: no return statement in function returning non-void
kOmegaSSTRC/kOmegaSSTRC.C: At global scope:
kOmegaSSTRC/kOmegaSSTRC.C:150: error: 'kOmegaSSTRC' is not a class or namespace
kOmegaSSTRC/kOmegaSSTRC.C:150: error: non-member function 'Foam::tmp<foam::geometricfield<foam::symmtensor<d ouble>, Foam::fvPatchField, Foam::volMesh> > Foam::turbulenceModels::R()' cannot have cv-qualifier
kOmegaSSTRC/kOmegaSSTRC.C: In function 'Foam::tmp<foam::geometricfield<foam::symmtensor<d ouble>, Foam::fvPatchField, Foam::volMesh> > Foam::turbulenceModels::R()':
kOmegaSSTRC/kOmegaSSTRC.C:159: error: 'runTime_' was not declared in this scope
kOmegaSSTRC/kOmegaSSTRC.C:160: error: 'mesh_' was not declared in this scope
kOmegaSSTRC/kOmegaSSTRC.C:164: error: 'k_' was not declared in this scope
kOmegaSSTRC/kOmegaSSTRC.C:164: error: 'nut_' was not declared in this scope
kOmegaSSTRC/kOmegaSSTRC.C:164: error: 'U_' was not declared in this scope
kOmegaSSTRC/kOmegaSSTRC.C: At global scope:
kOmegaSSTRC/kOmegaSSTRC.C:171: error: 'kOmegaSSTRC' is not a class or namespace
kOmegaSSTRC/kOmegaSSTRC.C:171: error: non-member function 'Foam::tmp<foam::fvmatrix<foam::vector<double> > > Foam::turbulenceModels::divR(Foam::volVectorField& )' cannot have cv-qualifier
kOmegaSSTRC/kOmegaSSTRC.C: In function 'Foam::tmp<foam::fvmatrix<foam::vector<double> > > Foam::turbulenceModels::divR(Foam::volVectorField& )':
kOmegaSSTRC/kOmegaSSTRC.C:175: error: 'nuEff' was not declared in this scope
kOmegaSSTRC/kOmegaSSTRC.C: At global scope:
kOmegaSSTRC/kOmegaSSTRC.C:181: error: 'kOmegaSSTRC' is not a class or namespace
kOmegaSSTRC/kOmegaSSTRC.C: In function 'bool Foam::turbulenceModels::read()':
kOmegaSSTRC/kOmegaSSTRC.C:183: error: cannot call member function 'virtual bool Foam::turbulenceModel::read()' without object
kOmegaSSTRC/kOmegaSSTRC.C:185: error: 'turbulenceModelCoeffs_' was not declared in this scope
kOmegaSSTRC/kOmegaSSTRC.C:185: error: 'alphaK1' was not declared in this scope
kOmegaSSTRC/kOmegaSSTRC.C:186: error: 'alphaK2' was not declared in this scope
kOmegaSSTRC/kOmegaSSTRC.C:187: error: 'alphaOmega1' was not declared in this scope
kOmegaSSTRC/kOmegaSSTRC.C:188: error: 'alphaOmega2' was not declared in this scope
kOmegaSSTRC/kOmegaSSTRC.C:189: error: 'gamma1' was not declared in this scope
kOmegaSSTRC/kOmegaSSTRC.C:190: error: 'gamma2' was not declared in this scope
kOmegaSSTRC/kOmegaSSTRC.C:191: error: 'beta1' was not declared in this scope
kOmegaSSTRC/kOmegaSSTRC.C:192: error: 'beta2' was not declared in this scope
kOmegaSSTRC/kOmegaSSTRC.C:193: error: 'betaStar' was not declared in this scope
kOmegaSSTRC/kOmegaSSTRC.C:194: error: 'a1' was not declared in this scope
kOmegaSSTRC/kOmegaSSTRC.C:195: error: 'c1' was not declared in this scope
kOmegaSSTRC/kOmegaSSTRC.C:196: error: 'Cmu' was not declared in this scope
kOmegaSSTRC/kOmegaSSTRC.C: At global scope:
kOmegaSSTRC/kOmegaSSTRC.C:207: error: 'kOmegaSSTRC' is not a class or namespace
kOmegaSSTRC/kOmegaSSTRC.C: In function 'void Foam::turbulenceModels::correct()':
kOmegaSSTRC/kOmegaSSTRC.C:209: error: 'transportModel_' was not declared in this scope
kOmegaSSTRC/kOmegaSSTRC.C:211: error: 'turbulence_' was not declared in this scope
kOmegaSSTRC/kOmegaSSTRC.C:216: error: cannot call member function 'virtual void Foam::turbulenceModel::correct()' without object
kOmegaSSTRC/kOmegaSSTRC.C:218: error: 'mesh_' was not declared in this scope
kOmegaSSTRC/kOmegaSSTRC.C:220: error: 'y_' was not declared in this scope
kOmegaSSTRC/kOmegaSSTRC.C:223: error: 'U_' was not declared in this scope
kOmegaSSTRC/kOmegaSSTRC.C:225: error: 'nut_' was not declared in this scope
kOmegaSSTRC/kOmegaSSTRC.C:230: error: 'alphaOmega2' was not declared in this scope
kOmegaSSTRC/kOmegaSSTRC.C:230: error: 'k_' was not declared in this scope
kOmegaSSTRC/kOmegaSSTRC.C:230: error: 'omega_' was not declared in this scope
kOmegaSSTRC/kOmegaSSTRC.C:233: error: 'gmax' was not declared in this scope
kOmegaSSTRC/kOmegaSSTRC.C:236: error: invalid use of 'this' in non-member function
kOmegaSSTRC/kOmegaSSTRC.C:247: error: 'phi_' was not declared in this scope
kOmegaSSTRC/kOmegaSSTRC.C:248: error: '::Sp' has not been declared
kOmegaSSTRC/kOmegaSSTRC.C:249: error: 'DomegaEff' was not declared in this scope
kOmegaSSTRC/kOmegaSSTRC.C:251: error: cannot convert 'Foam::volScalarField' to 'double' for argument '1' to 'double gamma(double)'
kOmegaSSTRC/kOmegaSSTRC.C:252: error: 'beta' was not declared in this scope
kOmegaSSTRC/kOmegaSSTRC.C:265: error: 'omega0_' was not declared in this scope
kOmegaSSTRC/kOmegaSSTRC.C:273: error: 'DkEff' was not declared in this scope
kOmegaSSTRC/kOmegaSSTRC.C:275: error: 'c1' was not declared in this scope
kOmegaSSTRC/kOmegaSSTRC.C:275: error: 'betaStar' was not declared in this scope
kOmegaSSTRC/kOmegaSSTRC.C:281: error: 'k0_' was not declared in this scope
kOmegaSSTRC/kOmegaSSTRC.C:285: error: 'a1' was not declared in this scope
make: *** [Make/linux64GccDPOpt/kOmegaSSTRC.o] error1

can you tell me what is wrong with it ?

thanks
yours wayne
waynezw0618 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
How to get Pressure field from velocity field qunwuhe@hotmail.com Main CFD Forum 4 October 14, 2007 08:38
Putting submesh field values into field on parent mesh helmut OpenFOAM Running, Solving & CFD 2 June 20, 2006 08:31
velocity field Faiz Ahmed Main CFD Forum 0 March 5, 2006 11:11
whole-field solution ? rohit Phoenics 1 February 3, 2005 13:13
field by field decomposition vs. component-wise zhanglei Main CFD Forum 0 January 5, 2001 10:06


All times are GMT -4. The time now is 12:14.