- **OpenFOAM**
(*https://www.cfd-online.com/Forums/openfoam/*)

- - **How to add temperature to cavitatingFoam solver**
(*https://www.cfd-online.com/Forums/openfoam/78767-how-add-temperature-cavitatingfoam-solver.html*)

How to add temperature to cavitatingFoam solverHi everyone,
I'm trying to solve a case which conjugates both multiphase flow and thermal wall. As I haven't found an appropriate solver I want to modify the cavitatingFoam solver. I just want to add an equation for temperature but I don't know how can I proceed. The "HowTo add temperature to icoFoam" tutorial of Wiki cannot help me. As anyone try to do the same thing and can help me!! Have a good day :) |

Hi,
can you explain, why this tutorial is'nt of any help? Did you try the steps. In what step did you get problems? Best Kathrin |

Hi Kathrin,
Thanks for your response. The tutorial is made for the solver icoFoam. I tought it was easy to do the same things with cavitatingFoam so I have followed all the steps without any changes. However when I try to run the case "throttle" (which is the case example of cavitatingFoam) I meet some problems of dimensions: /*---------------------------------------------------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 1.7.0 | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ Build : 1.7.0-279cc8e8233b Exec : thermalCavitatingFoam Date : Aug 03 2010 Time : 09:35:57 Host : goth PID : 4479 Case : /home/areelis/Bureau/Cynthia/tutorials/multiphase/thermalCavitatingFoam/throttle nProcs : 1 SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE). // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Create time Create mesh for time = 0 Reading thermodynamicProperties Reading field p Creating compressibilityModel Selecting compressibility model linear Reading field U Reading field T Reading/calculating face flux field phiv Reading/calculating face flux field phi Reading transportProperties Selecting incompressible transport model Newtonian Selecting incompressible transport model Newtonian expected a [ in dimensionSet in stream ITstream : /home/areelis/Bureau/Cynthia/tutorials/multiphase/thermalCavitatingFoam/throttle/constant/transportProperties::DT, line 22, IOstream: Version 2.0, format ASCII, line 22, OPENED, GOOD Selecting turbulence model type RASModel Selecting RAS turbulence model kOmegaSST kOmegaSSTCoeffs { alphaK1 0.85034; alphaK2 1; alphaOmega1 0.5; alphaOmega2 0.85616; gamma1 0.5532; gamma2 0.4403; beta1 0.075; beta2 0.0828; betaStar 0.09; a1 0.31; c1 10; } Courant Number mean: 0 max: 0 phiv Courant Number mean: 0 max: 0 acoustic max: 0.288861 Starting time loop phiv Courant Number mean: 0 max: 0 acoustic max: 0.288861 deltaT = 1.1999e-08 Time = 1.1999e-08 DILUPBiCG: Solving for rho, Initial residual = 0.613556, Final residual = 0, No Iterations 1 max-min rho: 844.998 834.998 max-min gamma: 0 0 DILUPBiCG: Solving for Ux, Initial residual = 1, Final residual = 6.34307e-16, No Iterations 2 DILUPBiCG: Solving for Uy, Initial residual = 1, Final residual = 6.50228e-16, No Iterations 2 max(U) 2.83958 GAMG: Solving for p, Initial residual = 1, Final residual = 3.69146e-06, No Iterations 1 GAMG: Solving for p, Initial residual = 9.54005e-07, Final residual = 2.36346e-10, No Iterations 1 Predicted p max-min : 3e+07 1e+07 max-min gamma: 0 0 Phase-change corrected p max-min : 3e+07 1e+07 max(U) 2.80134 GAMG: Solving for p, Initial residual = 0.00996903, Final residual = 3.67993e-08, No Iterations 1 GAMG: Solving for p, Initial residual = 3.57757e-08, Final residual = 9.03801e-12, No Iterations 1 Predicted p max-min : 3e+07 1e+07 max-min gamma: 0 0 Phase-change corrected p max-min : 3e+07 1e+07 max(U) 2.79985 DILUPBiCG: Solving for omega, Initial residual = 5.23551e-05, Final residual = 1.62015e-12, No Iterations 1 DILUPBiCG: Solving for k, Initial residual = 1, Final residual = 2.81372e-15, No Iterations 2 bounding k, min: 3.31924e-35 max: 9.99977 average: 9.99835 --> FOAM FATAL ERROR: incompatible dimensions for operation [T[0 0 -1 1 0 0 0] ] + [T[1 -3 -1 1 0 0 0] ] From function checkMethod(const fvMatrix<Type>&, const fvMatrix<Type>&) in file /opt/openfoam170/src/finiteVolume/lnInclude/fvMatrix.C at line 1194. FOAM aborting #0 Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam170/lib/linuxGccDPOpt/libOpenFOAM.so" #1 Foam::error::abort() in "/opt/openfoam170/lib/linuxGccDPOpt/libOpenFOAM.so" #2 void Foam::checkMethod<double>(Foam::fvMatrix<double> const&, Foam::fvMatrix<double> const&, char const*) in "/opt/openfoam170/applications/bin/linuxGccDPOpt/thermalCavitatingFoam" #3 Foam::tmp<Foam::fvMatrix<double> > Foam::operator+<double>(Foam::tmp<Foam::fvMatrix<d ouble> > const&, Foam::tmp<Foam::fvMatrix<double> > const&) in "/opt/openfoam170/applications/bin/linuxGccDPOpt/thermalCavitatingFoam" #4 in "/opt/openfoam170/applications/bin/linuxGccDPOpt/thermalCavitatingFoam" #5 __libc_start_main in "/lib/tls/i686/cmov/libc.so.6" #6 in "/opt/openfoam170/applications/bin/linuxGccDPOpt/thermalCavitatingFoam" Abandon So I think it's because the equation for the temperature is not the same for a multiphase flow. Can you try to help me? Thanks a lot in advance. Bests. Cynthia. |

Maybe it is something very simple
start with the first error output expected a [ in dimensionSet in stream ITstream : /home/areelis/Bureau/Cynthia/tutorials/multiphase/thermalCavitatingFoam/throttle/constant/transportProperties::DT, line 22, IOstream: Version 2.0, format ASCII, line 22, OPENED, GOOD There seems to be something wrong in your transportProperties file. Some [ is missing. Could you start with checking that? Or post your transportProperties file. If this is correct we can take the next step if necessary! Best Kathrin |

Thanks,
I didn't see that mistake. I have added the "[" but there is the same problem of dimension. I have verified the dimensions of DT and T, but I think there is no problem here. DT [ 0 2 -1 0 0 0 0] T [0 0 0 1 0 0 0] |

Ok,
could you post your implementation of the TEqn? Maybe it is something there. |

4 Attachment(s)
Of course.
Please find enclosed the implementation of T and the case "throttle" with T. Thanks a lot for your help again. Cynthia |

ok Cynthia,
in your TEqn: Do fvm::ddt(rho, T) +fvm::div(phi, T) and in a first step skip the molecular transport. You need the rho, since you are not using the incompressible icoFoam, where the equations are devided by rho. Check with your dimension error and you will get the point. This should work! I tried it myself just a minute ago. Than you can start to add the next term. If you have more questions feel free! Best Kathrin |

Thanks a lot!!!
It works well with your hints. I totally forgot that cavitatingFoam is a compressible solver and not icoFoam... However when I introduce the laplacian term, I have the same problem of dimensions. Can you explain to me this term. I'm quite new in OF and I'm not sure to understand it. Bests. Cynthia |

hello everyone,
I have tried to add the temperature equation to cavitatingFoam as explained in the tutorial of wiki, but unfortunately I have the same problems of dimensions with the laplacian term. ----------------- incompatible dimensions for operation [T[1 -3 -1 1 0 0 0] ] + [T[0 0 -1 1 0 0 0] ]#0 Foam::error::printStack(Foam::Ostream&) --------------------- Could you help me with the implementation? What can I do to solve it? Thanks. |

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