|
[Sponsors] |
Return the number of cells on one side of the wall |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 16, 2018, 22:32 |
Return the number of cells on one side of the wall
|
#1 |
New Member
newuser
Join Date: Dec 2017
Posts: 11
Rep Power: 8 |
I'm trying to write a program that linearly increases the heat flux on one side of the wall. How do I determine the number of cells in the first column of the mesh? Please do help.
|
|
April 18, 2018, 04:41 |
|
#2 | ||
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
Quote:
Code:
#include "udf.h" DEFINE_PROFILE(lin_incr,t,i) { face_t f; float x[ND_ND]; begin_f_loop(f,t) { F_CENTROID(x,f,t); F_PROFILE(f,t,i) = 213.12512 + 1.135 * x[0]; /* change the coefficients above to what you need */ } end_loop(f,t); } Quote:
|
|||
April 18, 2018, 20:42 |
|
#3 |
New Member
newuser
Join Date: Dec 2017
Posts: 11
Rep Power: 8 |
Thanks a lot.
I thought I would need it to determine the rate of increase. |
|
April 18, 2018, 22:45 |
Error message for code
|
#4 |
New Member
newuser
Join Date: Dec 2017
Posts: 11
Rep Power: 8 |
Also, how do I linearly increase from 0 to 500?
Last edited by new_cfd; April 19, 2018 at 02:13. |
|
April 19, 2018, 03:45 |
|
#5 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
Choose the coefficient such that it is 0 on one end and 500 on the other end.
|
|
April 19, 2018, 06:38 |
|
#6 |
New Member
newuser
Join Date: Dec 2017
Posts: 11
Rep Power: 8 |
I used the code
F_PROFILE(f,t,i) = 0+1.25*x[0] Will the above work? I aimed to increase from 0 to 500 by increasing each cell by 1.25. |
|
April 19, 2018, 06:43 |
|
#7 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
This will give 0 at x=0m, and 500 at x=400m.
So if you have a 400 meter long boundary, starting at x=0, then it works. If not, do some (simple) mathematics. You (should) know at which x-position you want zero heat flux, and you (should) know at which x-position you want 500 heat flux. So you have to points, find a line that goes through these two points, write down the equation, and put this equation in your udf. |
|
April 20, 2018, 05:11 |
|
#8 |
New Member
newuser
Join Date: Dec 2017
Posts: 11
Rep Power: 8 |
It worked for the right vertical wall. But, for my left vertical wall it did not. I used 0 + 1250 y[0].
Can you tell me what to use for the left one? One time when I tried, the heat flux continued to the bottom portion as well and didn't stop. Also, how do I know from which cell the centroid calculation starts? From the top most cell or bottom? Last edited by new_cfd; April 20, 2018 at 06:28. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
decomposePar problem: Cell 0contains face labels out of range | vaina74 | OpenFOAM Pre-Processing | 37 | July 20, 2020 06:38 |
[OpenFOAM.org] OF2.3.1 + OS13.2 - Trying to use the dummy Pstream library | aylalisa | OpenFOAM Installation | 23 | June 15, 2015 15:49 |
killed "snappyHexMesh" | parkh32 | OpenFOAM Pre-Processing | 2 | April 8, 2012 18:12 |
[snappyHexMesh] snappyHexMesh aborting | Tobi | OpenFOAM Meshing & Mesh Conversion | 0 | November 10, 2010 04:23 |
[snappyHexMesh] external flow with snappyHexMesh | chelvistero | OpenFOAM Meshing & Mesh Conversion | 11 | January 15, 2010 20:43 |