CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Community Contributions (https://www.cfd-online.com/Forums/openfoam-community-contributions/)
-   -   [swak4Foam] groovyBC issue - k and epsilon (https://www.cfd-online.com/Forums/openfoam-community-contributions/112683-groovybc-issue-k-epsilon.html)

gschaider February 20, 2014 16:58

Quote:

Originally Posted by LamiaOF2.1 (Post 475728)
hello
I am trying to program with groovy BC this equation

w=alpha*Uref/sqrt(Cµ)*Yref

I tried this but it gives me an error message
inlet
{
type groovyBC;
variables "Uref=5;Yref=0.5;alpha=0.33;Cµ=0.09;
omg=((Uref*alpha)/(sqrt(Cµ)*Yref));"
valueExpression "omg";
}

so is that make any sens?

Error message would be most helpful.

Anyway: I'm pretty sure (too lazy to bother checking the code) that µ is not a valid character in a fieldname. Maybe that is the problem

LamiaOF2.1 February 22, 2014 08:34

groovy
 
hello again
well I tried this
inlet
{
type groovyBC;
variables "Uref=5;Yref=0.5;alpha=0.33;C=0.09;omg=((Uref*alph a)/(sqrt(C)*Yref));"

valueExpression "omg";
}

and here is the error message

--> FOAM Warning :
From function groovyBCFvPatchField<Type>::groovyBCFvPatchField(c onst fvPatch& p,const DimensionedField<Type, volMesh>& iF,const dictionary& dict)
in file groovyBCFvPatchField.C at line 131
No value defined for U on inlet therefore using 460{(0 0 0)}
Reading/calculating face flux field phi

Selecting incompressible transport model Newtonian
Selecting RAS turbulence model kOmegaSST
--> FOAM Warning :
From function groovyBCFvPatchField<Type>::groovyBCFvPatchField(c onst fvPatch& p,const DimensionedField<Type, volMesh>& iF,const dictionary& dict)
in file groovyBCFvPatchField.C at line 131
No value defined for omega on inlet therefore using 460{0}
bounding omega, min: 0 max: 1 average: 1
#0 Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam220/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#1 Foam::sigFpe::sigHandler(int) in "/opt/openfoam220/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#2 Uninterpreted:
#3 Foam::divide(Foam::Field<double>&, Foam::UList<double> const&, Foam::UList<double> const&) in "/opt/openfoam220/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#4 void Foam::divide<Foam::fvPatchField, Foam::volMesh>(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) in "/opt/openfoam220/platforms/linuxGccDPOpt/lib/libincompressibleRASModels.so"
#5 at kOmegaSST.C:0
#6 Foam::incompressible::RASModels::kOmegaSST::F2() const in "/opt/openfoam220/platforms/linuxGccDPOpt/lib/libincompressibleRASModels.so"
#7 Foam::incompressible::RASModels::kOmegaSST::F23() const in "/opt/openfoam220/platforms/linuxGccDPOpt/lib/libincompressibleRASModels.so"
#8 Foam::incompressible::RASModels::kOmegaSST::kOmega SST(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 "/opt/openfoam220/platforms/linuxGccDPOpt/lib/libincompressibleRASModels.so"
#9 Foam::incompressible::RASModel::adddictionaryConst ructorToTable<Foam::incompressible::RASModels::kOm egaSST>::New(Foam::GeometricField<Foam::Vector<dou ble>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::transportModel&, Foam::word const&) in "/opt/openfoam220/platforms/linuxGccDPOpt/lib/libincompressibleRASModels.so"
#10 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/openfoam220/platforms/linuxGccDPOpt/lib/libincompressibleRASModels.so"
#11
in "/opt/openfoam220/platforms/linuxGccDPOpt/bin/simpleFoam"
#12 __libc_start_main in "/lib/i386-linux-gnu/libc.so.6"
#13
in "/opt/openfoam220/platforms/linuxGccDPOpt/bin/simpleFoam"
Exception en point flottant


please; I need help

gschaider February 22, 2014 11:32

Quote:

Originally Posted by LamiaOF2.1 (Post 476191)
hello again
well I tried this
inlet
{
type groovyBC;
variables "Uref=5;Yref=0.5;alpha=0.33;C=0.09;omg=((Uref*alph a)/(sqrt(C)*Yref));"

valueExpression "omg";
}

and here is the error message

--> FOAM Warning :
From function groovyBCFvPatchField<Type>::groovyBCFvPatchField(c onst fvPatch& p,const DimensionedField<Type, volMesh>& iF,const dictionary& dict)
in file groovyBCFvPatchField.C at line 131
No value defined for U on inlet therefore using 460{(0 0 0)}
Reading/calculating face flux field phi

Selecting incompressible transport model Newtonian
Selecting RAS turbulence model kOmegaSST
--> FOAM Warning :
From function groovyBCFvPatchField<Type>::groovyBCFvPatchField(c onst fvPatch& p,const DimensionedField<Type, volMesh>& iF,const dictionary& dict)
in file groovyBCFvPatchField.C at line 131
No value defined for omega on inlet therefore using 460{0}

At this place groovy tells you that during initializiation it needs a entry "value", doesn't find one and therefor assumes 0. Which leads to the "divide by zero" below.

The reason why it needs value is that it can't evaluate valueExpression during intialization because it can't be sure that all the needed fields are already loaded into memory. The value is only used during the first timestep

Don't know what else I can do to alert people to this apart from issuing a warning. Make it fail?

Quote:

Originally Posted by LamiaOF2.1 (Post 476191)
bounding omega, min: 0 max: 1 average: 1
#0 Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam220/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#1 Foam::sigFpe::sigHandler(int) in "/opt/openfoam220/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#2 Uninterpreted:
#3 Foam::divide(Foam::Field<double>&, Foam::UList<double> const&, Foam::UList<double> const&) in "/opt/openfoam220/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#4 void Foam::divide<Foam::fvPatchField, Foam::volMesh>(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) in "/opt/openfoam220/platforms/linuxGccDPOpt/lib/libincompressibleRASModels.so"
#5 at kOmegaSST.C:0
#6 Foam::incompressible::RASModels::kOmegaSST::F2() const in "/opt/openfoam220/platforms/linuxGccDPOpt/lib/libincompressibleRASModels.so"
#7 Foam::incompressible::RASModels::kOmegaSST::F23() const in "/opt/openfoam220/platforms/linuxGccDPOpt/lib/libincompressibleRASModels.so"
#8 Foam::incompressible::RASModels::kOmegaSST::kOmega SST(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 "/opt/openfoam220/platforms/linuxGccDPOpt/lib/libincompressibleRASModels.so"
#9 Foam::incompressible::RASModel::adddictionaryConst ructorToTable<Foam::incompressible::RASModels::kOm egaSST>::New(Foam::GeometricField<Foam::Vector<dou ble>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::transportModel&, Foam::word const&) in "/opt/openfoam220/platforms/linuxGccDPOpt/lib/libincompressibleRASModels.so"
#10 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/openfoam220/platforms/linuxGccDPOpt/lib/libincompressibleRASModels.so"
#11
in "/opt/openfoam220/platforms/linuxGccDPOpt/bin/simpleFoam"
#12 __libc_start_main in "/lib/i386-linux-gnu/libc.so.6"
#13
in "/opt/openfoam220/platforms/linuxGccDPOpt/bin/simpleFoam"
Exception en point flottant


please; I need help


LamiaOF2.1 February 23, 2014 08:47

groovy bc
 
hello Bernhard
I am sorry for my ignorance but I am new user of OpenFoam
I complitely understand you but I don't know how to enter this missing value
is it that way?

internalField uniform 400;// calcul omega

boundaryField
{
inlet
{
type groovyBC;
value uniform 400;
variables "Uref=5;Yref=0.5;alpha=0.33;C=0.09;omg=((Uref*alph a)/(sqrt(C)*Yref));"

valueExpression "omg";
}

cause it keeps giving me an error message
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

Reading field p

Reading field U

--> FOAM Warning :
From function groovyBCFvPatchField<Type>::groovyBCFvPatchField(c onst fvPatch& p,const DimensionedField<Type, volMesh>& iF,const dictionary& dict)
in file groovyBCFvPatchField.C at line 131
No value defined for U on inlet therefore using 460{(0 0 0)}
Reading/calculating face flux field phi

Selecting incompressible transport model Newtonian
Selecting RAS turbulence model kOmegaSST
kOmegaSSTCoeffs
{
alphak1 0.85034;
alphak2 1;
alphaOmega1 0.5;
alphaOmega2 0.85616;
gamma1 0.5532;
gamma2 0.4403;
beta1 0.075;
beta2 0.0828;
betaStar 0.09;
a1 0.31;
c1 10;
Cmu 0.09;
alphaK1 0.85034;
alphaK2 1;
b1 1;
F3 false;
}

Creating finite volume options
No finite volume options present


SIMPLE: convergence criteria
field p tolerance 1e-06
field U tolerance 1e-06
field "(k|epsilon|omega)" tolerance 1e-06


Starting time loop

streamLine : automatic track length specified through number of sub cycles : 5

Time = 1e-05

swak4Foam: Allocating new repository for sampledGlobalVariables
--> FOAM Warning :
From function gaussConvectionScheme
in file finiteVolume/convectionSchemes/gaussConvectionScheme/gaussConvectionScheme.H at line 123
Reading "/home/openfoam/Bureau/Kwsstmodelprofilomegagroovybc/system/fvSchemes.divSchemes.div(phi,U)" at line 33
Unbounded 'Gauss' div scheme used in steady-state solver, use 'bounded Gauss' to ensure boundedness.
To remove this warning switch off 'boundedGauss' in "/opt/openfoam220/etc/controlDict"
DILUPBiCG: Solving for Ux, Initial residual = 1, Final residual = 0.00654075, No Iterations 1
DILUPBiCG: Solving for Uy, Initial residual = 0, Final residual = 0, No Iterations 0
DICPCG: Solving for p, Initial residual = 1, Final residual = 0.00985678, No Iterations 647
time step continuity errors : sum local = 1.11693e-07, global = -2.60785e-09, cumulative = -2.60785e-09
--> FOAM Warning :
From function gaussConvectionScheme
in file finiteVolume/convectionSchemes/gaussConvectionScheme/gaussConvectionScheme.H at line 123
Reading "/home/openfoam/Bureau/Kwsstmodelprofilomegagroovybc/system/fvSchemes.divSchemes.div(phi,omega)" at line 35
Unbounded 'Gauss' div scheme used in steady-state solver, use 'bounded Gauss' to ensure boundedness.
To remove this warning switch off 'boundedGauss' in "/opt/openfoam220/etc/controlDict"
DILUPBiCG: Solving for omega, Initial residual = 0.0790587, Final residual = 0.000242277, No Iterations 1
bounding omega, min: 0 max: 1.80129e+06 average: 2158.86
--> FOAM Warning :
From function gaussConvectionScheme
in file finiteVolume/convectionSchemes/gaussConvectionScheme/gaussConvectionScheme.H at line 123
Reading "/home/openfoam/Bureau/Kwsstmodelprofilomegagroovybc/system/fvSchemes.divSchemes.div(phi,k)" at line 34
Unbounded 'Gauss' div scheme used in steady-state solver, use 'bounded Gauss' to ensure boundedness.
To remove this warning switch off 'boundedGauss' in "/opt/openfoam220/etc/controlDict"
DILUPBiCG: Solving for k, Initial residual = 1, Final residual = 0.0373248, No Iterations 1
#0 Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam220/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#1 Foam::sigFpe::sigHandler(int) in "/opt/openfoam220/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#2 Uninterpreted:
#3 Foam::divide(Foam::Field<double>&, Foam::UList<double> const&, Foam::UList<double> const&) in "/opt/openfoam220/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#4 void Foam::divide<Foam::fvPatchField, Foam::volMesh>(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) in "/opt/openfoam220/platforms/linuxGccDPOpt/lib/libincompressibleRASModels.so"
#5 at kOmegaSST.C:0
#6 Foam::incompressible::RASModels::kOmegaSST::F2() const in "/opt/openfoam220/platforms/linuxGccDPOpt/lib/libincompressibleRASModels.so"
#7 Foam::incompressible::RASModels::kOmegaSST::F23() const in "/opt/openfoam220/platforms/linuxGccDPOpt/lib/libincompressibleRASModels.so"
#8 Foam::incompressible::RASModels::kOmegaSST::correc t() in "/opt/openfoam220/platforms/linuxGccDPOpt/lib/libincompressibleRASModels.so"
#9
in "/opt/openfoam220/platforms/linuxGccDPOpt/bin/simpleFoam"
#10 __libc_start_main in "/lib/i386-linux-gnu/libc.so.6"
#11
in "/opt/openfoam220/platforms/linuxGccDPOpt/bin/simpleFoam"
Exception en point flottant


thank you for your help and patiente...

maalan March 1, 2015 07:16

Quote:

Haven't looked at the IB-stuff yet so I can't say anything clever here
Hi Bernhard! Did you already have a look at the IBM?

I use the foam-extend-3.1 release and would like to compute some 'swakExpressions' but I am stuck up to the moment... I have to say that I did compute these expressions in a conformal mesh successfully.

In my case, I try to simulate the flow past a cylinder by using the IB method. I would like to calculate, for instance:
Code:

        type swakExpression;
        valueType patch;
        patchName ibCylinder;
        accumulations (
            sum
        );
        expression "(vorticity^normal())&vectorAconst*area()";
        verbose true;

I tried to integrate this variable over the cylinder surface in each timeStep, but unfortunately I obtain always zero.

How do you think I could manage this issue?
Any help would be appreciated.

Thanks!


All times are GMT -4. The time now is 01:26.