|
[Sponsors] |
July 20, 2011, 10:07 |
transportModels/viscosityModels
|
#1 |
New Member
Maike
Join Date: Dec 2010
Posts: 8
Rep Power: 15 |
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. |
|
|
|