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/)
-   -   Making density dependent on concentration (https://www.cfd-online.com/Forums/openfoam-solving/81857-making-density-dependent-concentration.html)

NewFoamer November 9, 2010 04:53

Making density dependent on concentration
 
Hello,

My current solver is based on the incompressible pimpleFoam, in which I've added a solver for solute concentration C:

Code:

solve
    (
    fvm::ddt(C)
    + fvm::div(phi, C)
    - fvm::laplacian(Diff, C)
    );

Now, I would like to have the fluid density depend on the solute concentration according to:

Code:

rho = base_value + rho_factor * C
Not having much experience with OpenFOAM, I'm a bit in the dark about how to go about implementing this. I can't claim to fully understand the compressible solvers I've looked at yet, but I'm not sure I have to go there either? Already having the C field in place, it shouldn't be neccesary to create a rho field as well? given the simple relation that is.

Currently, the momentum equation is solved as follows:

Code:

tmp<fvVectorMatrix> UEqn
(
    fvm::ddt(U)
  + fvm::div(phi, U)
  + turbulence->divDevReff(U)
);

Basically, the question is, how do I go about implementing this? any hints or help would be appreciated!

pbohorquez November 9, 2010 13:17

Have a look at settlingFoam, which implements a solver for the transport of solid particles in an incompressible fluid by means of a mixture model. The description of the solver can be found in Brennan's thesis. Maybe these resources will inspire you :)

NewFoamer November 18, 2010 09:21

I've been going through settlingFoam, however I'm still having difficulties getting this to work - whatever approach I take, I end up with a dead-end. This seems like something that should be simple to implement? Any more help would be appreciated..


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