|
[Sponsors] |
UDF placing volumetric heat source in exact region |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
September 16, 2014, 08:23 |
UDF placing volumetric heat source in exact region
|
#1 |
Member
Rafal
Join Date: Aug 2013
Location: CK
Posts: 36
Rep Power: 13 |
Hello,
I'm trying to place volumetric heat source in specified region. My domain extents: 0<x<=0.02 0<y<=0.02 0<z<=0.01 I would like to apply heat source at region: 0.0075<x<0.00125 0.0075<y<0.00125 0.0004<z<0.0005 I wrote condition: Code:
xc=x[0]; yc=x[1]; zc=x[2]; (...) if ((0.0075<xc<0.00125)&&(0.0075<yc<0.00125)&&(0.0004<zc<0.0005)) { source = I_0/(3.14*omega*omega); dS[eqn] = 0.0; } else { source = dS[eqn] = 0.; } Can you help with that problem? |
|
September 17, 2014, 09:08 |
|
#2 |
Senior Member
Cees Haringa
Join Date: May 2013
Location: Delft
Posts: 607
Rep Power: 0 |
Hi Vekh,
Wouldn't it be easier to create a separate cell zone in your domain within the mesh, and enable the source term on that location only, if the location is fixed anyway? Best, Cees |
|
September 17, 2014, 09:52 |
|
#3 |
Member
Join Date: Jul 2013
Posts: 80
Rep Power: 13 |
I guess you have obtained the coordinates of the cell with the function C_CENTROID. In that case, you will get the coordinates of the cell centroid.
The region you have limited with the z coordinate is very small, so although you have a cell in that area, perhaps you do not have a cell centroid coordinate in it. You can simply check that with an UDF like "if 0.0004<z<0.0005, C_UDMI = true", and then create an iso-surface and see if any cell is found. Cheers |
|
September 17, 2014, 11:52 |
|
#4 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
Maybe you have to replace
Code:
if ((0.0075<xc<0.00125)&&(0.0075<yc<0.00125)&&(0.0004<zc<0.0005)) Code:
if ((0.0075<xc)&&(xc<0.00125)&&(0.0075<yc)&&(yc<0.00125)&&(0.0004<zc)&&(zc<0.0005)) In other words: if xc is 0.002: "0.0075<xc<0.00125" is equal to "0.0075<0.002<0.00125" is equal to "(0.0075<0.002)<0.00125" is equal to "FALSE<0.00125" is equal to "0<0.00125" is equal to "TRUE", which is not what you intended. I am surprised that it gave correct results for x and y, I would expect it to give unwanted results in all three dimensions. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
chtMultiRegionSimpleFoam: modelling a heat source in a solid region | zfaraday | OpenFOAM Pre-Processing | 10 | February 18, 2019 15:17 |
friction forces icoFoam | ofslcm | OpenFOAM | 3 | April 7, 2012 11:57 |
"parabolicVelocity" in OpenFoam 2.1.0 ? | sawyer86 | OpenFOAM Running, Solving & CFD | 21 | February 7, 2012 12:44 |
DxFoam reader update | hjasak | OpenFOAM Post-Processing | 69 | April 24, 2008 02:24 |
heat source UDF error | co2 | FLUENT | 8 | May 18, 2004 08:47 |