CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Programming & Development (
-   -   custom transport properties (

mpeti October 12, 2011 10:08

custom transport properties
Dear forum members,

I am new to OpenFoam, and thus this question might be trivial. I have followed the tutorial slides to solve the advection diffusion equation for a field being carried along by a fluid using the intermediate velocity fields of the simulation. The problem is, that in the tutorial the same value is used as the diffusivity of the transport field as is the kinematic viscosity of the fluid. (nu in transportProperties)

What I would like to achieve is to have two distinct parameters, one for the kinematic viscosity (nu) of the fluid, and one for the diffusivity (kappa), so that they can be set independently. Could anyone please tell me how to achieve this? So how can I manage to get a variable available in the main solver code that corrsponds to the diffusivity parameter and is being loaded from one of the dictionary files (for example the transportProperties)?


cliffoi October 28, 2011 18:12

It's straightforward, add as many variables as you like as follows...

dimensionedScalar nu(transportPropertiesDict.lookup("nu"));
dimensionedScalar kappa(transportPropertiesDict.lookup("kappa"));
dimensionedVector gravity(transportPropertiesDict.lookup("g"));

OpenFOAM will automatically scan the dictionary for all the keywords and assign them to the variables.

All times are GMT -4. The time now is 22:36.