|
[Sponsors] |
January 8, 2013, 06:29 |
Changing Heat source with position (UDF)
|
#1 |
New Member
Join Date: Dec 2012
Posts: 13
Rep Power: 14 |
Hi everybody,
I have a heat source that is changing within the distance of my model. I would like to know which is the best way to program it. I have tried with DEFINE_PROFILE and DEFINE_SOURCE but I'm still not getting satisfactory results. I am new in C langauge. Thank you for your help, Luis |
|
January 8, 2013, 10:49 |
|
#2 | |
Member
Li
Join Date: Mar 2009
Posts: 54
Rep Power: 17 |
Quote:
|
||
January 8, 2013, 11:04 |
|
#3 | |
New Member
Join Date: Dec 2012
Posts: 13
Rep Power: 14 |
Thank you Ilrr,
Yes, in fact I am using DEFINE_SOURCE function but I still don't have good results. My UDF is like follows: Quote:
Luis |
||
January 8, 2013, 11:16 |
|
#4 |
Super Moderator
Alex
Join Date: Jun 2012
Location: Germany
Posts: 3,427
Rep Power: 49 |
Could you be a bit more specific about the results being "not good"?
Or maybe even provide some details about your setup. |
|
January 8, 2013, 11:26 |
|
#5 |
New Member
Join Date: Dec 2012
Posts: 13
Rep Power: 14 |
Well my model is a simple 2D heat simulation with microwave (heat generates directly in the liquid)
I am using Lambert's equation to model the heat generated. This equation says that heat generated decreases exponentially with distance. I am getting the opposite results (the temperature is lower next to the wall). There is a negative exponential in the equation, so I don't know what I am defining wrong in my UDF code. |
|
January 9, 2013, 04:01 |
|
#6 | |
Member
Li
Join Date: Mar 2009
Posts: 54
Rep Power: 17 |
Quote:
|
||
January 9, 2013, 04:38 |
|
#7 |
New Member
Join Date: Dec 2012
Posts: 13
Rep Power: 14 |
It's in the Y direction. But I think it's more of a coordinates problem because I guess the equations start in Y=0?. I want it to start at the wall (which is not Y=0)
|
|
January 9, 2013, 06:41 |
|
#8 |
New Member
Join Date: Dec 2012
Posts: 13
Rep Power: 14 |
How can I define a local coordinate system for a specific UDF?
|
|
January 9, 2013, 07:29 |
|
#9 |
Member
Li
Join Date: Mar 2009
Posts: 54
Rep Power: 17 |
||
January 9, 2013, 10:02 |
|
#10 | ||
New Member
Join Date: Dec 2012
Posts: 13
Rep Power: 14 |
Quote:
Thank you for your suggestion, but what I really need is that the heat source function starts calculating from the wall (Like if the wall was heating the fluid) instead of the center of the fluid (where my (0,0) coordinate is located). Like if the heat was generated from the wall to the center, not from the center to the wall Any idea how to solve this?. Here is my code with some small changes Quote:
|
|||
January 10, 2013, 05:16 |
|
#11 |
New Member
Join Date: Dec 2012
Posts: 13
Rep Power: 14 |
Nobody?
|
|
January 10, 2013, 12:40 |
|
#12 | |
Super Moderator
Alex
Join Date: Jun 2012
Location: Germany
Posts: 3,427
Rep Power: 49 |
Quote:
source = (85714*(exp(-(y-y_wall)/0.1245))); where y_wall is the y-position of the wall |
||
January 11, 2013, 05:58 |
|
#13 | |
New Member
Join Date: Dec 2012
Posts: 13
Rep Power: 14 |
Quote:
Maybe I have to make operations with vectors?. Like if I want that my point [0 0] is in fact my point [0 0.04]. |
||
January 11, 2013, 06:12 |
|
#14 |
Super Moderator
Alex
Join Date: Jun 2012
Location: Germany
Posts: 3,427
Rep Power: 49 |
So your wall is at a y-position of 0.04 and you want your source term to decrease away from the wall, where the y-position is SMALLER than 0.04?
Then there is just a wrong sign in your equation. source = (85714*(exp(+(y-y_wall)/0.1245))); |
|
January 11, 2013, 06:39 |
|
#15 | |
New Member
Join Date: Dec 2012
Posts: 13
Rep Power: 14 |
Quote:
But the heat source is supposed to decrease from the wall to the center hence the negative sign. A positive sign would make it increase. Rght? |
||
January 11, 2013, 07:01 |
|
#16 |
Super Moderator
Alex
Join Date: Jun 2012
Location: Germany
Posts: 3,427
Rep Power: 49 |
exp(y) increases with INCREASING y, thats right.
But what I got from the information you gave so far is that your y-position DECREASES away from the wall. Hence you need the positive sign for your heatsource to decrease. Could you post a few images for clarification? |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[swak4Foam] groovyBC in openFOAM-2.0 for parabolic velocity bc | ofslcm | OpenFOAM Community Contributions | 25 | March 6, 2017 11:03 |
[swak4Foam] swak4foam building problem | GGerber | OpenFOAM Community Contributions | 54 | April 24, 2015 17:02 |
Heat source UDF, please | Sasha | Fluent UDF and Scheme Programming | 4 | October 14, 2014 02:32 |
UDF source term | jerome_ | FLUENT | 2 | July 11, 2011 12:55 |
Momentum source UDF | Matthew Brannock | FLUENT | 5 | May 3, 2001 22:18 |