CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   icoFoam with density (https://www.cfd-online.com/Forums/openfoam-solving/157119-icofoam-density.html)

Tobi July 20, 2015 15:27

icoFoam with density
 
Dear all Foamers,

I want to ask for help, because at the moment I get stuck.

Problem:
I want to make a cavity case in which the bottom is cooled and therefore density change will force flow to compensate the density change.

The flow is incompressible and laminar, hence this, I started to modify icoFoam to my problem.

  • I implemented the passive temperature equation to get the temperature field (in my case temperature is only transported due to diffusion effects). Thus, only ddt and laplacian are in the equaion (not a big deal)
  • I implemented a new volScalarField (rho) that is updated with the temperature distribution. rho = f(T) and the function is linear (nothing special)
  • Then I added and modified the momentum equation (added rho again)
  • At least I checked the pressure equation and changed the necessary stuff for density based calculation. At least I added ddt(rho) to the pressure equation (thanks to Alex for the hint). Without that term nothing will happen. Density change but no source for the flow is generated (pressure = constant).


Till here (thanks to Alex for support).

Now my cavity case is cooled at the bottom, left right and top are opened and due to the temperature change I get a density change that should force flow to compensate this change (continuity has to be satisfied).

While solving, I get the problem, that the Co no reaches 40000 and the solution is non physical. Already the first time steps are bad (1e-7).

It would be a pleasure if someone can help me in that case, or has some information for me. I think made a mistake in the implementation of pEqn() :(

Tobi July 20, 2015 16:43

Hi all,

solved. Re-programmed all stuff @home and it work now.


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