|
[Sponsors] |
Parallel Average Volume Temperature Calculation |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
July 11, 2022, 06:03 |
Parallel Average Volume Temperature Calculation
|
#1 |
New Member
Anas Nur Fauzan
Join Date: Oct 2019
Posts: 18
Rep Power: 7 |
Greetings all,
I'm trying to compute average volume temperature of a region. This is my code. Code:
/* Calculate Volume-weighted Average of Module Temperature. */ real volume; real T_AVG_TEMP; #if !RP_HOST thread = Lookup_Thread(domain, TEM_ID); begin_c_loop(c, thread) { volume += C_VOLUME(c, thread); T_AVG_TEM += C_T(c, thread)*C_VOLUME(c, thread); } end_c_loop(c, thread) #if RP_NODE volume = PRF_GRSUM1(volume); T_AVG_TEM = PRF_GRSUM1(T_AVG_TEM); #endif /* RP_NODE */ #endif /* RP_HOST */ After running the simulation, I compared the total volume I calculated with UDF and using Volume Integral with Reports feature. I found that by using UDF, I got the amount of total volume. Code:
Total volume: 6.18199e-05 Code:
Total Volume (m3) -------------------------------- -------------------- tem_solid 5.9999975e-05 ---------------- -------------------- Net 5.9999975e-05 Is there something I need to fix in my code that could results difference in total volume? Any insight, would be highly appreciated. Thanks in advance. Regards, A. Last edited by luzikato; July 14, 2022 at 08:22. Reason: Added more details to the problem |
|
July 14, 2022, 22:43 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
define volume = 0 explicitly before summation as well as T_AVG_TEMP = 0
__________________
best regards ****************************** press LIKE if this message was helpful |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[openSmoke] libOpenSMOKE | Tobi | OpenFOAM Community Contributions | 562 | January 25, 2023 10:21 |
Calculating source term total cell-zone volume parallel computation | RobV | Fluent UDF and Scheme Programming | 2 | May 30, 2022 04:46 |
[snappyHexMesh] snappyHexMesh does not detect highly skewed faces? | ptpacheco | OpenFOAM Meshing & Mesh Conversion | 1 | January 4, 2022 13:37 |
how to set periodic boundary conditions | Ganesh | FLUENT | 15 | November 18, 2020 07:09 |
Converging Diverging Nozzle with dbnsTurbFoam | Saleh Abuhanieh | OpenFOAM Running, Solving & CFD | 4 | December 13, 2019 11:26 |