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/)
-   -   Adding gravitational acceleration inside a turbulence model (https://www.cfd-online.com/Forums/openfoam-programming-development/210610-adding-gravitational-acceleration-inside-turbulence-model.html)

sinatahmooresi October 31, 2018 04:02

Adding gravitational acceleration inside a turbulence model
 
Hi dear Foamers!
I want to add g (gravity) to my own turbulence model.
As far as I know and considering what I’ve done before in solver modification, adding g consist of two steps:
1 : adding
#include "readGravitionalAcceleration.H" in creatField.H or Ueqn.H (depend on where you are using g).

2: adding
g file inside the constant directory of running case.

But what if I want to make my own turbulence model read g?
is it possible to define it like a local dimensionedScalar but as volVectorField?

Regards

sinatahmooresi October 31, 2018 05:05

Hi I just found that it could be done like this:


dimensionedVector g
(
"g"
dimensionSet (0, 1, -2, 0, 0),
vector (0, -9.81, 0)
);
I just have another question. I want to use the transpose of g. As I know it can be done by : g.T()
applying this makes error !


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