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

transportModels/viscosityModels

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

Reply
 
LinkBack Thread Tools Display Modes
Old   July 20, 2011, 10:07
Default transportModels/viscosityModels
  #1
New Member
 
Maike
Join Date: Dec 2010
Posts: 8
Rep Power: 6
mugi is on a distinguished road
Dear all,

I try to implement a new transport model 'myPowerLaw'. The viscosity should be dependent on the Temperature. I created a myPowerLaw.C and a myPowerLaw.H. I get the Temperaturefield via

const volScalarField& T; (in .H)

T
(
U_.mesh().lookupObject<volScalarField>("T")
), (in.C)

I initiated nu_ as
volScalarField nu_; (in .H)


and as IOobject

nu_
(
IOobject
(
name,
U_.time().timeName(),
U_.mesh(),
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
// U.mesh(),
calcNu()
)
(in .C)


Furtheron I defined the function calc(Nu) as follows:

Foam::tmp<Foam::volScalarField>
Foam::viscosityModels::myPowerLaw::calcNu() const
{
return nuZero_*exp(22-(1/80)*T/TZero_);
}

(just a simple function for testing...)

It is compiling and running fine, but the problem is that I get only one single value for nu at every position of the mesh!!! And it is also not changing with time... So I need to tell the code to recalculate the viscosity in every timestep and to calculate the viscosity for each cell dependent on the Temperature that is in the certain cell.

I'm still new in OpenFOAM and I have no Idea how to do that! I would be very thankfull for any help!!!

Cheers,
Maike.
mugi 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



All times are GMT -4. The time now is 07:18.