CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

how to convert to dimensionless scalar in openfoam

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   April 8, 2013, 06:40
Default how to convert to dimensionless scalar in openfoam
  #1
New Member
 
mehdi
Join Date: Nov 2010
Posts: 11
Rep Power: 4
mehdi kamyabi is on a distinguished road
Dear OpenFoamers

I'm already trying to write a code for simulating conformational rheological problems.
my code is complied well but when I try to use it this error appears:

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

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


I found the source of error may exist in these lines of my code:

//size of shear rate tensor (which is dimensioned scalar)
volScalarField sizegamadot = Foam::sqrt ( 0.5 * (twoD && twoD) );

//ci is a non-dimensioned variable which is calculated by this
//formula : ci = ((-0.0076*ln(sizegamadot) + 0.0385)/0.1876)^1.998

volScalarField ci = Foam:ow( ((-0.0076 * Foam::log (sizegamadot)) + 0.0385) / 0.1876 ) ,1.998 );

// solving equation for a.
tmp<fvSymmTensorMatrix> aEqn
(
fvm::ddt(a_)
== keisi * ( (twoD & a_) + (a_ & twoD) ) + 4 * ci * sizegamadot * (I_ - 3*a_)
);

aEqn().relax();
solve(aEqn);


where keisi is a dimensionless scalar ,a_ is dimensionless tensor , twoD is shear rate tensor ( dimesnion = grad velocity = 1/s ) and I_ is identity tensor(dimensionless)

although ci is dimensionless in real world but this formula makes openFoam to consider it as a dimensioned scalar.(I don't know really why it happens?!! )

however, my question is how i should convert ci in to a dimensionless scalar which can be use in the aEqn?
any help would be appreciated.
mehdi kamyabi is offline   Reply With Quote

Old   April 20, 2013, 23:35
Default
  #2
New Member
 
Chris Prohoda
Join Date: Mar 2013
Posts: 6
Rep Power: 2
cpro is on a distinguished road
Quote:
Originally Posted by mehdi kamyabi View Post
--> FOAM FATAL ERROR:
Argument of transcendental function not dimensionless

//size of shear rate tensor (which is dimensioned scalar)
volScalarField sizegamadot = Foam::sqrt ( 0.5 * (twoD && twoD) );

//ci is a non-dimensioned variable which is calculated by this
//formula : ci = ((-0.0076*ln(sizegamadot) + 0.0385)/0.1876)^1.998

volScalarField ci = Foam:ow( ((-0.0076 * Foam::log (sizegamadot)) + 0.0385) / 0.1876 ) ,1.998 );
The formula for ci looks like it should be dimensionless. However, it looks like sizegamadot has dimensions of 1/s, which means it isn't a valid argument for log. That may be what the error message means. Hope that helps.
cpro is offline   Reply With Quote

Old   April 21, 2013, 03:31
Default
  #3
Senior Member
 
Lieven
Join Date: Dec 2011
Location: Mol, Belgium
Posts: 155
Rep Power: 4
Lieven is on a distinguished road
Cpro is right, sizegamadot is not dimless and this is causing the problem.

The easiest way of solving this, is by writing something as
Code:
volScalarField sizegamadot =  Foam::sqrt ( 0.5 * (twoD && twoD) );

dimensionedScalar one = ("one",1/sizegamadot.dimensions(),1.0);

volScalarField ci = Foam::pow( ((-0.0076 * Foam::log (one*sizegamadot)) + 0.0385) / 0.1876 ) ,1.998 );
Normally however, correlations are usually set up such that the transcendental functions arguments are dimensionless. Before applying the fix above, make sure this is not the case for you (cause the fix is basically bypassing the dimensions check in OF).

Cheers,

L
Lieven is offline   Reply With Quote

Old   May 3, 2013, 09:11
Default
  #4
New Member
 
mehdi
Join Date: Nov 2010
Posts: 11
Rep Power: 4
mehdi kamyabi is on a distinguished road
Dear cpro & Lieven

thank you so for your valuable answers...it helped me so much.
mehdi kamyabi is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Specifying nonuniform boundary condition maka OpenFOAM Running, Solving & CFD 51 November 6, 2012 07:47
To convert Mesh from OpenFoam to GMSH gara1988 OpenFOAM Running, Solving & CFD 1 October 12, 2012 09:43
How to convert a mesh into openfoam format jr33 OpenFOAM Meshing & Mesh Conversion 1 October 2, 2012 17:20
Solving for an additional species CO in coalChemistryFoam N. A. OpenFOAM 1 August 11, 2010 11:52
dieselFoam problem!! vivek070176 OpenFOAM 7 August 4, 2010 15:29


All times are GMT -4. The time now is 22:48.