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

Implementing new viscosity model

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Mahyar Javidi

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   February 16, 2009, 22:03
Default Hello, I am trying to imple
  #1
New Member
 
Peter Johnston
Join Date: Mar 2009
Location: Brisbane, Queensland, Australia
Posts: 25
Rep Power: 17
prjohnston is on a distinguished road
Hello,

I am trying to implement a generalised power law model for blood viscosity (Ballyk et al, Biorheology, 31 (5), pp 565-586 (1994). In this model the exponent in the power law is a function of the local strain rate. My implemented calcNu() funciton is:

// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //

Foam::tmp<foam::volscalarfield>
Foam::viscosityModels::GeneralisedPowerLaw::calcNu () const
{
tmp<volscalarfield> sr(strainRate());
return ((nu0_*exp(-(scalar(1)+(sr())/a_)*exp(-b_/(sr())))+nuInf_)*pow(sr(),(nInf_-n0_*e xp(-(scalar(1)+sr()/c_)*exp(-d_/sr()))-scalar(1))));
}

Unfortunately, this fails to compile giving the following error messages:
wmake
Making dependency list for source file viscosityModels/GeneralisedPowerLaw/GeneralisedPowerLaw.C
SOURCE=viscosityModels/GeneralisedPowerLaw/GeneralisedPowerLaw.C ; g++ -m32 -Dlinux -DDP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-40 -I.. -I/home/peter/OpenFOAM/OpenFOAM-1.5/src/finiteVolume/lnInclude -IlnInclude -I. -I/home/peter/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude -I/home/peter/OpenFOAM/OpenFOAM-1.5/src/OSspecific/Unix/lnInclude -fPIC -pthread -c $SOURCE -o Make/linuxGccDPOpt/GeneralisedPowerLaw.o
/home/peter/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude/GeometricScalarField.C: In function 'Foam::tmp<foam::geometricfield<double,> > Foam::pow(const Foam::GeometricField<double,>&, const Foam::tmp<foam::geometricfield<double,> >&) [with PatchField = Foam::fvPatchField, GeoMesh = Foam::volMesh]':
viscosityModels/GeneralisedPowerLaw/GeneralisedPowerLaw.C:61: instantiated from here
/home/peter/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude/GeometricScalarField.C: 220: error: no matching function for call to 'Foam::dimensioned<double>::dimensioned(const char [2], double, const Foam::dimensionSet&)'
/home/peter/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude/dimensionedType.C:112: note: candidates are: Foam::dimensioned<type>::dimensioned(const Foam::word&, const Foam::dimensionSet&, Foam::Istream&) [with Type = double]
/home/peter/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude/dimensionedType.C:98: note: Foam::dimensioned<type>::dimensioned(const Foam::word&, Foam::Istream&) [with Type = double]
/home/peter/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude/dimensionedType.C:85: note: Foam::dimensioned<type>::dimensioned(Foam::Istream &) [with Type = double]
/home/peter/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude/dimensionedType.H:95: note: Foam::dimensioned<type>::dimensioned(const Type&) [with Type = double]
/home/peter/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude/dimensionedType.C:73: note: Foam::dimensioned<type>::dimensioned(const Foam::word&, const Foam::dimensioned<type>&) [with Type = double]
/home/peter/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude/dimensionedType.C:60: note: Foam::dimensioned<type>::dimensioned(const Foam::word&, const Foam::dimensionSet&, Type) [with Type = double]
/home/peter/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude/dimensionedScalarFwd.H: 42: note: Foam::dimensioned<double>::dimensioned(const Foam::dimensioned<double>&)
make: *** [Make/linuxGccDPOpt/GeneralisedPowerLaw.o] Error 1


I believe the error is due to the fact that in the function pow(a,b), b must be a scalar. In my model b would be a volScalarField (I think).

Is there some way to overcome this problem? Perhaps I have misinterpreted the error messages and there is something else wrong. Any insights would be appreciated.

Thanks,

Peter.
prjohnston 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
How to modify the viscosity model mpml OpenFOAM Running, Solving & CFD 4 October 13, 2010 07:44
Power Law Viscosity Model cpplabs OpenFOAM Running, Solving & CFD 1 February 13, 2008 08:09
best viscosity turbulent model? Greg FLUENT 2 October 5, 2007 08:59
Which SGS viscosity model is most popular in LES? leaf Main CFD Forum 1 August 1, 2006 05:04
New viscosity model henry OpenFOAM Running, Solving & CFD 2 July 29, 2005 08:57


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