how to convert to dimensionless scalar in openfoam
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 nondimensioned variable which is calculated by this //formula : ci = ((0.0076*ln(sizegamadot) + 0.0385)/0.1876)^1.998 volScalarField ci = Foam::pow( ((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. 
Quote:

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) ); Cheers, L 

I am trying to implement an additional source term in energy equation, please suggest me the bug in my code.
Required Source term: 0.5*(1tanh^2((TmT)/epsilon))/epsilon I have placed a code Code:
{ How can i get it in a better way, i thought writing tanhx in exponential form but the same bug HTML Code:
FOAM FATAL ERROR: Thanks in Advance Rohith 
Hi Rohith,
The error is related the remark I give above: Quote:
Also, I think you mean Code:
(tanh((TmT)/epsilon)))^2 Cheers, L 
Hi Lieven
I even don't want the (TmT)/epsilon to become dimensionless, however by using T.value(), it says that this scalar field doesn't have a member of this kind. how about converting the hyperbolic function into exponential and writing it? what do you think, i have tried it but the exp (temperature) must work, but theoretically it is not working for me Greetings Rohith 
Hi,
value is a method of dimensionedScalar, volScalarField has field method (http://foam.sourceforge.net/docs/cpp...873157f6ed35c3). Also instead of Code:
dimensionSet(0, 0, 0, 0, 0, 0 ,0) Code:
dimensionedScalar epsilon 
Hi
Ya it is not a big question here, i may be have used scalar(0.05) or dimless you are right, i will refine it. But the main issue concerns to the implementation of the equation described above Ideas? Greetings RR 
Well,
First of all OpenFOAM is right and there's no such thing as exponent of kelvins. Argument of transcendent function should be dimensionless. Concerning your equation, you can 1. Set dimension of epsilon to the temperature, as (I guess) it is the melting temperature range. So (Tm  T)/epsilon will be dimensionless. 2. Use T.field(), Tm.value() and epsilon.value() if you insist on them being dimensioned. Though it was suggested by Lieven. 
Hi
The second one doesnt work, but first one can be used with some more alterations. Greetings RR 
All times are GMT 4. The time now is 06:35. 