|
[Sponsors] |
How to get a mean value field along one direction? |
![]() |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
![]() |
![]() |
#1 |
New Member
Aaron
Join Date: Apr 2016
Posts: 24
Rep Power: 11 ![]() |
Hi, foamers,
I want to get mean temperature field from T field if z coordinate is equal , this is my test code, Code:
//get T mean along z axis forAll(mesh.C(),celli) { scalar zi = mesh.C()[celli].component(vector::Z); scalar& Tmeani = T_mean[celli]; scalar& Ti = T[celli]; scalar Vi = mesh.V()[celli]; scalar Vtotal = Vi; scalar Ttotal = Ti*Vi; forAll(mesh.C(),cellj) { scalar zj = mesh.C()[cellj].component(vector::Z); if(zi == zj) { scalar& Tj = T[cellj]; scalar Vj = mesh.V()[cellj]; Vtotal = Vtotal + Vj; Ttotal = Ttotal + Tj*Vj; } } Tmeani = Ttotal/Vtotal ; } any suggestions? or someone can give me some brief solutions? Last edited by Aaron_L; August 2, 2016 at 21:31. Reason: add information |
|
![]() |
![]() |
![]() |
![]() |
#2 |
New Member
Aaron
Join Date: Apr 2016
Posts: 24
Rep Power: 11 ![]() |
attachment picture is T_mean equation, I want to get T_mean along z direction using xy plane average
|
|
![]() |
![]() |
![]() |
![]() |
#3 |
New Member
Hungary (Ungarn)
Join Date: Sep 2017
Posts: 16
Rep Power: 9 ![]() |
Dear Aaron!
Have you made any process with it ever since? |
|
![]() |
![]() |
![]() |
![]() |
#4 |
New Member
Aaron
Join Date: Apr 2016
Posts: 24
Rep Power: 11 ![]() |
no, it is not very important, so I didn't complete it.
|
|
![]() |
![]() |
![]() |
Tags |
mesh and grid |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[SOWFA] NREL SOWFA ABLTerrainSolver tutorial problem | cico0815 | OpenFOAM Community Contributions | 36 | February 3, 2022 11:54 |
funkySetBoundaryFields - Manipulation of existing field | jhertel | OpenFOAM Pre-Processing | 16 | May 18, 2020 06:32 |
Openfoam - Run Wind Simulations in Different Direction | YK123 | OpenFOAM | 3 | May 16, 2016 07:38 |
Direction of flow for far field inlet | Sharkfinner | FLUENT | 0 | March 15, 2016 08:27 |
Using sample to Inlet velocity field | amanbearpig | OpenFOAM Running, Solving & CFD | 14 | November 16, 2015 05:47 |