|
[Sponsors] |
March 26, 2006, 01:22 |
Hello,
I would like to spec
|
#1 |
Member
Ankur Gupta
Join Date: Mar 2009
Posts: 38
Rep Power: 17 |
Hello,
I would like to specify a non-uniform heat flux on a boundary patch. The closest available boundary condition I could see in the documentation is that of "fixed gradient" specification. How can I implement non-uniform temperature gradient BC at the boundary ?? Thanks a lot in advance. Regards, Ankur |
|
March 26, 2006, 20:17 |
Hello,
I am stuck with my w
|
#2 |
Member
Ankur Gupta
Join Date: Mar 2009
Posts: 38
Rep Power: 17 |
Hello,
I am stuck with my work at a point where I need to implement the non-uniform temperature gradients at my boundary patch. Any help in this regard would be highly appreciated. Looking forward to the replies. Regards, Ankur |
|
March 26, 2006, 20:46 |
OK, so which bit don't you und
|
#3 |
Senior Member
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33 |
OK, so which bit don't you understand? If you just want to set it in the input file, do something like:
gradient nonuniform List<scalar> 30 (blah blah, 30 numbers); If you want to set it from the code, just set the values, you've got one for each boundary face. Enjoy, Hrv
__________________
Hrvoje Jasak Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk |
|
March 27, 2006, 03:28 |
Hello Hrv,
Thank you for th
|
#4 |
Member
Ankur Gupta
Join Date: Mar 2009
Posts: 38
Rep Power: 17 |
Hello Hrv,
Thank you for the input. I need to set the gradient directly in the code. In my case, the gradient is dependent on some variables. So, I want to get an expression for the gradient evaluated for all the boundary faces. Basically, I am not able to figure out the variable name that I can use to set the temperature gradients. It would be great if you could please let me know the syntax that I can use to set the gradient (i.e., To set T, I can use T.boundaryField but I dont know what to use to set the temperature gradient). Thanks, Regards, Ankur |
|
March 27, 2006, 07:04 |
Guess you could could access i
|
#5 |
Senior Member
Eugene de Villiers
Join Date: Mar 2009
Posts: 725
Rep Power: 21 |
Guess you could could access it via
T.boundaryField()[patchID].gradient() = <something>; It might be necessary to cast the boundary to a fixedGradientFvPatchScalarField to be able to access the gradient member though. IMO though, this is all a waste of time. You should reformulate this as a new boundary condition and add your function to the evaluate portion of the BC. Controlling the non-uniform heat-flux distribution through entries in the dictionary is much more general and elegant than hardcoding the lot into the top level code. |
|
March 27, 2006, 07:58 |
Aha, now I understand the ques
|
#6 |
Senior Member
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33 |
Aha, now I understand the question (thanks Eugene): yes, you do need a cast. It's done like this (for a scalar field):
fvPatchScalarFieldField& Tpatches = T.boundaryField(); if (isType<fixedgradientfvpatchscalarfield>(Tpatches[patchI].type())) { fixedGradientFvPatchScalarField& Tpatch = refCast<fixedgradientfvpatchscalarfield>(Tpatches[patchI]); Tpatch.gradient() = blah bla; } The explanation why you need to do this is pretty long but very very important and useful - please try to work it out (it's about virtual function interfaces). Hope this helps, Hrv
__________________
Hrvoje Jasak Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk |
|
March 27, 2006, 12:55 |
Thanks Eugene and Hrv,
I wi
|
#7 |
Member
Ankur Gupta
Join Date: Mar 2009
Posts: 38
Rep Power: 17 |
Thanks Eugene and Hrv,
I will work on the suggestions and let you all know about it. Thanks again! Regards, Ankur |
|
June 5, 2006, 00:24 |
Hrv,
I have similar work to
|
#8 |
New Member
Shiuh-Hwa Shyu (Steven)
Join Date: Mar 2009
Location: Taiwan
Posts: 17
Rep Power: 17 |
Hrv,
I have similar work to be done. Except that the bc is for pressure, not temperature. As my understanding, there are lots to be done. (Correct me if I am wrong.) So, would you possible to tell me which file that I can consult to? I am using 1.2 version. Does what you wrote also apply to 1.2 version? Thanx! -Steven |
|
June 5, 2006, 10:02 |
Actually, this is all pretty e
|
#9 |
Senior Member
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33 |
Actually, this is all pretty easy and striaghtforward (at least for me) :-) You should still consider writing your own boundary conditions, because that is the proper way of solvung the problem.
Hrv
__________________
Hrvoje Jasak Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk |
|
June 5, 2006, 11:05 |
Hrv,
Surely I'll write my o
|
#10 |
New Member
Shiuh-Hwa Shyu (Steven)
Join Date: Mar 2009
Location: Taiwan
Posts: 17
Rep Power: 17 |
Hrv,
Surely I'll write my own. Just thinking if there is an example available in OpenFoam source code. Thanx! |
|
June 5, 2006, 14:19 |
Hi Steven,
You can pretty m
|
#11 |
Member
Ankur Gupta
Join Date: Mar 2009
Posts: 38
Rep Power: 17 |
Hi Steven,
You can pretty much use the same block as written by Hrv above to implement the non-uniform gradients for pressure. You will also need to include a couple of header files in your code to get that piece of code working. Try it out. -Ankur |
|
June 5, 2006, 22:47 |
Ankur,
Thanx a million. I'
|
#12 |
New Member
Shiuh-Hwa Shyu (Steven)
Join Date: Mar 2009
Location: Taiwan
Posts: 17
Rep Power: 17 |
Ankur,
Thanx a million. I'll give it a try. |
|
October 1, 2006, 15:40 |
small correction for this thre
|
#13 |
Member
rafal zietara
Join Date: Mar 2009
Location: Manchester, UK
Posts: 60
Rep Power: 17 |
small correction for this thread Hrv's post - Monday, March 27, 2006 - 03:58 am
instead of: if (isType<fixedgradientfvpatchscalarfield>(Tpatches[patchI].type())) there should be: if(Tpatches[patchI].type() == "fixedGradient") or nicer if (isType<fixedgradientfvpatchscalarfield>(Tpatches[patchI])) it took me some time to spot this mistake in my code. Hope my post will save some of your time. PS. fixedGradientFvPatchScalarField instead of fixedgradientfvpatchscalarfield above(something wrong with application that is formating posts-keep changing capital letters) |
|
July 15, 2010, 07:16 |
location of adding the code for variable heatWallFlux
|
#14 |
Member
Join Date: Dec 2009
Location: Kanpur, India
Posts: 54
Rep Power: 17 |
Hi
I also need this variable wallHeatFlux concept. But I could not get where do I put that code mentioned by hjasak (post # 6 with some modification by rafal in post #13.). Kindly somebody please let me know which file do I need to make modification and how to use (this variable heat loss across the wall) in the input file of any solver. thank you dinesh |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Constant heat flux with uniform temperature | Jake Lee | FLUENT | 2 | April 13, 2011 23:08 |
ratio of total heat flux and radiative heat flux | S.Karthikeyan | FLUENT | 2 | July 1, 2008 04:48 |
WALL HEAT FLUX V.S. HEAT FLUX | tommy | CFX | 0 | December 15, 2005 09:14 |
Constant wall heat flux with uniform temperature | Jake | FLUENT | 2 | September 29, 2003 12:34 |
Heat Transfer Coeff. at Heat Flux Boundary | Rushyen | CFX | 6 | January 18, 2001 06:09 |