CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   source term (https://www.cfd-online.com/Forums/main/198012-source-term.html)

yassi271 January 24, 2018 02:30

source term
 
Hi,
I need to add following term to energy equation as my energy source in openFoam:
Se=-rho*cp*Gamma*Uy
rho=density
cp=specific heat
Gamma=laps rate
Uy=y_component of velocity

also i need t add a source term to momentum and continuity equation like:
Sm=c*f1(y)
c= dimensional constant
f1(y)=a function of y-coordinate



it is straight-forward in FLUENT, but after several day searching , i couldn't find any answer in openfoam

LuckyTran January 24, 2018 12:38

It requires you to do some OF coding yourself. Two ways that I know of:

Modify the solver directly and re-compile it. So look in E***.H depending on what form of energy equation you are solving. Then somehow modify UEqn.H to your needs.

The other approach, probably more elegant, is to make an fvOptions dict.

However, I'm not sure if adding a mass and momentum source is as straightforward as this seems, how does the pressure correction equation change? One would need to check.

yassi271 January 24, 2018 14:32

thanks luckytran,
In atmospheric boundary layer, in order to resolve gravity waves i should add those source terms in upper boundary layer. In fluent they worked very well.


All times are GMT -4. The time now is 12:05.