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/)
-   -   Add a source term into a openfoam Solver (https://www.cfd-online.com/Forums/openfoam-programming-development/162637-add-source-term-into-openfoam-solver.html)

meth November 14, 2015 17:50

Add a source term into a openfoam Solver
 
Hi,

I am going to use a non inertial reference frame for the fluid. In that case I have to add the acceleration of the frame into the Navier Stokes equations. Acceleration is uniform across the fluid and time varying. I am going to threat it as a force term. I know how to updates the boundary condition, but I don't know how to update the internal field. Can you please give your ideas and references.

Thank you

Methma

meth November 15, 2015 18:58

Actually I could do it.

The acceleration of the frame was defined as a field variable "ddy", I gave fixed value boundary condition for all boundaries. I updated the internal field by

Code:

          ddy =  dimensionedVector("myddy", dimAcceleration, vector(0,sddy,0));
where "sddy" is the acceleration on y direction calculated inside the solver in each time step. Boundary conditions are also updated with vector(0,sddy,0).

best,

Methma

jinheng September 29, 2016 20:27

Quote:

Originally Posted by meth (Post 573339)
Hi,

I am going to use a non inertial reference frame for the fluid. In that case I have to add the acceleration of the frame into the Navier Stokes equations. Acceleration is uniform across the fluid and time varying. I am going to threat it as a force term. I know how to updates the boundary condition, but I don't know how to update the internal field. Can you please give your ideas and references.

Thank you

Methma

hi meth,
i see you have solved your problem. I also want to add a acceleration into NS equation. But without any experience. Actually, I wanna use a horizontal acceleration replace moving dynamic mesh to excite fluid movement in a tank. Do you have any advise about that ? thx
jinheng


All times are GMT -4. The time now is 21:55.