- **OpenFOAM Running, Solving & CFD**
(*http://www.cfd-online.com/Forums/openfoam-solving/*)

- - **conpressibleInterFoam for non-isothermal non-newtonian high-viscous flows**
(*http://www.cfd-online.com/Forums/openfoam-solving/76601-conpressibleinterfoam-non-isothermal-non-newtonian-high-viscous-flows.html*)

conpressibleInterFoam for non-isothermal non-newtonian high-viscous flows1 Attachment(s)
Dear foamers,
I am trying to simulate two compressible, non-isothermal, non-newtonian (high viscous), laminar, and immiscible fluids flow. There is already a compressibleInterFoam solver for 2 compressible, isothermal immiscible fluids using a VOF (volume of fluid) phase-fraction based interface capturing approach. I want to create a new compressibleNonIsothermalInterFoam. Tait state equation is used to express the fuid dencity varing with temperature and pressure: |

Is it possible to modify the compressibleInterFoam solver to take the temperature into account for non-isothermal compressible laminar flows? Any suggestions will be appreciated.
Best regards, Jitao |

Adding the temperature equation to compressibleInterFoamHi Jitao.
I have succesfully implemented the temperature equation in the interFoam solver, and the procedure should be somewhat the same for the compressible case. - First you have to add the appropriate constants and fields to the createFields.H file. This is best done by looking at step 3 in the guide provided here.
- Next you should add the temperature equation to the compressibleInterFoam solver algorithm. I did this by making a new file "TEqn.H" and then included this just after the PISO loop. The contents of the "TEqn.H" i added is shown below:
Code:`volScalarField mu //dynamic viscosity (at cell centers!)` ( "mu", twoPhaseProperties.mu() );
volTensorField gradU = fvc::grad(U); //velocity gradient.
volTensorField tau = mu * (gradU + gradU.T()); // viscous stress tensor
//Temperature equation (with viscous dissipation): fvScalarMatrix TEqn (
rho * cp * (fvm::ddt(T) + fvm::div(phi,T)) - fvm::laplacian(kT,T) - ( tau && gradU ) //viscous dissipation heating. );
TEqn.solve();
You should use a compressible version of this equation, which can be found in the litterature (e.g. Transport Phenomena by R. Byron Bird et al. - ISBN: 978-0-470-11539-8). Also note that the stress tensor should be corrected to the compressible case as well, but you should consider whether it is necessary for you to add the viscous dissipation term in your application. - When this is done you should be able to compile the new solver and have a nonisothermal version of the compressibleInterFoam. Before running a case, be sure to add the appropriate boundary conditions for the temperature, as well as to choose the schemes for the new terms in "fvSchemes" and a solver algorithm in "fvSolution".
Let me know if there is any further questions! Have you implemented the Tait state equation yet? If you have, i would like to know/see how you have done this? With Kind Regards Dan |

Hi Dan,
I have added temperature field into compressibleInterFoam. The new solver works well in two-phase (polymer and air) flow simulation. Constant thermal conductivity and specifik heat are assumed in this silver. The compressiblility is implemented in pEqn.H: rho1 = rho10 + psi1*p; rho2 = rho20 + psi2*p; I am trying to take into account the effects of temperature on dencity. The aforementioned Tait state equation is such a model defining dencity as a function of temperature and pressure. Sincerely, Jitao |

Quote:
have you succeeded with the implementation of the new equation of state with temperature and pressure depending density? regards, Ilya |

Hello Dan and Jitao (and others),
I have some practical questions concerning the implementation of the heat equation. First a remark: the laplacian in the code of Dan should be fvm::laplacian(DT,T) according to step 1..right? I'm a but confused how DT and cp are calculated since both fluids have their own properties. Right now I'm adding read-terms in the "twoPhaseMixture"-files (both the .H and .C) to read these terms but I'm not sure whether this would be correct. these paramaters are then defined in the transportProperties-file? Thanks for your support, Ralph |

I realize that this thread is a little old, but I am in some desperate need of help. I'm trying to do the same thing that awacs was doing, that is implementing non-isothermal into the compressibleInterFoam solver, but am quite confused as to what to edit in the TEqn.H file. Isn't it when you account for compressibility you need to use enthalpy instead of temperature? That seems to be how all the built-in compressible solvers do for the rest of OF. I'm still trying to do it with TEqn.H, but I'm not sure how to edit it, would it be something like:
Code:
`fvScalarMatrix TEqn` Thanks Jeff |

Solving for enthalpy/internal energy instead of temperature in compressibleInterFoamQuote:
It's not even possible to create a reference to (for example) the mixture.he() field and then write your own "EEqn.H" for compressibleInterFoam - the solver will happily compile if you do this, but when you run a case you'll find that it will throw a "Not Implemented" error. This is because for some reason he as a field reference is not implemented in the twoPhaseMixtureThermo and multiPhaseMixtureThermo libraries. For example in "multiphaseMixtureThermo.H": Code:
`//- Enthalpy/Internal energy [J/kg]` -q |

All times are GMT -4. The time now is 17:49. |