CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   How to get the max value of the whole field (http://www.cfd-online.com/Forums/openfoam-solving/58800-how-get-max-value-whole-field.html)

waynezw0618 June 16, 2008 04:23

Hi every: i am interested in
 
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!

dmoroian June 16, 2008 04:30

Hi Wayne, To get the maximum
 
Hi Wayne,
To get the maximum value of a field, you can use max(field).

Dragos

ngj June 16, 2008 04:44

And to add to Dragos' note, I
 
And to add to Dragos' note, I can recommend the Programmers Guide pp 23-25, which gives a list of algebraic tensor operations.

/ Niels

braennstroem June 16, 2008 11:22

gMax could help!? label buf
 
gMax could help!?

label buffmin = findMin(scalarFlds1);
Info << "max: " << gMax(scalarFlds1[buffmin].internalField()) << endl;

waynezw0618 June 17, 2008 05:07

Hi thanks; i have made some m
 
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


All times are GMT -4. The time now is 10:51.