CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Non uniform heat flux specification

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 26, 2006, 01:22
Default Hello, I would like to spec
  #1
Member
 
Ankur Gupta
Join Date: Mar 2009
Posts: 38
Rep Power: 17
ankgupta8um is on a distinguished road
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
ankgupta8um is offline   Reply With Quote

Old   March 26, 2006, 20:17
Default Hello, I am stuck with my w
  #2
Member
 
Ankur Gupta
Join Date: Mar 2009
Posts: 38
Rep Power: 17
ankgupta8um is on a distinguished road
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
ankgupta8um is offline   Reply With Quote

Old   March 26, 2006, 20:46
Default 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
hjasak will become famous soon enough
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
hjasak is offline   Reply With Quote

Old   March 27, 2006, 03:28
Default Hello Hrv, Thank you for th
  #4
Member
 
Ankur Gupta
Join Date: Mar 2009
Posts: 38
Rep Power: 17
ankgupta8um is on a distinguished road
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
ankgupta8um is offline   Reply With Quote

Old   March 27, 2006, 07:04
Default Guess you could could access i
  #5
Senior Member
 
Eugene de Villiers
Join Date: Mar 2009
Posts: 725
Rep Power: 21
eugene is on a distinguished road
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.
eugene is offline   Reply With Quote

Old   March 27, 2006, 07:58
Default Aha, now I understand the ques
  #6
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33
hjasak will become famous soon enough
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
hjasak is offline   Reply With Quote

Old   March 27, 2006, 12:55
Default Thanks Eugene and Hrv, I wi
  #7
Member
 
Ankur Gupta
Join Date: Mar 2009
Posts: 38
Rep Power: 17
ankgupta8um is on a distinguished road
Thanks Eugene and Hrv,

I will work on the suggestions and let you all know about it.

Thanks again!
Regards,
Ankur
ankgupta8um is offline   Reply With Quote

Old   June 5, 2006, 00:24
Default Hrv, I have similar work to
  #8
New Member
 
Shiuh-Hwa Shyu (Steven)
Join Date: Mar 2009
Location: Taiwan
Posts: 17
Rep Power: 17
sshyu is on a distinguished road
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
sshyu is offline   Reply With Quote

Old   June 5, 2006, 10:02
Default Actually, this is all pretty e
  #9
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33
hjasak will become famous soon enough
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
hjasak is offline   Reply With Quote

Old   June 5, 2006, 11:05
Default 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
sshyu is on a distinguished road
Hrv,

Surely I'll write my own. Just thinking if there is an example available in OpenFoam source code.

Thanx!
sshyu is offline   Reply With Quote

Old   June 5, 2006, 14:19
Default Hi Steven, You can pretty m
  #11
Member
 
Ankur Gupta
Join Date: Mar 2009
Posts: 38
Rep Power: 17
ankgupta8um is on a distinguished road
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
ankgupta8um is offline   Reply With Quote

Old   June 5, 2006, 22:47
Default Ankur, Thanx a million. I'
  #12
New Member
 
Shiuh-Hwa Shyu (Steven)
Join Date: Mar 2009
Location: Taiwan
Posts: 17
Rep Power: 17
sshyu is on a distinguished road
Ankur,

Thanx a million. I'll give it a try.
sshyu is offline   Reply With Quote

Old   October 1, 2006, 15:40
Default small correction for this thre
  #13
Member
 
rafal zietara
Join Date: Mar 2009
Location: Manchester, UK
Posts: 60
Rep Power: 17
rafal is on a distinguished road
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)
rafal is offline   Reply With Quote

Old   July 15, 2010, 07:16
Default location of adding the code for variable heatWallFlux
  #14
Member
 
Join Date: Dec 2009
Location: Kanpur, India
Posts: 54
Rep Power: 16
Shoonya is on a distinguished road
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
Shoonya is offline   Reply With Quote

Reply


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 Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 13:46.