CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Question About Arrhenius viscosity (https://www.cfd-online.com/Forums/openfoam-programming-development/139398-question-about-arrhenius-viscosity.html)

nainasjdr July 23, 2014 09:02

Question About Arrhenius viscosity
 
I'm trying implment Arrhenius viscosity.

Foam::tmp<Foam::volScalarField>
Foam::viscosityModels::ArrheniusDin::calcNu() const
{
const volScalarField& T= U_.mesh().lookupObject<volScalarField>("T");
return
nu0_* exp(E_/T);
}

But when I sove my problem this messagem appear



/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.2 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
Build : 2.2.2-9240f8b967db
Exec : TemppimpleFoam
Date : Jul 23 2014
Time : 09:55:19
Host : "cp-jana"
PID : 6073
Case : /home/jana/OpenFOAM/jana-2.2.2/run/Simulacao_Temperatura/temp/Vaso50micro
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 transportProperties

Reading field p

Reading field U

Reading field T

Reading/calculating face flux field phi

Selecting incompressible transport model ArrheniusDin


--> FOAM FATAL ERROR:
Argument of trancendental function not dimensionless

From function trans(const dimensionSet&)
in file dimensionSet/dimensionSet.C at line 424.

FOAM aborting

#0 Foam::error::printStack(Foam::Ostream&) at ??:?
#1 Foam::error::abort() at ??:?
#2 Foam::trans(Foam::dimensionSet const&) at ??:?
#3 Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam::exp<Foam::fvPatchField, Foam::volMesh>(Foam::tmp<Foam::GeometricField<doub le, Foam::fvPatchField, Foam::volMesh> > const&) at ??:?
#4 Foam::viscosityModels::ArrheniusDin::calcNu() const at ??:?
#5 Foam::viscosityModels::ArrheniusDin::ArrheniusDin( Foam::word const&, Foam::dictionary const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&) at ??:?
#6 Foam::viscosityModel::adddictionaryConstructorToTa ble<Foam::viscosityModels::ArrheniusDin>::New(Foam ::word const&, Foam::dictionary const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&) at ??:?
#7 Foam::viscosityModel::New(Foam::word const&, Foam::dictionary const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&) at ??:?
#8 Foam::singlePhaseTransportModel::singlePhaseTransp ortModel(Foam::GeometricField<Foam::Vector<double> , Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&) at ??:?
#9
at ??:?
#10 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#11
at ??:?
Someone Can I help me?

Cyp July 23, 2014 23:04

Hi!

It seems that your variable E_ is not declared are either a dimensionedScalar or a volScalarField. So you tried to compute the exponential of a variable that has the dimension of the inverse of the temperature. Which is no sense since the exponential is dimensionless...

By the way, I also suggest you to use Foam::exp() instead of exp() in order to specify the compiler that you are going to use the overloaded exp function.

Cheers,
Cyp

nainasjdr July 27, 2014 18:24

Quote:

Originally Posted by Cyp (Post 502897)
Hi!

It seems that your variable E_ is not declared are either a dimensionedScalar or a volScalarField. So you tried to compute the exponential of a variable that has the dimension of the inverse of the temperature. Which is no sense since the exponential is dimensionless...

By the way, I also suggest you to use Foam::exp() instead of exp() in order to specify the compiler that you are going to use the overloaded exp function.

Cheers,
Cyp

E_ is a dimensionedScalar...

Cyp July 28, 2014 00:21

have you tried with Foam::exp() instead of exp() ?

nainasjdr July 28, 2014 10:20

Quote:

Originally Posted by Cyp (Post 503368)
have you tried with Foam::exp() instead of exp() ?

Yes. I tried it. But not worked



Foam::tmp<Foam::volScalarField>
Foam::viscosityModels::ArrheniusDin::calcNu() const
{
const volScalarField& T= U_.mesh().lookupObject<volScalarField>("T");
return
nu0_* Foam::exp(E_/T);
}

// Variables

dimensionedScalar nu0_;
dimensionedScalar E_;
volScalarField nu_;

Cyp July 28, 2014 16:43

and are you sure that E_ and T have the same dimension ?

nainasjdr July 28, 2014 18:16

Quote:

Originally Posted by Cyp (Post 503482)
and are you sure that E_ and T have the same dimension ?

Thank you for help me.
It's worked


All times are GMT -4. The time now is 08:28.