|
[Sponsors] |
![]() |
![]() |
#1 |
New Member
Rajarshi Bhattacharjee
Join Date: May 2012
Posts: 4
Rep Power: 13 ![]() |
I have added a heat source term in the form of a volScalarfield to the laplacianFoam solver. The internal field of the source field will have a value in a particular mesh region(s) and be 0 everywhere else. If this field does not vary with time, I'm able to set a space varying field easily using funkySetField. But I want to vary the internal field with time(for example, in the form of a step function) and preferably, read the values from a file(or maybe in the form of a function). Either way, how do I vary it with time and space? Please help.
|
|
![]() |
![]() |
![]() |
![]() |
#2 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,227
Rep Power: 50 ![]() ![]() |
Quote:
|
||
![]() |
![]() |
![]() |
![]() |
#3 |
New Member
Rajarshi Bhattacharjee
Join Date: May 2012
Posts: 4
Rep Power: 13 ![]() |
Thanks, expressionSource was just what I needed. I have created a heaterSourceDict and can now vary it in all possible ways.
Currently, I am working with only 1 heater zone . However, if I wanted to increase the number of heater zones and set their values independently( or maybe according to where maximum temperature is reached in the mesh) would I have to define a dictionary for each heater zone or is there another way of doing it? |
|
![]() |
![]() |
![]() |
![]() |
#4 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,227
Rep Power: 50 ![]() ![]() |
Quote:
"(mag(pos()-vector(1,0,0))<0.5) ? 1 : 0" It is quite easy to extend that to two zones "(mag(pos()-vector(1,0,0))<0.5 || mag(pos()-vector(-1,0,0))<0.5) ? 1 : 0" or if you want it to be a bit more 'modular' you define two variables "src1=(mag(pos()-vector(1,0,0))<0.5) ? 1 : 0;" "src2=(mag(pos()-vector(-1,0,0))<0.5) ? 1 : 0;" and let the actual source term be "src1+src2" |
||
![]() |
![]() |
![]() |
Tags |
internal field, time dep. source term |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Boundary condition varying in space and time | jasouza1974 | OpenFOAM | 0 | January 17, 2012 10:06 |
UDF Scalar Code: HT 1 | Greg Perkins | FLUENT | 8 | October 20, 2000 13:40 |
UDFs for Scalar Eqn - Fluid/Solid HT | Greg Perkins | FLUENT | 0 | October 14, 2000 00:03 |
UDFs for Scalar Eqn - Fluid/Solid HT | Greg Perkins | FLUENT | 0 | October 11, 2000 04:43 |