|
[Sponsors] |
How to connect values between two separate walls |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 24, 2019, 15:39 |
How to connect values between two separate walls
|
#1 |
New Member
Join Date: Jan 2019
Posts: 3
Rep Power: 7 |
Let's say I have a 2D problem where two solid domains are separated by a fluid domain. (solid 1|fluid|solid 2). Solid 1 has heat generation, and all heat generated goes through the left wall (zero wall flux at the solid-liquid interface).
How can I make the right wall of solid 2 have the same values of the wall in solid 1 that "collects" the heat? Would an UDF with DEFINE_ADJUST be the best solution? Any thoughts? Thanks in advance! |
|
January 24, 2019, 21:24 |
|
#2 | |
Senior Member
Join Date: Feb 2010
Posts: 164
Rep Power: 17 |
Quote:
Thread *t=Lookup_Thread(domain,left_wall_id); face_t f; real A[ND_ND]; begin_f_loop(f,t) { F_AREA(A,f,t); Message("Wall_Heat_Flux=%f W/m2\n",BOUNDARY_HEAT_FLUX(f,t)/NV_MAG(A)); } end_f_loop(f,t) |
||
January 25, 2019, 06:24 |
|
#3 | |
New Member
Join Date: Jan 2019
Posts: 3
Rep Power: 7 |
Quote:
That makes sense! Thanks for your help, I'll give it a try! |
||
January 28, 2019, 11:36 |
|
#4 |
New Member
Join Date: Jan 2019
Posts: 3
Rep Power: 7 |
So, after spending some time trying to make it work, it seems something is still wrong.
Here's the code used. Two notes: First, for convenient reasons, I'm interpreting the UDF instead of compiling it. As soon as I get it running I intend to compile it. From my understandings, in this case there shouldn't be a difference between compiled/interpreted other than the line written as a comment. Second, as I'm using a mesh in the nm range, the source value needs to be high so that there is an increase in temperature (By running only the DEFINE_SOURCE, the solid increases around 8 K, so the issue isn't here) #include "udf.h" real wall_flux_value; DEFINE_SOURCE(Heat_generation, c, t, dS, eqn) { real x[ND_ND]; real y; real source; C_CENTROID(x, c, t); y = x[0]; source = 5e24*y; dS[eqn] = 0.0; return source; } DEFINE_ADJUST(Heat_Flux_LeftWall, d) { Thread *t = Lookup_Thread(d, 13); face_t f; real A[ND_ND]; begin_f_loop(f, t) { F_AREA(A, f, t); /* Message("Wall_Heat_Flux=%f W/m2\n", BOUNDARY_HEAT_FLUX(f, t) / NV_MAG(A)); - This line of code doesn't work in interpreted UDF's */ wall_flux_value =+ BOUNDARY_HEAT_FLUX(f, t) / NV_MAG(A); } end_f_loop(f, t) } DEFINE_PROFILE(Heat_Flux_RightWall, t, i) { face_t f; begin_f_loop(f, t) { F_PROFILE(f, t, i) = wall_flux_value; } end_f_loop(f,t) } When running the case with the UDF, there's no increase in temperature in solid 2. My guess is that the issue must be between storing the value from the DEFINE_ADJUST and using it in the DEFINE_PROFILE. How how I go about doing such? Would an UDM be the right way to go about solving this? PS: Sorry if it is obvious, but i'm still new to writing UDF's and the whole C language :P |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Pressure boundaries at walls? Compressible Navier-Stokes 2D, Cavity problem. | antoniojr | Main CFD Forum | 15 | March 22, 2017 18:01 |
k-w SST freestream values for w | hazari.aaquib | Main CFD Forum | 4 | March 18, 2016 05:29 |
SIMPLE algorithm does not converge when using old pressure (correction) values | andreasp | Main CFD Forum | 3 | February 9, 2016 22:18 |
Boundary-adapt refinement with interior "dummy" walls | thomas. | FLUENT | 0 | July 27, 2015 11:10 |
Velocity values are normal but pressure values are too big | rv82 | OpenFOAM Running, Solving & CFD | 4 | April 13, 2015 04:59 |