|
[Sponsors] |
How to select certains faces to calculate lift coefficient? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 12, 2017, 16:20 |
How to select certains faces to calculate lift coefficient?
|
#1 |
New Member
Xiaojie Wang
Join Date: Aug 2017
Posts: 9
Rep Power: 9 |
Hi guys,
I want to calculate the lift coefficient of a model with a fan patch created in OpenFOAM. The problem is that I don't want to calculate the lift force on the fan patch. Who knows how to recognize different types of surfaces or select surfaces to do the calculation? Thanks. |
|
October 13, 2017, 04:18 |
|
#2 |
Senior Member
Nejc
Join Date: Feb 2017
Location: Slovenia
Posts: 196
Rep Power: 9 |
If you calculate forces using the forces function object you can choose over which patches to integrate:
https://cpp.openfoam.org/v4/classFoa...s.html#details |
|
October 15, 2017, 10:43 |
|
#3 |
New Member
JPeternel
Join Date: Oct 2014
Posts: 19
Rep Power: 12 |
You can code it into the solver as follows:
You can access the boundary field using .boundaryField(). That returns an array of fields, one for each patch. You can identify patchID of your patch by using .findPatchID("nameOfThePatch") that Will be used to acces the one you need. Looping through boundary field of selected patch you can access data on the faces on that patch to calculate what you want. Like this: //Find patch ID for your patch: label patchID = mesh.boundaryMesh().findPatchID("yourPatchName"); //Store face IDs of your patch: const polyPatch& cPatch = mesh.boundaryMesh()[patchID]; //Field you want to extract values from: const someFieldType& yourFieldRef = yourField //Loop over face IDs of faces that are located on your patch: forAll(cPatch, facei) { //Data you seek: scalar/vector... data = yourFieldRef.boundaryField()[patchID][facei]; } |
|
October 16, 2017, 13:49 |
|
#4 |
New Member
Xiaojie Wang
Join Date: Aug 2017
Posts: 9
Rep Power: 9 |
Hi, Nejc and Jaka, thanks a lot. I have figured it out.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
decomposePar problem: Cell 0contains face labels out of range | vaina74 | OpenFOAM Pre-Processing | 37 | July 20, 2020 06:38 |
[Other] Mesh Importing Problem | cuteapathy | ANSYS Meshing & Geometry | 2 | June 24, 2017 06:29 |
[snappyHexMesh] SHM is not extruding/adding Layers everywhere | matthiasd | OpenFOAM Meshing & Mesh Conversion | 2 | October 16, 2016 17:45 |
How can I calculate force for lift coefficient and drag coefficient ? | gemxx | CFX | 3 | July 4, 2015 09:37 |
how can i calculate the lift and drag coefficient | yujun | Main CFD Forum | 5 | January 23, 2003 16:16 |