|
[Sponsors] |
How to Define heat generation rate that changes with the system coordinate. |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
December 2, 2014, 07:20 |
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 |
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. Last edited by a19910112a; December 2, 2014 at 11:18. |
|
December 7, 2014, 06:12 |
|
#2 |
Senior Member
|
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? |
|
December 12, 2014, 04:22 |
|
#3 |
New Member
hello
Join Date: Nov 2014
Posts: 3
Rep Power: 12 |
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 #}; } |
|
Tags |
fvoptions, heat sources |
|
|
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 |