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

How to Define heat generation rate that changes with the system coordinate.

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By a19910112a
  • 1 Post By hesong

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 2, 2014, 07:20
Default How to Define heat generation rate that changes with the system coordinate.
  #1
New Member
 
zech
Join Date: Oct 2014
Location: Cambridge,England
Posts: 22
Rep Power: 12
a19910112a is on a distinguished road
Hi Foamers,
This question was posted years ago and seems no good enough answer to it. I have the picture of the problem:

This is a very simple question similar to the planewall2D question, except the bottom air is changed by a heat generation block. I managed to do this with a constant heat generation rate and the case file is attached.

The current problem is that I want to set the heat generation rate that changes according to the system coordinate. Something like q'''=cos (x), which I think should be easily done by editing some lines in the fvOption file.

Anyone could suggest a method to do this?

I have been considering the scalarCodedSource utility, but the C++ is a little bit confusing. Anyone has an example on this? I have the officially provided example, but some illustration for the code is needed.
Attached Files
File Type: zip sfr1.zip (36.8 KB, 30 views)
raj kumar saini likes this.

Last edited by a19910112a; December 2, 2014 at 11:18.
a19910112a is offline   Reply With Quote

Old   December 7, 2014, 06:12
Default
  #2
Senior Member
 
Jens Höpken
Join Date: Apr 2009
Location: Duisburg, Germany
Posts: 159
Rep Power: 17
jhoepken is on a distinguished road
Send a message via Skype™ to jhoepken
Hi a19910112a from England ,

what exactly is your problem with the codedSource and C++? The particular hooks used are explained in the sources quite well (on an average OpenFOAM level, to be fair).

If you just want to change the temperature on the walll, why don't you go for groovyBC or code your own?
__________________
Blog: sourceflux.de/blog
"The OpenFOAM Technology Primer": sourceflux.de/book
Twitter: @sourceflux_de
Interested in courses on OpenFOAM?
jhoepken is offline   Reply With Quote

Old   December 12, 2014, 04:22
Default
  #3
New Member
 
hello
Join Date: Nov 2014
Posts: 3
Rep Power: 12
hesong is on a distinguished road
you can try this
myPatch
{
type codedFixedValue;
value uniform 0;
redirectType myFixedValue; // name of generated BC

code
#{
forAll(*this, i)
{
scalar z = patch().Cf()[i][2];
if (z > 0 && z < 32)
(*this)[i] = 0.0075 * z -1.58;
else if (...)
...;
else
...;
}
#};

codeInclude
#{
#include "fvCFD.H"
#};

codeOptions
#{
-I$(LIB_SRC)/finiteVolume/lnInclude
#};
}
raj kumar saini likes this.
hesong is offline   Reply With Quote

Reply

Tags
fvoptions, heat sources


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
Error finding variable "THERMX" sunilpatil CFX 8 April 26, 2013 08:00
Heat generation Rate MARIO276 FLUENT 3 February 20, 2013 09:57
Installing OF 1.6 on Mac OS X gschaider OpenFOAM Installation 129 June 19, 2010 10:23
Inconsistent Total Heat Transfer Rate Ken Adams FLUENT 0 July 24, 2007 12:04
REAL GAS UDF brian FLUENT 6 September 11, 2006 09:23


All times are GMT -4. The time now is 14:32.