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/)
-   -   Help with new viscosity modell (http://www.cfd-online.com/Forums/openfoam-solving/63175-help-new-viscosity-modell.html)

Mikro March 31, 2009 08:54

Help with new viscosity modell
 
Hello everyone,

I'm trying to implement a new viscosity modell for blood (well several acctually) and i'm having a problem with this one: (Powell-Eyring modell)

nuInf_+(nu0_-nuInf_)*scalar(1)/(sinh(lambda_*strainRate())*lambda_*strainRate());


The linking of the library goes without any problem, it's when i run nonNewtonianIcoFoam that the solver crashes, I was hoping that someone with better knowledge in OpenFoam might tell me were the problem is...:confused:
This is errors i get when i try to run it, incase it helps anyone to se it better...


#0 Foam::error::printStack(Foam::Ostream&)
#1 Foam::sigFpe::sigFpeHandler(int)
#2 Uninterpreted: [0xb7fd7420]
#3 Foam::divide(Foam::Field<double>&, double const&, Foam::UList<double> const&)
#4 void Foam::divide<Foam::fvPatchField, Foam::volMesh>(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>&, Foam::dimensioned<double> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&)
#5 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&)
#6 Foam::viscosityModels::PowellEyring::calcNu() const
#7 Foam::viscosityModels::PowellEyring::PowellEyring( Foam::word const&, Foam::dictionary const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::surfaceMesh> const&)
#8 Foam::viscosityModel::adddictionaryConstructorToTa ble<Foam::viscosityModels::PowellEyring>::New(Foam ::word const&, Foam::dictionary const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::surfaceMesh> const&)
#9 Foam::viscosityModel::New(Foam::word const&, Foam::dictionary const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::surfaceMesh> const&)
#10 Foam::singlePhaseTransportModel::singlePhaseTransp ortModel(Foam::GeometricField<Foam::Vector<double> , Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::surfaceMesh> const&)
#11 main
#12 __libc_start_main
#13 __gxx_personality_v0 at ../sysdeps/i386/elf/start.S:122

Also i might poit out that this is the sixth modell i'v done, and the other five work perfectly fine with nonNewtonianIcoFoam...

juho March 31, 2009 10:27

It's a divide by zero.

#1 Foam::sigFpe::sigFpeHandler(int)
Fpe = floating point exception

#3 Foam::divide(Foam::Field<double>&, double const&, Foam::UList<double> const&)
"divide"


I'm not 100% about the syntax, but you should use something like:

dimensionedScalar small('small', dimensionSet(<correct dimensions>),1e-10);

.../max(small, ...)

Mikro April 1, 2009 08:21

thanks for the help, i tried the way u'v suggested, but it's still not correct...


All times are GMT -4. The time now is 14:33.