# turbFoam solver with heat-transfer?

 Register Blogs Members List Search Today's Posts Mark Forums Read

 July 4, 2009, 22:38 turbFoam solver with heat-transfer? #1 Member   Sven Schweikert Join Date: Jun 2009 Posts: 38 Rep Power: 10 Sponsored Links Hallo out there. I would like to set up a case of incomp. turbulent channel flow with heat-transfer. Is there a way of implementing the energy equation in the standard turbFoam solver? Has anyone experiences with this topic? Is there another better way to compute an incomp. turbulent flow with heat-transfer? Thanks so much - svens

 July 6, 2009, 10:53 #2 Senior Member   Henrik Rusche Join Date: Mar 2009 Location: Braunschweig, Niedersachsen, Germany Posts: 277 Rep Power: 11 Dear Sven, please have a look here http://openfoamwiki.net/index.php/Ho...ure_to_icoFoam Henrik

 July 8, 2009, 22:34 #3 Member   Sven Schweikert Join Date: Jun 2009 Posts: 38 Rep Power: 10 Hello together & hello Henrik - thanks for your reply. I did what you said and it works - at least without adding the turbulent thermal diffusivity. And exactly here is my present problem which also shows me my huge lack of C++ knowledge (I'll promise I am going to work on that issue)... But so far I would be really greatful about some inspiration on this topic: I added an energy equation to the turbFoam.C code-file like this: Code: ``` fvScalarMatrix TEqn ( fvm::ddt(T) + fvm::div(phi, T) - fvm::laplacian(DTEff, T) ); TEqn.solve();``` DTEff is my formulation for the turbulent thermal diffusivity (= nut/Pr_t+nu/Pr). I had a look where the other diffusivities had been implemented and found out that they are initialed in the respective turbulence model which is in my case a k-epsilon-model. Orientated at the DkEff and DepsilonEff I added: Code: ``` tmp DTEff() const { return tmp ( new volScalarField("DTEff", 1/0.85 * nut_ + nu()) ); }``` to a copied kEpsilon.H header-file (0.85 is the value of the turbulent Prandtle-Number Pr_t). At the moment I am trying to connect this new turbulent thermal diffusivity via the RASModel files (-.C & -.H) to the modified turbFoam.C code-file where I want to use DTEff. Sadly all my attempts failed so far. How do I have to formulate DTEff to use it in my turbFoam.C file? I would be so thankful if someone could help me with this problem. Regards - Sven

 July 9, 2009, 04:14 #4 Senior Member   Henrik Rusche Join Date: Mar 2009 Location: Braunschweig, Niedersachsen, Germany Posts: 277 Rep Power: 11 Dear Sven, there is no need to change the turbulence model to solve your problem. But if you go that route, it is essential to change the base class (RASmodel.H) to give access to the effective turbulent thermal diffusivity. Basically you need this line in RASmodel.H: Code: `virtual tmp DTEff() const = 0;` You would then call turbulence.DTEff() when constructing the temperature equation. However, this changes the library and you need to keep it up-to-date with future releases to OF. Alternatively, I would simply add the following line to your version of turbFoam.C Code: ```volScalarField DTEff = turbulence.nut()/0.85 + laminarTransport.nu();``` It would be great if you could you add this wisdom to the Wiki for future generations ;-) Henrik

 July 9, 2009, 14:26 #5 Member   Sven Schweikert Join Date: Jun 2009 Posts: 38 Rep Power: 10 Hello Henrik - thanks for your reply. Your alternative seems to be much better than my attempts! I implemented your suggestion and received directly the next error massage while compiling the new turbFoam.C file with wmake: Code: `error: 'class Foam::autoPtr' has no member named 'nut'` Did I something wrong? Is there another way to call the nut() values then by turbulence.nut()? Thanks for your help - Sven

 July 9, 2009, 14:34 #6 Senior Member   Henrik Rusche Join Date: Mar 2009 Location: Braunschweig, Niedersachsen, Germany Posts: 277 Rep Power: 11 Dear Sven, sorry my fault. The turbulence model is hooked onto an autoPtr (see createFields.H) so we must dereference: turbulence->DTEff() Just like in the momentum predictor. Henrik

 July 9, 2009, 14:43 #7 Member   Sven Schweikert Join Date: Jun 2009 Posts: 38 Rep Power: 10 ...just had the same awareness! Thanks Henrik - your advices had been of huge value! Well to add this in the OF Wiki would be really great. But I guess at the moment there is still a lack of backround knowledge in my case. My next step is to run the code with an modified RAS model. I guess and hope after that I will have enough knowledge to write an reasonable Wiki article. Thanks so much Henrik! Greeting - Sven

 July 9, 2009, 18:11 #8 Senior Member   Henrik Rusche Join Date: Mar 2009 Location: Braunschweig, Niedersachsen, Germany Posts: 277 Rep Power: 11 Dear Sven, thanks for the flowers What most people on the learning curve often forget is that they have a vivid experience where they went wrong, where they needed help and what actually was the missing piece that made them struggle - and this is exactly what they could contribute. More experienced users can then correct the little mistakes and fill in the background information at a later stage. So (everybody) please use the Wiki and fill the FAQ. Henrik

 July 13, 2009, 12:09 #9 Member   Sven Schweikert Join Date: Jun 2009 Posts: 38 Rep Power: 10 Your are right Henrik - I going to do this the next days. Regards - Sven

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Stan FLUENT 22 August 14, 2017 04:09 Young CFX 5 October 6, 2008 23:17 RJamison CFX 0 July 24, 2008 12:11 Leonid Fromzel CFX 0 April 8, 2008 05:57 mech FLUENT 4 February 6, 2007 16:15