|
[Sponsors] |
Using topoSet/swakExpression to select faces 2cm above ground |
![]() |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
![]() |
![]() |
#1 |
Member
Timm Severin
Join Date: Mar 2014
Location: Munich
Posts: 63
Rep Power: 13 ![]() |
Hello there,
I have a (sloped) channel, for which I have an inlet patch defined. Now I don't want the whole inlet to act as such, but only a small, 1cm high part of it (see attached image). My approach was to select all faces of the original inlet patch, remove the 1cm part (which starts 2cm above the bottom) and then declare the selected faces as wall patch. This process generally works, but I can't select the correct cells dynamically. My topoSetDict looks as follows: Code:
actions ( { name inletWallSet; type faceSet; action new; source patchToFace; sourceInfo { name inlet; } } { name inletWallSet; type faceSet; action delete; source expressionToFace; sourceInfo { variables ( "inletStart=0.02;" "inletHeight=0.01;" "zMin=min(pos().z);" "start=zMin+inletStart;" "end=zMin+inletStart+inletHeight;" ); debugCommonDriver 1; expression "fpos().z>=interpolate(start)&&fpos().z<=interpolate(end)"; } } ); I have tried working with onPatch(inlet), (e.g. zMin="(onPatch(inlet) ? fpos().z : surf(999);"), but this either fails or always pretends that the minimum value is 0 (which is right, incidently, but when i translate the mesh in z direction it still returns 0, even if this is outside of the bounding box). Is there anything I'm missing? Does anyone have an alternative idea? Thanks for any replies, Timm |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Member
Timm Severin
Join Date: Mar 2014
Location: Munich
Posts: 63
Rep Power: 13 ![]() |
Ok, due to the mass of replies I choose another way and used some basic algebra which I had completely forgotten since leaving school.
However, it now seems to be running, so I present the new topoSet source "patchPartToFace". An entry for this looks lie this: Code:
{ name selectFaceSet; type faceSet; action new; source patchPartToFace; sourceInfo { name inlet; radius 0.03; direction (1 0 0); inside true; } } Based on the name, it selects a patch and tries to figure out what is the least distance of the vector given by dir and the coordinates of all patch faces is. This basically moves the given direction vector onto the plane that is the patch. When this is done, all cells that are within radius around this vector will be selected (inside = true) or not selected (inside = false). To use it, extract the attached .zip file, and run "wmake lib" in the main directory "topoSet". The library will be install in $FOAM_USER_LIBBIN as libtopoSet. If you want to use it, you will also need to add it in the controlDict under libs(); Example: To achieve the goal I posted in the image of the first post, I used the following commands: Code:
{ name inletWallSet; type faceSet; action delete; source patchPartToFace; sourceInfo { name inlet; radius 0.03; direction (1 0 0); inside true; } } { name inletWallSet; type faceSet; action add; source patchPartToFace; sourceInfo { name inlet; radius 0.02; direction (1 0 0); inside true; } } |
|
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
decomposePar no field transfert | Jeanp | OpenFOAM Pre-Processing | 3 | June 18, 2022 12:01 |
decomposePar problem: Cell 0contains face labels out of range | vaina74 | OpenFOAM Pre-Processing | 37 | July 20, 2020 05:38 |
Cluster ID's not contiguous in compute-nodes domain. ??? | Shogan | FLUENT | 1 | May 28, 2014 15:03 |
decomposePar pointfield | flying | OpenFOAM Running, Solving & CFD | 28 | December 30, 2013 15:05 |
[Commercial meshers] fluentMeshToFoam multidomain mesh conversion problem | Attesz | OpenFOAM Meshing & Mesh Conversion | 12 | May 2, 2013 10:52 |