CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Running, Solving & CFD (
-   -   How to modify the viscosity model (

mpml July 25, 2005 20:05

Hi, I am working with simpl

I am working with simpleFoam on polymer extrusion problem, using Bird-Carreau viscosity model. As is seen from source code, you used the velocity field (U) and the surface integration field (phi) to initialise the viscosity model:

autoPtr<transportmodel> laminarTransport
transportModel::New(U, phi)

My question is: how to add new factors into the viscosity model? For example, viscosity is also a function of pressure and temperature (called the WLF-Arrhenius equation).

If I want to implement this effect, I think I have to modify the sourcecode of transportModel and add pressure and/or temperature into the member functions. Can I have some guideline on the implementation? In addition, is the solution speed and convergence going to be affected seriously?

Thanks very much.

mattijs July 26, 2005 14:14

Create your own viscositymodel
Create your own viscositymodel and when you need your T look it up from the mesh (the mesh is also a database and holds all the fields on it)

Something like:

const volScalarField& T = U_.mesh().lookupObject<volscalarfield>("T");

The solution speed should not be affected. Convergence only if there is a strong temperature dependence.

sradl July 1, 2007 13:59

Hi, I've also started to

I've also started to implement a solver for polymerflow. Dissipation in that case is important - has anybody experience in adding this to the energy equation?


hartinger July 2, 2007 06:30

Hi Stefan, have a look here
Hi Stefan,

have a look here:


T.D. October 13, 2010 07:44

help please
Hi Foamers,

I was wondering, how one can directly implement a new visosityLaw even as function of a Field like "T" inside the solver directly, and without going to call the predefined viscosityModels, without even to use them.
The problem is just to re-update each time the new viscosity at the new time step due to the new values of the Field "T" .
How this can be done ?

tell me if this example is true or not, where should be the update for varables?

the Example for the problem inside the solver:

if i am solving:

//My new viscosity law as function of field T
volScalaField new_nu = 2*T-5;

fvm::ddt(T) + fvm::div(phi, T) == fvm::laplacian(new_nu, T)

thanks a lot

All times are GMT -4. The time now is 15:58.