grjmell |
June 22, 2011 06:37 |
groovyBC elevated inlet. pos() issue
1 Attachment(s)
I've got an issue with groovyBC. It makes my run crash instantly. I'm using twoPhaseEulerFoam and I have an elevated inlet (see pic), the inlet is above a wall. I want to put a logarithmic velocity profile onto that inlet. I've implemented it in groovy heres the code.
Code:
myinlet
{
type groovyBC;
variables "u_f=0.0239;z0=0.0000333;K=0.41;vel=(u_f/K)*log((pos().z)/z0)*normal();";
valueExpression "-vel";
}
This works, if the inlet goes from the bottom to the top, however it seems that when it is elevated then there is an issue with pos().z, it makes my run crash instantly with this error. When i take pos().z out, it works again, so it is not a problem with groovyBC as such. I know i need to account for pos().z not starting at zero for my profile but it should nevertheless work?
Code:
Starting time loop
Courant Number mean: 0 max: 0
Max Ur Courant Number = 0
deltaT = 0.000598802
Reading/calculating field UaMean
Reading/calculating field UbMean
Reading/calculating field alphaMean
Reading/calculating field pMean
fieldAverage: starting averaging at time 0
Time = 0.000598802
DILUPBiCG: Solving for alpha, Initial residual = 1.48592e-17, Final residual = 1.48592e-17, No Iterations 0
Dispersed phase volume fraction = 0.135285 Min(alpha) = 0 Max(alpha) = 0.6
DILUPBiCG: Solving for alpha, Initial residual = 1.48592e-17, Final residual = 1.48592e-17, No Iterations 0
Dispersed phase volume fraction = 0.135285 Min(alpha) = 0 Max(alpha) = 0.6
#0 Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam171/lib/linux64GccDPOpt/libOpenFOAM.so"
#1 Foam::sigFpe::sigFpeHandler(int) in "/opt/openfoam171/lib/linux64GccDPOpt/libOpenFOAM.so"
#2 in "/lib/libc.so.6"
#3 in "/lib/libm.so.6"
#4 log in "/lib/libm.so.6"
#5 Foam::log(Foam::Field<double>&, Foam::UList<double> const&) in "/opt/openfoam171/lib/linux64GccDPOpt/libOpenFOAM.so"
#6 Foam::log(Foam::UList<double> const&) in "/opt/openfoam171/lib/linux64GccDPOpt/libOpenFOAM.so"
#7 parserPatch::PatchValueExpressionParser::parse() in "/home/gjm1v07/OpenFOAM/gjm1v07-1.7.1/lib/linux64GccDPOpt/libswak4FoamParsers.so"
#8 Foam::PatchValueExpressionDriver::parse(std::string const&) in "/home/gjm1v07/OpenFOAM/gjm1v07-1.7.1/lib/linux64GccDPOpt/libswak4FoamParsers.so"
#9 Foam::CommonValueExpressionDriver::evaluateVariable(Foam::word const&, Foam::string const&) in "/home/gjm1v07/OpenFOAM/gjm1v07-1.7.1/lib/linux64GccDPOpt/libswak4FoamParsers.so"
#10 Foam::CommonValueExpressionDriver::addVariables(Foam::string const&, bool) in "/home/gjm1v07/OpenFOAM/gjm1v07-1.7.1/lib/linux64GccDPOpt/libswak4FoamParsers.so"
#11 Foam::CommonValueExpressionDriver::addVariables(Foam::List<Foam::string> const&, bool) in "/home/gjm1v07/OpenFOAM/gjm1v07-1.7.1/lib/linux64GccDPOpt/libswak4FoamParsers.so"
#12 Foam::groovyBCFvPatchField<Foam::Vector<double> >::updateCoeffs() in "/home/gjm1v07/OpenFOAM/gjm1v07-1.7.1/lib/linux64GccDPOpt/libgroovyBC.so"
#13 Foam::fvMatrix<Foam::Vector<double> >::fvMatrix(Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>&, Foam::dimensionSet const&) in "/opt/openfoam171/applications/bin/linux64GccDPOpt/twoPhaseEulerFoam"
#14
in "/opt/openfoam171/applications/bin/linux64GccDPOpt/twoPhaseEulerFoam"
#15 __libc_start_main in "/lib/libc.so.6"
#16
in "/opt/openfoam171/applications/bin/linux64GccDPOpt/twoPhaseEulerFoam"
Floating point exception
|