|
[Sponsors] |
Can you use postProcess functions like "forces" on a faceSet? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
March 31, 2021, 17:51 |
Can you use postProcess functions like "forces" on a faceSet?
|
#1 |
New Member
ssimmons
Join Date: Jan 2018
Posts: 2
Rep Power: 0 |
Hello Everyone,
This is my first post in the forums, so I apologise if I am missing something here or if I make any mistakes! Basically, I have finished a number of simulations using the following forces function as a run-time function (in my controlDict): Code:
forcesBlade { type forces; libs ("libforces.so"); patches (blade); pName p; UName U; rhoName rho; rhoInf 1; CofR (0 0.479105931997901 0.6); log true; writeControl timeStep; timeInterval 1; Now, however, I am looking back on my simulations and realising: it might have been a good idea to split the "blade" into subsections. I have successfully created three subsections of the "blade": "bladeInner", "bladeMid", and "bladeOuter". These subsections are all faceSets (not patches). I am wondering: is it possible to implement a function like "forces" by calling out a set (faceSet, cellSet, etc.) or even a zone (cellZone, faceZone, etc.) instead of a patch? I have tried something like this: Code:
forcesBlade_inner { type forces; libs ("libforces.so"); set (bladeInner); pName p; UName U; rhoName rho; rhoInf 1; CofR (0 0.479105931997901 0.6); log true; writeControl timeStep; timeInterval 1; I would really appreciate any suggestion, comments, or solutions! |
|
May 21, 2021, 15:29 |
What I ended up doing...
|
#2 |
New Member
ssimmons
Join Date: Jan 2018
Posts: 2
Rep Power: 0 |
Hi Again,
For anyone interested, here is what I ended up doing (although, I get the feeling no one else really has this issue). Since I am not very confident with C++, I used some post processing function and paraview to accomplish this. My process: 1. I added the following lines to my controlDict to utilise OpenFOAM's wallShearStress function. My control dictionary specified most of the required and optional variables. I effectively only needed "type" and "libs". I left everything else commented for reference. Code:
wallShearStress_screw { // Mandatory entries (unmodifiable) type wallShearStress; libs ("libfieldFunctionObjects.so"); //// Optional entries (runtime modifiable) //patches (patch); // (wall1 "(wall2|wall3)"); //// Optional (inherited) entries //writePrecision 8; //writeToFile true; //useUserTime true; //region region0; //enabled true; //log true; //timeStart 0; //timeEnd 1000; //executeControl timeStep; //executeInterval 1; //writeControl timeStep; //writeInterval 1; } Code:
interDyMFoam -postProcess 4. I used the calculator to create a field for density. Some FOAMers have set up their simulations so that density is a recorded output, so this might not be necessary in all cases. Density is required for my specific simulation since it is two-phase (hence the use of "interDyMFoam"). 5. I created another calculator filter that calculated the viscous pressure. The calculator result name was "pViscous" and the entry was "-rho * wallShearStress". 6. I used the filter "generate surface normals" to create the "Normals" vector. 7. I used the calculator filter with the result name "pStatic" to calculate the hydrostatic component of pressure in my simulation with the entry "-p * Normals". 8. I calculated the cartesian distance from each cell to the centre of rotation. For brevity I just named the variable "CoR" in the calculator filter with the entry as "coordsX*iHat + (coordsY - 3.02916953)*jHat + (coordsZ - 3)*kHat". The numbers within the brackets correspont to the offset of the centre of rotation from the origin. I suppose you may be able to skip this step if you have the cell/point locations specified and the centre of rotation is the origin. 9. Next I found the torque values. Everything will eventually be integrated across the area of my domain's "blade" boundary. So, this step actually calculates the moment/torque divided by the area of each cell technically... (If you are concerned with units while you read my explanation here). The first calculator filter was for result name "momentStatic" and the entry was "-cross(forcesPressure, CoR)". 10. The final calculator filter was for result name "momentViscous" with the entry "-cross(forcesViscous, CoR)". 11. Then, I used various "clip" filters in paraview to break the "blade" boundary down to the segments I wanted to analyse. This step is very much geometry dependent, so I won't go into to much detail here. Suffice to say: I used the "clip" filter to get my desired geometries. 12. I used the "integrate variables" filter. Now the "momentStatic" and "momentViscous" terms are actually in units of a torque/moment. 13. Finally, I saved the data for all timesteps with a desired precision. The data is now in a format that you can easily post process with Python or MATLAB. I hope this helps someone else! |
|
November 4, 2022, 03:19 |
|
#3 | |
Member
Geon-Hong Kim
Join Date: Feb 2010
Location: Ulsan, Republic of Korea
Posts: 36
Rep Power: 16 |
Wow, what a work!
Quote:
|
||
Tags |
faceset, forces, function objects, patches, post process |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Heat source by cell chtMultiRegionSimpleFoam | LidaSa | OpenFOAM Running, Solving & CFD | 36 | August 3, 2024 02:42 |
How to solve the boundary layer without wall functions? | WhiteW | OpenFOAM Running, Solving & CFD | 4 | January 20, 2020 05:55 |
postProcess functionality in openFOAM 4 | bullmut | OpenFOAM Post-Processing | 23 | July 21, 2017 10:11 |
[Commercial meshers] CCM+ Mesh Conversion | Ingenieur | OpenFOAM Meshing & Mesh Conversion | 17 | February 2, 2014 10:34 |
[swak4Foam] Mass flow rate through faceSet using swak4foam | CedricVH | OpenFOAM Community Contributions | 5 | May 4, 2012 08:57 |