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

Time and space varying source term

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 11, 2012, 05:26
Default Time and space varying source term
  #1
New Member
 
Rajarshi Bhattacharjee
Join Date: May 2012
Posts: 4
Rep Power: 14
Rajarshi is on a distinguished road
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.
Rajarshi is offline   Reply With Quote

Old   June 11, 2012, 05:43
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by Rajarshi View Post
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.
Chances are good that you've already got the solution installed:Search the MessageBoard for "expressionSource" and you will find information about such a thing in swak4Foam. Nevertheless you'll have to modify the solver to use it
gschaider is offline   Reply With Quote

Old   June 13, 2012, 11:41
Default
  #3
New Member
 
Rajarshi Bhattacharjee
Join Date: May 2012
Posts: 4
Rep Power: 14
Rajarshi is on a distinguished road
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?
Rajarshi is offline   Reply With Quote

Old   June 13, 2012, 18:29
Default
  #4
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by Rajarshi View Post
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?
With one heater zone your mean that your source would for instance be

"(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"
gschaider is offline   Reply With Quote

Reply

Tags
internal field, time dep. source term


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
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


All times are GMT -4. The time now is 16:15.