|
[Sponsors] |
[swak4Foam] groovyBC and the pow(x,y) function |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
November 21, 2011, 06:03 |
groovyBC and the pow(x,y) function
|
#1 |
Senior Member
Roman Thiele
Join Date: Aug 2009
Location: Eindhoven, NL
Posts: 374
Rep Power: 20 |
Hej,
I wanted to implement a velocity profile with groovyBC. Unfortunately, for some reason I cannot use the pow(x,y) with a non integer :-) the following is supposed to be implemented for the velocity Code:
inlet { type groovyBC; variables "a=0.39556664;b=2.671836655;distance=0.015-sqrt(sqr(pos().y)+sqr(pos().x));"; valueExpression "vector(0,0,b*pow(distance,0.39556664))"; value uniform (0 0 0); } Code:
#0 Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/libOpenFOAM.so" #1 Foam::sigFpe::sigHandler(int) in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/libOpenFOAM.so" #2 in "/lib/x86_64-linux-gnu/libc.so.6" #3 in "/lib/x86_64-linux-gnu/libm.so.6" #4 Foam::pow(Foam::Field<double>&, Foam::UList<double> const&, double const&) in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/libOpenFOAM.so" #5 Foam::pow(Foam::UList<double> const&, double const&) in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/libOpenFOAM.so" #6 parserPatch::PatchValueExpressionParser::parse() in "/home/roman/OpenFOAM/roman-2.0.1/platforms/linux64GccDPOpt/lib/libswak4FoamParsers.so" #7 Foam::PatchValueExpressionDriver::parse(std::string const&) in "/home/roman/OpenFOAM/roman-2.0.1/platforms/linux64GccDPOpt/lib/libswak4FoamParsers.so" #8 Foam::groovyBCFvPatchField<Foam::Vector<double> >::updateCoeffs() in "/home/roman/OpenFOAM/roman-2.0.1/platforms/linux64GccDPOpt/lib/libgroovyBC.so" #9 Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>::GeometricBoundaryField::updateCoeffs() in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/libfiniteVolume.so" #10 Foam::fvMatrix<Foam::Vector<double> >::fvMatrix(Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::dimensionSet const&) in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/libfiniteVolume.so" #11 Foam::fv::gaussLaplacianScheme<Foam::Vector<double>, double>::fvmLaplacianUncorrected(Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&) in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/libfiniteVolume.so" #12 Foam::fv::gaussLaplacianScheme<Foam::Vector<double>, double>::fvmLaplacian(Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&) in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/libfiniteVolume.so" #13 Foam::fv::laplacianScheme<Foam::Vector<double>, double>::fvmLaplacian(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&) in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/libfiniteVolume.so" #14 Foam::tmp<Foam::fvMatrix<Foam::Vector<double> > > Foam::fvm::laplacian<Foam::Vector<double>, double>(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::word const&) in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/libincompressibleTurbulenceModel.so" #15 Foam::tmp<Foam::fvMatrix<Foam::Vector<double> > > Foam::fvm::laplacian<Foam::Vector<double>, double>(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&) in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/libincompressibleTurbulenceModel.so" #16 Foam::incompressible::RASModels::qZeta::divDevReff(Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>&) const in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/libincompressibleRASModels.so" #17 in "/opt/openfoam201/platforms/linux64GccDPOpt/bin/buoyantBoussinesqSimpleFoam" #18 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6" #19 in "/opt/openfoam201/platforms/linux64GccDPOpt/bin/buoyantBoussinesqSimpleFoam" Floating point exception
__________________
~roman |
|
November 21, 2011, 14:57 |
|
#2 | ||
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Quote:
My first suspicion: are you sure that all values of distance are bigger than 0? Because pow(x,0.3955) with negative x does NOT evaluate to a real number (which might be the cause for the FPE) |
|||
November 22, 2011, 03:35 |
|
#3 |
Senior Member
Roman Thiele
Join Date: Aug 2009
Location: Eindhoven, NL
Posts: 374
Rep Power: 20 |
Sorry, I didn't wanna insult the swak4foam lib i personally like it alot :-)
I just found my mistake, thanks for the tip with the negative value input for x. Will do a bug report.
__________________
~roman |
|
|
|