CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   repeating variables in one equation (https://www.cfd-online.com/Forums/openfoam-programming-development/128213-repeating-variables-one-equation.html)

mehrdad_kbg January 6, 2014 21:37

repeating variables in one equation
 
I am trying to introduce Cf as a volScalarField but I get errors when I compile the code. The issue is that there is another Cf in the right hand side of the equation!

volScalarField Cf = 1.0/(((mm*ubulk/nul)*Cf)/0.435+5.05);

When I remove the Cf from the right hand side every thing works well. Any idea about writing this equation in OpenFOAM format?
Thanks.

Azur January 8, 2014 06:06

The problem is not the equation. You can modify variables in this way.

But first you have to define Cf before you can use it on the right hand side of the equation.



Code:

// define Cf
volScalarField Cf = ...here an initial expression

// modify Cf
Cf = 1.0/(((mm*ubulk/nul)*Cf)/0.435+5.05);

Micha


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