CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (http://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   zeta - F turbulence model (http://www.cfd-online.com/Forums/openfoam-programming-development/90571-zeta-f-turbulence-model.html)

e_boesso July 14, 2011 05:24

zeta - F turbulence model
 
2 Attachment(s)
Hi,
I'm trying to implement zeta-F turbulence model by Popovac in openfoam ver. 2.0.0.
After compiling a run time selectable library I'm trying to use it in a tutorial (incompressible/pisofoam/ras/cavity) but when I run the executable this error message appear:

/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.0.0 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
Build : 2.0.0-d79727c3fca7
Exec : pisoFoam
Date : Jul 14 2011
Time : 11:05:03
Host : ubuntu
PID : 2354
Case : /home/enrico/OpenFOAM/enrico-2.0.0/run/tutorials/incompressible/pisoFoam/ras/cavity
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Disallowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

Reading field p

Reading field U

Reading/calculating face flux field phi

Selecting incompressible transport model Newtonian
Selecting turbulence model type RASModel
Selecting RAS turbulence model zetaF
#0 Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam200/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1 Foam::sigFpe::sigHandler(int) in "/opt/openfoam200/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2 in "/lib/libc.so.6"
#3 Foam::divide(Foam::Field<double>&, double const&, Foam::UList<double> const&) in "/opt/openfoam200/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#4 Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam::operator/<Foam::fvPatchField, Foam::volMesh>(Foam::dimensioned<double> const&, Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > const&) in "/opt/openfoam200/platforms/linux64GccDPOpt/bin/pisoFoam"
#5 Foam::incompressible::RASModels::zetaF::Tau() const in "/home/enrico/OpenFOAM/enrico-2.0.0/platforms/linux64GccDPOpt/lib/libzetaF.so"
#6 Foam::incompressible::RASModels::zetaF::zetaF(Foam ::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::transportModel&, Foam::word const&, Foam::word const&) in "/home/enrico/OpenFOAM/enrico-2.0.0/platforms/linux64GccDPOpt/lib/libzetaF.so"
#7 Foam::incompressible::RASModel::adddictionaryConst ructorToTable<Foam::incompressible::RASModels::zet aF>::New(Foam::GeometricField<Foam::Vector<double> , Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::transportModel&, Foam::word const&) in "/home/enrico/OpenFOAM/enrico-2.0.0/platforms/linux64GccDPOpt/lib/libzetaF.so"
#8 Foam::incompressible::RASModel::New(Foam::Geometri cField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::transportModel&, Foam::word const&) in "/opt/openfoam200/platforms/linux64GccDPOpt/lib/libincompressibleRASModels.so"
#9 Foam::incompressible::turbulenceModel::addturbulen ceModelConstructorToTable<Foam::incompressible::RA SModel>::NewturbulenceModel(Foam::GeometricField<F oam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::transportModel&, Foam::word const&) in "/opt/openfoam200/platforms/linux64GccDPOpt/lib/libincompressibleRASModels.so"
#10 Foam::incompressible::turbulenceModel::New(Foam::G eometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::transportModel&, Foam::word const&) in "/opt/openfoam200/platforms/linux64GccDPOpt/lib/libincompressibleTurbulenceModel.so"
#11
in "/opt/openfoam200/platforms/linux64GccDPOpt/bin/pisoFoam"
#12 __libc_start_main in "/lib/libc.so.6"
#13
in "/opt/openfoam200/platforms/linux64GccDPOpt/bin/pisoFoam"
Floating point exception


I've no experience in c++ programming but I think the initial/boundary conditions are not correctly set: in "0" directory I copy the k file contents in f and zeta file and then change the dimensionset (1/dimTime for f and dimless for zeta).
Where is the error?

Bernhard July 14, 2011 05:53

I am not able to compile your code without errors. Which version of OpenFOAM are you using?

How do you initialize the other fields? I can imagine that the floating point exception is caused by a division by zero somewhere.

e_boesso July 14, 2011 07:32

Thanks for reply,
the other fields are initialized in the same manner as the tutorial do ("0" directory in the tutorial directory).
For compiling the library I use the command "wmake libso" from within the zetaF directory in $PROJECT_USER_DIR environment and no error appear. My version is 2.0.0.

e_boesso July 14, 2011 07:42

I follow the development of the kEpsilon turbulence model as implemented in version 2.0.0 and modify it. If I try to compile my preceding version of zetaF turbulence model set up for openfoam 1.7.1 does not work in release 2.0.0.
I think this is caused by the different implementation of the RASModel base class from 1.7.1 to 2.0.0.

Bernhard July 14, 2011 08:14

So it's obvious that your 2.0 version does not compile in my 1.7 :)
But do I understand correctly that it did work with 1.7?

I understand you initialize with the 0 folder, but with what values?

e_boesso July 14, 2011 08:42

1 Attachment(s)
In version 1.7 I compile the code... now I have to test it...right.. but... before do it... openCFD release the 2.0 version! So I change the code to fit into the new version. No tests has been made on this implementation of the turbulence model.
You find "0" case directory below.

e_boesso July 14, 2011 09:19

I find the division by zero error. It's in zetaF.C in the function Tau() (line 52).
The velocity tensor at the denominator has all the components set to 0 because of the initial conditions. There are many other errors I'm trying to resolve.

Bernhard July 14, 2011 09:55

Maybe you can start from a converged k-epsilon solution, so that you won't encounter problems with these kind of issues. An alternative is to add VSMALL or something like that to the denominator.

e_boesso July 14, 2011 10:18

Thanks, it works now. I add fMin_ to the denominator (the same dimensionset is needed in the LHS and RHS of + operator), that is the lower limit value for volScalarField f_.
But I don't understand: the denominator in evaluating the time scale ( Tau() ) is the same that appear in the length scale ( L() ) but only in Tau() function the floating point exception is present.
Why?

Bernhard July 14, 2011 10:39

Maybe because you call Tau() before L()?

By the way, be sure to check the correct implementatation for |S|, I think Hanjalic defines it as (2*S_ij*S_ij)^(1/2)

e_boesso July 15, 2011 07:48

No, excluding the min part of Tau() function from the code, recompiling and running the case the floating point exception is not present.

I write |S| in openfoam as mag(symm(fvc::grad(U_))). Is it correct?

Bernhard July 15, 2011 07:54

First thing: I have no idea.

Second, in your case.
|S|=\left(S_{ij} S_{ij}\right)^{1/2}
But I think in the zeta-f model, it should be defined as

|S|=\left(2 S_{ij} S_{ij}\right)^{1/2}

e_boesso August 18, 2011 14:11

Thanks for the correction.

e_boesso August 18, 2011 14:17

BCs
 
I'm trying to resolve channel flow or backward facing step to validate the model but I've no ideas on how to apply boundary conditions (inlet, outlet and wall) for zeta and f scalar variables.
Suggestions or references to the matter?
Thanks

Bernhard August 18, 2011 14:50

I think Hanjalic proposes a transformation on f which reduces it's boundary condion to f=0. Did you try that?

e_boesso August 18, 2011 15:31

I understand that transformation is valid only for the wall BC.
But for inlet and outlet?
I'm also unable to manage zeta BCs.


All times are GMT -4. The time now is 19:43.