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

Problem with pow and volScalarField

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 1 Post By Cyp
  • 1 Post By _Stefan_
  • 1 Post By Cyp

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   May 7, 2012, 08:15
Default Problem with pow and volScalarField
  #1
New Member
 
Join Date: Jun 2010
Location: Germany
Posts: 6
Rep Power: 15
_Stefan_ is on a distinguished road
Hi,

I want to implement an new Order to Calculate the Viscosity nu.

Ostwald Waele Potential Function

tau = k * strain rate ^n

k and n are model Parameter and depend on rho
k=a*rho+b
n=c*rho+d

I got a, b, c, d from some experiments.

The equation for the rotation rheometer:

nu = tau / strain rate

What I have done:
Code:
//read strain rate
    tmp<volScalarField> sr(strainRate());

//Parameter 
    dimensionedScalar ka_("ka_",dimensionSet(0,2,-1,0,0,0,0), 0.1202); 
    dimensionedScalar kb_("kb_",dimensionSet(1,-1,-1,0,0,0,0), 24.912); 
 
    dimensionedScalar na_("na_",dimensionSet(-1,3,0,0,0,0,0), 0.0005); 
    dimensionedScalar nb_("nb_",dimensionSet(0,0,0,0,0,0,0), 0.2246);

//read ScalarFeldes rho_ps 
    const tmp <volScalarField> & rhoCalc = U_.mesh().lookupObject<volScalarField>("rho_ps");

//calculation n and k 
    volScalarField K = ka_ * rhoCalc + kb_; 
    volScalarField N = na_ * rhoCalc + nb_;

//Calculation nu
    tmp <volScalarField> nu = K * Foam::pow(max(tone * sr(),VSMALL),N-1.);
tone is only a dimensioned scalar with 1[s] to make sr() dimensionless.

My Problem is that it did not compile.
If I change N in the pow function to an dimensioned scalar it works fine.
Is it possible that, Foam:ow (volScalarField, volScalarField) does not work?

Here the error massage:

/SimSoftware/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude/GeometricScalarField.C:189: error: no matching function for call to ‘Foam::dimensioned<double>::dimensioned(const char [2], double, const Foam::dimensionSet&)’
/SimSoftware/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude/dimensionedType.C:107: note: candidates are: Foam::dimensioned<Type>::dimensioned(const Foam::word&, const Foam::dimensionSet&, Foam::Istream&) [with Type = double]
/SimSoftware/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude/dimensionedType.C:94: note: Foam::dimensioned<Type>::dimensioned(const Foam::word&, Foam::Istream&) [with Type = double]
/SimSoftware/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude/dimensionedType.C:82: note: Foam::dimensioned<Type>::dimensioned(Foam::Istream &) [with Type = double]
/SimSoftware/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude/dimensionedType.H:95: note: Foam::dimensioned<Type>::dimensioned(const Type&) [with Type = double]
/SimSoftware/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude/dimensionedType.C:69: note: Foam::dimensioned<Type>::dimensioned(const Foam::word&, const Foam::dimensioned<Type>&) [with Type = double]
/SimSoftware/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude/dimensionedType.C:55: note: Foam::dimensioned<Type>::dimensioned(const Foam::word&, const Foam::dimensionSet&, Type) [with Type = double]
/SimSoftware/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude/dimensionedScalarFwd.H:42: note: Foam::dimensioned<double>::dimensioned(const Foam::dimensioned<double>&)

Last edited by _Stefan_; May 7, 2012 at 09:24.
_Stefan_ is offline   Reply With Quote

 


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
if statement for volScalarField AnjaMiehe OpenFOAM Programming & Development 2 April 24, 2012 07:01


All times are GMT -4. The time now is 19:02.