CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Source term addition (http://www.cfd-online.com/Forums/openfoam-solving/58869-source-term-addition.html)

 kaleekun May 21, 2008 02:23

I have read all the previous t

I have read all the previous threads on source term addition.

My problem is this....

I have to add a source term in the mass conservation equation. This source term is a function of local 'y' co-ordinate and also local 'Uy' (y-component of U)
Lets say, for example....
ddt(rho) + div(phi) == -(rho*Uy)/y

How to add this source term on the right hand side

 gschaider May 21, 2008 04:11

For the correct addition of a

For the correct addition of a massSource have a look at the dieselFoam-sources.

 kaleekun May 21, 2008 07:47

hi, i have taken a look at it.

hi, i have taken a look at it...
but still i have the problem when I multiply local Uy and local y co-ordinate....

I think i face problem while accessing the local Uy and y-coordinate..

 kaleekun May 21, 2008 08:50

What I meant is, I still could

What I meant is, I still couldn't figure out how to get the y co-ordinates in an array, so that i can manipulate to the right of the equation....

Can any one elaborate on this. Awaiting a reply

 su_junwei May 21, 2008 09:00

Hi Kun try y=mesh.C().com

Hi Kun

try
y=mesh.C().component(1);

Su Junwei

 ash May 21, 2008 09:24

So same can be done with Uy co

So same can be done with Uy component also... right

http://www.cfd-online.com/OpenFOAM_D...part/happy.gif I am extrememly happy

Uy=U().component(2);

or should i add like this

Uy=mesh.U().component(2)

 ngj May 21, 2008 12:32

Hi Aurun Please note that t

Hi Aurun

Please note that the components run from 0, thus:

x:= component(0)
y:= component(1)
z:= component(2)

with := meaning defined as.

Best regards,

Niels

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