|
[Sponsors] |
wallHeatFlux utility for an incompressible case |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
May 18, 2012, 11:23 |
wallHeatFlux utility for an incompressible case
|
#1 |
New Member
Join Date: May 2012
Posts: 2
Rep Power: 0 |
Hello Foamers,
my current work is to simulate the heat transfer coefficient by a circular cylinder in cross-flow. If i run the case with buoyantSimpleFoam (compressible & kOmegaSST) everything is fine, i can use the wallHeatFlux utility. But if I run the case with buoyantBoussinesqSimpleFoam (incompressible & kOmegaSST) , i have several problems: 1.) How can i generate a Thermophysical model for an incompressible fluid? I can't use hRhoThermo or icoPolynomial etc. 2.) Run the case with hPsiThermo<pureMixture<constTransport<specieThermo <hConstThermo<perfectGas>>>>>; make no sense?! But OpenFoam creates in 0-directory a mut-file wich is only for compressible and writes new k and omega files with compressible wallfunctions, then it calculates for time=0 and at time=10 theres an error. Is the utility only for compressible fluids? And there must be a conflict between kOmegaSST and wallHeatFlux, because set RASModel laminar and the case run. Please help me i am a newbie in CFD regards ------------------------------------------------------------------------------ Wall heat fluxes [W] KUGEL 3.47426 Time = 10 Selecting thermodynamics package hPsiThermo<pureMixture<constTransport<specieThermo <hConstThermo<perfectGas>>>>> Reading/calculating face flux field phi Selecting RAS turbulence model kOmegaSST --> Upgrading k to employ run-time selectable wall functions Backup original k to k.old Writing updated k --> Upgrading omega to employ run-time selectable wall functions Backup original omega to omega.old Writing updated omega --> Creating mut to employ run-time selectable wall functions Writing new mut --> Creating alphat to employ run-time selectable wall functions Writing new alphat bounding k, min: 0 max: 1.1343e-09 average: 2.76378e-13 #0 Foam::error:rintStack(Foam::Ostream&) in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/libOpenFOAM.so" #1 Foam::sigFpe::sigHandler(int) in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/libOpenFOAM.so" #2 in "/lib/libc.so.6" #3 Foam::divide(Foam::Field<double>&, Foam::UList<double> const&, Foam::UList<double> const&) in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/libOpenFOAM.so" #4 void Foam::divide<Foam::fvPatchField, Foam::volMesh>(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/libcompressibleRASModels.so" #5 Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam:perator/<Foam::fvPatchField, Foam::volMesh>(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/libcompressibleRASModels.so" #6 Foam::compressible::RASModels::kOmegaSST::F2() const in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/libcompressibleRASModels.so" #7 Foam::compressible::RASModels::kOmegaSST::kOmegaSS T(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::basicThermo const&, Foam::word const&, Foam::word const&) in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/libcompressibleRASModels.so" #8 Foam::compressible::RASModel::adddictionaryConstru ctorToTable<Foam::compressible::RASModels::kOmegaS ST>::New(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::basicThermo const&, Foam::word const&) in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/libcompressibleRASModels.so" #9 Foam::compressible::RASModel::New(Foam::GeometricF ield<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::basicThermo const&, Foam::word const&) in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/libcompressibleRASModels.so" #10 in "/opt/openfoam201/platforms/linux64GccDPOpt/bin/wallHeatFlux" #11 __libc_start_main in "/lib/libc.so.6" #12 in "/opt/openfoam201/platforms/linux64GccDPOpt/bin/wallHeatFlux" Floating point exception |
|
May 18, 2012, 15:19 |
|
#2 |
New Member
Join Date: May 2012
Posts: 2
Rep Power: 0 |
I have solved my first problem and added wallHeatFluxRho, now i can use hRhoThermo etc.
But my current problem is that I can't use wallHeatFluxRho or wallHeatFlux with kOmegaSST. I tried to change pressure values from zero to 1e-12 on whole calculation field on first time step, without sucess. as in http://www.cfd-online.com/Forums/openfoam/72534-wallheatflux-utility-openfoam1-6-a.html In my opinion, this would solve my problem if openfoam don't calculate the first time step. But I need a solution for the next time steps. Nobody has an idea to solve this problem? regards |
|
May 21, 2012, 09:08 |
wallheatflux for incompressible flows
|
#3 |
Senior Member
Eelco van Vliet
Join Date: Mar 2009
Location: The Netherlands
Posts: 124
Rep Power: 19 |
Hi,
I modified the standard wallHeatflux utility which comes default with OF into a version for incompressible flows already a while ago. Also removed a bug out of the code. Well, have a look at the code, it works for me. One remark though: the utility does not seem to work when you use groovyBC for your temperature boundary conditions. It does not crash, but the resulting wall heat flux will not be correct. In case you want to use this utility in combination with groovyBC, you have to edit your results file T and change all groovyBC bc's into fixedValues (while leaving the non-uniform list of temperature at the wall as generated by groovyBC). Then the generated heatflux will be correct. Eelco |
|
May 21, 2012, 18:52 |
|
#4 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
|
||
May 23, 2012, 04:53 |
|
#5 |
Senior Member
Eelco van Vliet
Join Date: Mar 2009
Location: The Netherlands
Posts: 124
Rep Power: 19 |
I use groovyBC for the temperature (required for the heatFlux utility) only for setting gradients (for imposing either the wall heatflux or a heat transfer coeffcient). Is this possible via a non-mixed BC as well?
I noticed that all utilities (also the ones coming with OF) do not handle groovyBC correctly. A quick way for me to work around is is to change all type groovyBC; lines to type fixedValue;; using two ;;, such you can change it back easily. Use sed to do it quickly sed -ie 's/groovyBC/fixedValue;/' `find [0-9]* -name T` wallHeatFluxIncompressible sed -ie 's/fixedValue;;/groovyBC;/' `find [0-9]* -name T` Let me know if you want to report the bug on Mantis. eelco |
|
May 23, 2012, 05:23 |
|
#6 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
The problem probably is that groovyBC is not fully evaluated when being loaded. The reason is that the expression may depend on fields that are created later during startup. Also groovyBC does not force the loading of fields because it expects all fields to be in memory. Yes. Please add a bug on the Mantis. If possible add a SMALL example case with a description of the expected result ("Heatflux on patch wall should be 666") |
||
May 23, 2012, 20:47 |
|
#7 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Code:
evaluateDuringConstruction true; |
||
May 24, 2012, 09:31 |
|
#8 |
Senior Member
Eelco van Vliet
Join Date: Mar 2009
Location: The Netherlands
Posts: 124
Rep Power: 19 |
Bernard,
I just tested your suggestion. Indeed setting evaluateDuringConstruction works: the correct value is obtained for external utilities. However, I often use a field from the solver in groovyBC, for instance to use the turbulent heat diffusivity to calculate the gradT based on that. Apparently, if evaluateDuringConstruction is used, this is not allowed. If I swhich of this option the simulation runs, but erronous results for wallHeatFluxIncomressible are obtained. Replacing groovyBC with fixedValue before running wallHeatFluxIncomressible helps. I have uploaded the bug to mantis, you can get it there. But I will also upload the case here for other people to have a look at. The wall heat flux utitlity for incompressible flows is added (it does not come with OF). I noticed that it seems that there is still something wrong with the utility, because in the turbulent case the heat flux calculate is scale with a factor rho0. Perhaps the scalign with rho is done twice somehow? Do you see what goes wrong. Well anyway, perhaps there is a better workarround beside replacing groovyBC which also works with fields used in BC. Hope you can solve it Regards Eelco |
|
May 24, 2012, 11:28 |
|
#9 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
About kappat: this is a classic chicken/egg-problem in the solver: T is constructed first, the turbulence-field later (this is the reason why the evaluation does not happen during the initialization). |
||
June 1, 2012, 06:00 |
|
#10 |
Senior Member
Eelco van Vliet
Join Date: Mar 2009
Location: The Netherlands
Posts: 124
Rep Power: 19 |
For those interested: Bernard fixed a bug in groovyBC so that now it is allowed to used external applications on fields which contain groovyBC boundaries.
https://sourceforge.net/apps/mantisb...iew.php?id=134 Here I am adding the test case containing and slightly improved version of WallHeatfluxIncomressible + the test case I use to set wall heat fluxed using groovyBC. If you run the case you can see that the wall heat flux imposed is now exactly 1 W/m2 (as specified by groovyBC). Good luck! Regards Eelco |
|
June 20, 2012, 08:02 |
|
#11 |
New Member
Join Date: May 2012
Posts: 3
Rep Power: 14 |
Hi eelcovv,
thanks for the utility and test case! Now I can run the test case without problem; but I met some difficulty when trying to obtain the wall heat flux. When executing WallHeatFluxIncompressible, I got: Create time Create mesh for time = 0 Time = 0 Reading field p --> FOAM FATAL IO ERROR: cannot find file file: /home/jing/OpenFOAM/jing-2.1.0/run/testCases/hotRoomGroovyBC/0/p at line 0. From function regIOobject::readStream() in file db/regIOobject/regIOobjectRead.C at line 73. Then I checked the /0 folder; there is only p_rgh rather than p there. I checked out some old threads but am still confused. Would you give me a hint on how to get an initial p file? I'm very new to openFoam and have been learning from the forum. Thanks in advance for the help! Best regards, Jing |
|
June 26, 2012, 05:55 |
|
#12 |
Senior Member
Eelco van Vliet
Join Date: Mar 2009
Location: The Netherlands
Posts: 124
Rep Power: 19 |
Hi Jing,
The solver buoyantBoussinesqSimpleFoam uses p_rgh which is p minus the hydrostatic pressure rho*g*height. p is only later calculated and generated by the solver. So in the 0 directory it is not present yet, that's why the utility stops, because it apparently needs it. I you realy want to calculate the heat flux at time 0 (which does not make sense because the temperature field still needs to be calculated) then you can copy p_rgh to p. I actually realise that the pressure is not required for calculating the heat flux, so you can also comment out the lines in the utility that read the pressure. I checked and it works. See the new version. p is now not required anymore. Regards Eelco |
|
August 30, 2012, 19:49 |
|
#13 |
New Member
Anonymous
Join Date: Aug 2012
Posts: 8
Rep Power: 14 |
This is probably a really dumb question, but before I mess something up by attempting to add this, I wanted to double check I was doing it correctly. I've unpacked the file and placed it in the OpenFOAM-2.1.1/applications/utilities/postProcessing/wall directory. What should happen next?
(I apologize. I'm new to OpenFOAM, CFD, and C++. I'd really appreciate the help!) |
|
August 31, 2012, 05:16 |
|
#14 | |
Senior Member
Roman Thiele
Join Date: Aug 2009
Location: Eindhoven, NL
Posts: 374
Rep Power: 21 |
Quote:
Unpack the the folder into your Openfoam Folder so that you have a structure like /home/user/OpenFOAM/user-2.1.1/wallHeatFluxIncompressible where user is your username. Then navigate into this folder on a terminal and just run wmake in that directory. After a short while you have a working wallHeatFluxIncompressible utility that you can use. If you can't call it in the terminal, just re source your .bashrc or just start a new terminal. This description assumes that you installed OpenFOAM through the sources and carried out all required steps as described in http://www.openfoam.org/download/ubuntu.php
__________________
~roman |
||
September 7, 2012, 20:04 |
|
#15 |
New Member
Jack Devanney
Join Date: Sep 2012
Posts: 1
Rep Power: 0 |
Many thanks to Eelco for the incompressible heat flux utility.
Saved my rear. Be aware you may have to set tolerances very tightly to get steady state heat out to equal heat in. Being converged on temperature does not mean you are converged on the wall temp gradients. Jack |
|
November 30, 2012, 04:04 |
|
#16 |
New Member
reza
Join Date: May 2012
Posts: 3
Rep Power: 14 |
Hi eelcovv
thanks for the utility and test case! I use chtmultiregionsimplefoam solver for incompressible fluid and solid temperature is changed each time step. can i use your utility to calculate wallheatflux? would you plz help me calculate nusselt number(from wallheatflux) in this case? Last edited by ramon; November 30, 2012 at 04:36. |
|
July 21, 2013, 21:16 |
|
#17 | |
Member
George Pichurov
Join Date: Jul 2010
Posts: 52
Rep Power: 16 |
Quote:
Ed: I've coded part of the algorithm directly into the solver and it works like a charm. What is wrong with this utility then, or with OF at all, if such a utility cannot access the Temperature field of the calculated solution?! Why the same code works seamlessly when integrated into the solver? Very inconsistent. By the way Eelco, is there any particular reason you define extra volScalarField object to write heatflux data into file? Why not use readily available heatFlux surface scalar field? Last edited by jorkolino; July 25, 2013 at 12:55. |
||
October 5, 2013, 11:18 |
|
#18 |
Member
Arjang Behnoud
Join Date: Oct 2012
Posts: 63
Rep Power: 14 |
Hi Dear eelcovv
my case is incompressible and laminar . I have changed the wallHeatFluxIncompressible, I've compiled that but when I write wallHeatFluxIncompressible at terminal,terminal says: Code:
Create mesh for time = 0 Time = 0 Reading wallHeatFluxDict --> FOAM FATAL IO ERROR: cannot open file file: /home/amir/Desktop/pipeNanoHeatSimpleFoam/constant/wallHeatFluxDict at line 0. From function regIOobject::readStream() in file db/regIOobject/regIOobjectRead.C at line 87. FOAM exiting can you help me please? i've attached my wallHeatFluxIncompressible thanks a lot. Arjang |
|
October 6, 2013, 12:08 |
|
#19 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Hi Arjang,
OK, I found this thread, after answering to the PM you had sent me. At first, I was going to suggest that you read this thread: http://www.cfd-online.com/Forums/ope...ltiregion.html But from that error message, it looks like you didn't notice two very important details:
Bruno
__________________
|
|
October 8, 2013, 03:11 |
|
#20 |
Member
Arjang Behnoud
Join Date: Oct 2012
Posts: 63
Rep Power: 14 |
Thanks Dear Bruno
|
|
Tags |
incompressible, open foam, wallheatflux |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
how to create an internal fan for a multiRegion case? | phsieh2005 | OpenFOAM | 0 | February 2, 2012 17:32 |
wallHeatFlux utility in OpenFoam1.6 | maruthamuthu_venkatraman | OpenFOAM | 29 | October 3, 2011 11:43 |
thermal analysis - how to model internal fan? | Pei-Ying Hsieh | Main CFD Forum | 6 | March 20, 2008 11:35 |
Free surface boudary conditions with SOLA-VOF | Fan | Main CFD Forum | 10 | September 9, 2006 13:24 |
flow simulation across a small fan | jane luo | Main CFD Forum | 15 | April 12, 2004 18:49 |