|
[Sponsors] |
![]() |
![]() |
#1 |
New Member
Jason Ryon
Join Date: Oct 2009
Posts: 17
Rep Power: 16 ![]() |
I would like to know how to monitor at an internal face (faceZone or faceSet). I want to know p, U, etc... for every point in the faceZone, as well as the mass flow through the entire face.
This is what I have tried so far, but can't seem to get things to work: 1. Import mesh (with "interior" surfaces) from Fluent using: >fluentMeshToFoam mesh.msh -writeSets -writeZones 2. I see the name (interior_001) in faceZones of the faceZone that I want to monitor 3. Now, I have tried using the "surfaces" functionObject which works for slice planes or patches, but is it possible to use this to output a faceZone or faceSet? 4. I also tried even using the libfieldFunctionObjects.so but this seems to only work on a faceZone that is a patch and not an internal one. 5. Also, I have used libsimplefunctionobjects to work very well for mass flow at patches (i.e. pressure_inlet) but I don't know if this works for internal faceZones too. http://openfoamwiki.net/index.php/Co...unctionObjects I am sorry if this has been posted before, I searched through the Forum but keep hitting dead-ends. Thanks, Jason |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Member
Johan Spĺng
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 35
Rep Power: 17 ![]() |
(Assuming OpenFOAM-1.6.x) insert this into your controlDict and update according to your case:
Code:
functions ( //=========================================================// Meas-outlet // Name also used to identify output folder { type faceSource; functionObjectLibs ("libfieldFunctionObjects.so"); enabled true; outputControl timeStep; outputInterval 1; log true; valueOutput false; source faceZone; // Type of face source: faceZone, patch sourceName meas-outlet; operation sum; fields ( phi ); } OpenFOAM-1.6.x/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.H: - if the field is a volField the faceZone can only consist of boundary faces. You could write something yourself like: Code:
surfaceScalarField test = fvc::interpolate(field); label q = mesh.faceZones().findZoneID(surfaceName); const labelList& faces = mesh.faceZones()[q]; forAll(faces, j) { label facei = faces[j]; result+= test[facei] ... } Last edited by josp; April 24, 2010 at 09:05. |
|
![]() |
![]() |
![]() |
![]() |
#3 |
New Member
Jason Ryon
Join Date: Oct 2009
Posts: 17
Rep Power: 16 ![]() |
josp,
Thanks for your response. I think this sum(phi) is close to what I am looking for, but not quite right. I am wondering though if this is "mass flow" or "mass flow rate"? I am looking for "mass flow rate". I tried the sum(phi) at an inlet patch, and it is giving me results that are not the same as "mass flow rate" from Fluent or from the libsimpleFunctionObjects mass-flux calculations (both of which match up reasonably well to each other): Thanks again for your help, Jason |
|
![]() |
![]() |
![]() |
![]() |
#4 |
Member
Cedric Van Holsbeke
Join Date: Dec 2009
Location: Belgium
Posts: 81
Rep Power: 16 ![]() |
sum(phi) is the mass flow rate trough the patch. However, in incompressible solvers, phi has the dimension m^3/s and not kg/s. You will have to multiply this value with rho to have the same results as Fluent.
|
|
![]() |
![]() |
![]() |
![]() |
#5 |
New Member
Nadeem
Join Date: Mar 2009
Location: MĂĽnchen, Bavarian, Deutschland
Posts: 24
Rep Power: 17 ![]() |
Hello everybody,
I am new to openfoam but have a similar question. I am wondering what I will get as an output if i have the following case. surfaceScalarField abc Info<<"Whats this"<<abc[100]; will it give me output of abc at the face number 100? If I have faceSets, and get the facenumbers out of these facesets, could i get the value of abc at the putting the face number inside the brackets as following Info<<"value at the required facenumber"<<abs[facenumber]; Thanks in advance. |
|
![]() |
![]() |
![]() |
![]() |
#6 | |
New Member
Michal
Join Date: Apr 2012
Location: Czech Republic
Posts: 27
Rep Power: 14 ![]() |
Quote:
|
||
![]() |
![]() |
![]() |
![]() |
#7 |
New Member
Josef Dobeš
Join Date: Mar 2012
Location: Czech republic
Posts: 12
Rep Power: 14 ![]() |
Hi guys,
could you provide me some more information if you had/have succesfully implemented monitoring pressure on faceZones. I used OpenFOAM v6 and I am able to online monitoring phi as flux on the internal faces - faceZones, but if I want to monitoring pressure it doesn't work. Any help would be appreciated. Thanks. |
|
![]() |
![]() |
![]() |
![]() |
#8 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,978
Blog Entries: 45
Rep Power: 128 ![]() ![]() ![]() ![]() ![]() ![]() |
Quick answer: You will have to create a baffle from that faceZone and apply cyclic boundary conditions to it. Search for "createBafflesDict" in the "tutorials" folder... I don't remember which tutorial has it...
__________________
|
|
![]() |
![]() |
![]() |
![]() |
#9 |
New Member
Josef Dobeš
Join Date: Mar 2012
Location: Czech republic
Posts: 12
Rep Power: 14 ![]() |
Hi wyldckat,
you have a briliant idea. It works. My createBaffleDict looks: Code:
/*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: dev \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object createBafflesDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // Whether to convert internal faces only (so leave boundary faces intact). // This is only relevant if your face selection type can pick up boundary // faces. internalFacesOnly true; fields true; // Baffles to create. baffles { I0_B { //- Use predefined faceZone to select faces and orientation. type faceZone; zoneName I0; patchPairs { type cyclic; } } I3_B { //- Use predefined faceZone to select faces and orientation. type faceZone; zoneName I3; patchPairs { type cyclic; } } } // ************************************************************************* // Code:
/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: dev \\/ M anipulation | \*---------------------------------------------------------------------------*/ Build : dev-8f3f2f7365c1 Exec : createBaffles -overwrite Date : Oct 15 2018 Time : 08:37:25 Host : "dobesj-Precision-T5600" PID : 26264 I/O : uncollated Case : /media/dobesj/Data_disc/Re_CS_OF nProcs : 1 sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE). fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 10) allowSystemOperations : Allowing user-supplied system call operations // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Create time Create mesh for time = 0 Reading baffle criteria from createBafflesDict Not converting faces on non-coupled patches. Reading geometric fields Reading volScalarField p Reading volScalarField nut Reading volScalarField k Reading volScalarField epsilon Reading volScalarField omega Reading volVectorField U Created zone I0_B at index 24 with 610 faces Created zone I3_B at index 25 with 610 faces Converted 1220 faces into boundary faces in patches 4 ( I0_B_master I0_B_slave I3_B_master I3_B_slave ) --> FOAM Warning : From function int main(int, char**) in file createBaffles.C at line 854 Setting field on boundary faces to zero. You might have to edit these fields. Writing mesh to 0 End Thanks. ---- Hi wyldckat, thank you for your briliant idea, it works. In my log file, during create baffles I received that warning: Code:
--> FOAM Warning : From function int main(int, char**) in file createBaffles.C at line 854 Setting field on boundary faces to zero. You might have to edit these fields. Last edited by wyldckat; October 20, 2018 at 16:04. Reason: merged posts a few minutes apart |
|
![]() |
![]() |
![]() |
![]() |
#10 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,978
Blog Entries: 45
Rep Power: 128 ![]() ![]() ![]() ![]() ![]() ![]() |
Quick answer: There is a quick way you can automatically apply boundary conditions to types of boundaries... This line:
Code:
#includeEtc "caseDicts/setConstraintTypes" The tutorial case "heatTransfer/buoyantSimpleFoam/circuitBoardCooling" is also a good example on how to both use this and define the new boundary conditions via "system/createBafflesDict". |
|
![]() |
![]() |
![]() |
![]() |
#11 |
Member
Martin
Join Date: Aug 2018
Posts: 33
Rep Power: 8 ![]() |
I had the same problem. Now I solved it with help from Ione and wyldckat so I'm sharing my code if it helps anyone.
I wanted to output average pressure on internal face "CKOUT" which was defined as faceZone. First I tried with function type surfaceFieldValue but I got error "Unable to process internal faces for volume field p" Then I made file createBafflesDict similar to Iose's and ran command createBaffles Two new patches were created, CKOUT_master and CKOUT_slave. Files U, p, k etc. in 0/ folder needs to have these two patches included this way: Code:
CKOUT_master { type cyclic; } CKOUT_slave { type cyclic; } Code:
functions { p_CKOUT { type patchAverage; fields (p); functionObjectLibs ("libsimpleFunctionObjects.so"); patches ( CK_OUTmaster ); allowCoupled true; writeStartTime no; outputControlMode outputTime; // outputControlMode timeStep; // outputInterval 10; } } Alternative option, if you don't have swak4foam, is that you put this to controlDict: Code:
functions { #includeFunc patchAverage(name=CKOUT_master,p) } |
|
![]() |
![]() |
![]() |
![]() |
#12 | |
New Member
Join Date: Aug 2021
Posts: 11
Rep Power: 5 ![]() |
Since OF V8 it should be possible to have the field values processed for a given faceZone.
If I add a function file in system in this way e.g. : Code:
/*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 9 \\/ M anipulation | ------------------------------------------------------------------------------- Description Calculates the average values of fields on a faceZone. \*---------------------------------------------------------------------------*/ type surfaceFieldValue; libs ("libfieldFunctionObjects.so"); writeControl timeStep; writeInterval 1; log yes; writeTotalArea no; writeFields no; regionType faceZone; name my_facezone; operation areaAverage; fields ( U ); // ************************************************************************* // Quote:
Regards Daniel |
||
![]() |
![]() |
![]() |
![]() |
#13 |
New Member
Join Date: Aug 2019
Posts: 5
Rep Power: 7 ![]() |
Since type is surfaceFieldValue, so you only can read the face values like phi, but you can't read a volume field like U.
|
|
![]() |
![]() |
![]() |
Tags |
internal monitoring |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
DecomposePar unequal number of shared faces | maka | OpenFOAM Pre-Processing | 6 | August 12, 2010 09:01 |
[snappyHexMesh] external flow with snappyHexMesh | chelvistero | OpenFOAM Meshing & Mesh Conversion | 11 | January 15, 2010 19:43 |
How to store the variable on internal faces to calculate UDS_FLUX? | bigfans | FLUENT | 0 | October 28, 2009 14:22 |
Problem in IMPORT of ICEM input file in FLUENT | csvirume | FLUENT | 2 | September 9, 2009 01:08 |
Unaligned accesses on IA64 | andre | OpenFOAM | 5 | June 23, 2008 10:37 |