|
[Sponsors] |
![]() |
![]() |
#1 |
Member
Ben Simpson
Join Date: Dec 2019
Location: UK
Posts: 32
Rep Power: 6 ![]() |
Hi,
I am modelling a simple naturally ventilated building where I need to calculate the total CO2 leaving and entering the building through the windows. I am trying to achieve this by using the surfaceFieldValue function object but I am struggling to get it to select/sample the correct cells. Currently I am using the code below in my controlDict. Does anyone know if you can use the plan type in the sampleSurfaceDict in a way that it doesn't span across the entire model? As I have areas outside of the building which I do not want to include in this. Code:
westValuesSum { type surfaceFieldValue; libs ("libfieldFunctionObjects.so"); log true; writeControl writeTime; writeFields true; surfaceFormat none; regionType sampledSurface; name sum; sampledSurfaceDict { type plane; planeType pointAndNormal; basePoint (0.05 0 0); normalVector (1 0 0); } operation sum; fields ( CO2 ); } I have also tried using the other two methods (faceSet and patch) for selecting the cells but have been unable to get these to work to a satisfactory level. Thanks in advance for any help on this issue. Regards, Ben |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Member
Join Date: Jun 2020
Posts: 49
Rep Power: 6 ![]() |
Hi Ben,
in case your problem still exists, I think you could go a different route than using sampledSurface. Instead, you could define facezones for each window. To do that, you first create a faceSet for the windows with the topoSet command. In the topoSetDict you can specify boxes to define the desired area. In your case, those boxes should probably be very thin in the direction going inside/outside the building. The topoSetDict options to do thisare explained further here: https://www.openfoam.com/documentati...boxToFace.html In the second step you have to covert the faceSet to a faceZone, also using the topoSetDict as described here: https://www.openfoam.com/documentati...oFaceZone.html This should create a usable source for your surfaceFieldValue utility. Hope this helps a little. |
|
![]() |
![]() |
![]() |
![]() |
#3 |
Member
Ben Simpson
Join Date: Dec 2019
Location: UK
Posts: 32
Rep Power: 6 ![]() |
Thank you for your reply.
I agree that the faceSet/faceZone is the way to go for what I am trying to achieve. In case anyone is interested I got it to work on my model by creating a cellSet from an stl file that I generated in blender. I then created a faceSet and faceZone from this. I was then able to use the faceZone for the surfaceFieldValue. Below is the setup I used. topoSetDict: Code:
{ name southCell; type cellSet; action new; source surfaceToCell; sourceInfo { file "$FOAM_CASE/constant/triSurface/sWin.stl"; useSurfaceOrientation false; outsidePoints ((1 1 1)); // definition of outside includeCut true; // cells cut by surface includeInside false; // cells not on outside of surf includeOutside false; // cells on outside of surf nearDistance -1; // cells with centre near surf // (set to -1 if not used) curvature -100; // cells within nearDistance // and near surf curvature // (set to -100 if not used) } } { name southFace; type faceSet; action new; source cellToFace; sourceInfo { set southCell; option all; } } { name southZone; type faceZoneSet; action new; source setToFaceZone; sourceInfo { faceSet southFace; } } Code:
surfaceInterpolate_CO2 { type surfaceInterpolate; libs ("libfieldFunctionObjects.so"); fields ( (CO2 CO2Interp) ); executeControl writeTime; writeControl writeTime; } southSumPos { type surfaceFieldValue; libs ("libfieldFunctionObjects.so"); log true; executeControl writeTime; writeControl writeTime; writeFields true; surfaceFormat none; regionType faceZone; name southZone; operation sumDirection; direction (0 1 0); fields ( CO2Interp ); } Regards, Ben |
|
![]() |
![]() |
![]() |
Tags |
openfoam 8, sampledsurface, surfacefieldvalue |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Setup for buoyantBoussinesqPimpleFoam with openings | SadBoySquad | OpenFOAM | 5 | August 25, 2022 10:31 |
setup problem | SANORANJAM | FLUENT | 3 | May 6, 2020 10:21 |
2D Glass Melt Simulation Setup | marmz | FLUENT | 5 | October 9, 2016 15:25 |
[ICEM] surface/curve mesh setup | Studi | ANSYS Meshing & Geometry | 15 | November 12, 2014 00:32 |
[ICEM] Hexa mesh, curve mesh setup, bunching law | Anorky | ANSYS Meshing & Geometry | 4 | November 12, 2014 00:27 |