|
[Sponsors] |
[blockMesh] Create internal faces as patch in blockMesh |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 30, 2017, 07:40 |
Create internal faces as patch in blockMesh
|
#1 |
New Member
Masoud
Join Date: Nov 2015
Posts: 6
Rep Power: 11 |
Hi,
This blockMesh is for a fluidic oscillator and i want to make patches at entrance and exit of feedback channels. I want to make internal faces as a patch or plane to calculate mass flow rate and pressure on these patches using blockMesh. I think i need to use toposet and then CreatePatch to construct these patches but i dont know how to set data inside topoSetDict and how exactly specifying in the topoSetDict where to create these faces.Thank you. Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.3.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object blockMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // convertToMeters 0.001; vertices ( (0 -5.15 0) // 0 (23.475 -5.15 0) // 1 (23.475 5.15 0) // 2 (0 5.15 0) // 3 (0 -5.15 3.25) // 4 (23.475 -5.15 3.25) // 5 (23.475 5.15 3.25) // 6 (0 5.15 3.25) // 7 (48.6 -1.275 0) // 8 (48.6 1.275 0) // 9 (48.6 -1.275 3.25) // 10 (48.6 1.275 3.25) // 11 (52.3 -1.63 0) // 12 (52.3 1.63 0) // 13 (52.3 -1.63 3.25) // 14 (52.3 1.63 3.25) // 15 (48.6 -11.85 0) // 16 (52.3 -8.15 0) // 17 (48.6 -11.85 3.25) // 18 (52.3 -8.15 3.25) // 19 (52.3 8.15 0) // 20 (48.6 11.85 0) // 21 (52.3 8.15 3.25) // 22 (48.6 11.85 3.25) // 23 (68.4 -11.85 0) // 24 (64.6 -8.15 0) // 25 (68.4 -11.85 3.25) // 26 (64.6 -8.15 3.25) // 27 (64.6 8.15 0) // 28 (68.4 11.85 0) // 29 (64.6 8.15 3.25) // 30 (68.4 11.85 3.25) // 31 (54.6 -4.4 0) // 32 (54.6 4.4 0) // 33 (54.6 -4.4 3.25) // 34 (54.6 4.4 3.25) // 35 (64.6 -4.4 0) // 36 (64.6 4.4 0) // 37 (64.6 -4.4 3.25) // 38 (64.6 4.4 3.25) // 39 (68.4 -6.25 0) // 40 (68.4 -6.25 3.25) // 41 (68.4 6.25 0) // 42 (68.4 6.25 3.25) // 43 (70.85 -1.7 0) // 44 (70.85 1.7 0) // 45 (70.85 -1.7 3.25) // 46 (70.85 1.7 3.25) // 47 (70.85 0 0) // 48 (70.85 0 3.25) // 49 (76.5 -10.825 0) // 50 (78.6 0 0) // 51 (76.5 -10.825 3.25) // 52 (78.6 0 3.25) // 53 (76.5 10.825 0) // 54 (76.5 10.825 3.25) // 55 (87.5 -10.825 0) // 56 (87.5 -3.425 0) // 57 (87.5 -10.825 3.25) // 58 (87.5 -3.425 3.25) // 59 (87.5 3.425 0) // 60 (87.5 10.825 0) // 61 (87.5 3.425 3.25) // 62 (87.5 10.825 3.25) // 63 ); blocks ( hex (0 1 2 3 4 5 6 7) (300 60 25) simpleGrading ( 1 // x-direction expansion ratio 1 ( (0.2 0.3 3) // 20% y-dir, 30% cells, expansion = 4 (0.6 0.4 1) // 60% y-dir, 40% cells, expansion = 1 (0.2 0.3 0.33) // 20% y-dir, 30% cells, expansion = 0.25 (1/4) ) ) // A hex (1 8 9 2 5 10 11 6) (300 60 25) simpleGrading ( 1 // x-direction expansion ratio 1 ( (0.2 0.3 3) // 20% y-dir, 30% cells, expansion = 4 (0.6 0.4 1) // 60% y-dir, 40% cells, expansion = 1 (0.2 0.3 0.33) // 20% y-dir, 30% cells, expansion = 0.25 (1/4) ) ) // B hex (8 12 13 9 10 14 15 11) (40 60 25) simpleGrading ( 1 // x-direction expansion ratio 1 ( (0.2 0.3 3) // 20% y-dir, 30% cells, expansion = 4 (0.6 0.4 1) // 60% y-dir, 40% cells, expansion = 1 (0.2 0.3 0.33) // 20% y-dir, 30% cells, expansion = 0.25 (1/4) ) ) // C hex (8 16 17 12 10 18 19 14) (100 40 25) simpleGrading ( 1 // x-direction expansion ratio 1 ( (0.2 0.3 3) // 20% y-dir, 30% cells, expansion = 4 (0.6 0.4 1) // 60% y-dir, 40% cells, expansion = 1 (0.2 0.3 0.33) // 20% y-dir, 30% cells, expansion = 0.25 (1/4) ) ) // D hex (13 20 21 9 15 22 23 11) (100 40 25) simpleGrading ( 1 // x-direction expansion ratio 1 ( (0.2 0.3 3) // 20% y-dir, 30% cells, expansion = 4 (0.6 0.4 1) // 60% y-dir, 40% cells, expansion = 1 (0.2 0.3 0.33) // 20% y-dir, 30% cells, expansion = 0.25 (1/4) ) ) // E hex (16 24 25 17 18 26 27 19) (140 40 25) simpleGrading ( 1 // x-direction expansion ratio 1 ( (0.2 0.3 3) // 20% y-dir, 30% cells, expansion = 4 (0.6 0.4 1) // 60% y-dir, 40% cells, expansion = 1 (0.2 0.3 0.33) // 20% y-dir, 30% cells, expansion = 0.25 (1/4) ) ) // F hex (20 28 29 21 22 30 31 23) (140 40 25) simpleGrading ( 1 // x-direction expansion ratio 1 ( (0.2 0.3 3) // 20% y-dir, 30% cells, expansion = 4 (0.6 0.4 1) // 60% y-dir, 40% cells, expansion = 1 (0.2 0.3 0.33) // 20% y-dir, 30% cells, expansion = 0.25 (1/4) ) ) // G hex (12 32 33 13 14 34 35 15) (33 60 25) simpleGrading ( 1 // x-direction expansion ratio 1 ( (0.2 0.3 3) // 20% y-dir, 30% cells, expansion = 4 (0.6 0.4 1) // 60% y-dir, 40% cells, expansion = 1 (0.2 0.3 0.33) // 20% y-dir, 30% cells, expansion = 0.25 (1/4) ) ) // H hex (32 36 37 33 34 38 39 35) (140 60 25) simpleGrading ( 1 // x-direction expansion ratio 1 ( (0.2 0.3 3) // 20% y-dir, 30% cells, expansion = 4 (0.6 0.4 1) // 60% y-dir, 40% cells, expansion = 1 (0.2 0.3 0.33) // 20% y-dir, 30% cells, expansion = 0.25 (1/4) ) ) // I hex (25 24 40 36 27 26 41 38) (40 40 25) simpleGrading ( 1 // x-direction expansion ratio 1 ( (0.2 0.3 3) // 20% y-dir, 30% cells, expansion = 4 (0.6 0.4 1) // 60% y-dir, 40% cells, expansion = 1 (0.2 0.3 0.33) // 20% y-dir, 30% cells, expansion = 0.25 (1/4) ) ) // J hex (28 37 42 29 30 39 43 31) (40 40 25) simpleGrading ( 1 // x-direction expansion ratio 1 ( (0.2 0.3 3) // 20% y-dir, 30% cells, expansion = 4 (0.6 0.4 1) // 60% y-dir, 40% cells, expansion = 1 (0.2 0.3 0.33) // 20% y-dir, 30% cells, expansion = 0.25 (1/4) ) ) // K hex (36 40 42 37 38 41 43 39) (40 60 25) simpleGrading ( 1 // x-direction expansion ratio 1 ( (0.2 0.3 3) // 20% y-dir, 30% cells, expansion = 4 (0.6 0.4 1) // 60% y-dir, 40% cells, expansion = 1 (0.2 0.3 0.33) // 20% y-dir, 30% cells, expansion = 0.25 (1/4) ) ) // L hex (40 44 45 42 41 46 47 43) (35 60 25) simpleGrading ( 1 // x-direction expansion ratio 1 ( (0.2 0.3 3) // 20% y-dir, 30% cells, expansion = 4 (0.6 0.4 1) // 60% y-dir, 40% cells, expansion = 1 (0.2 0.3 0.33) // 20% y-dir, 30% cells, expansion = 0.25 (1/4) ) ) // M hex (44 50 51 48 46 52 53 49) (60 35 25) simpleGrading ( 1 // x-direction expansion ratio 1 ( (0.2 0.3 3) // 20% y-dir, 30% cells, expansion = 4 (0.6 0.4 1) // 60% y-dir, 40% cells, expansion = 1 (0.2 0.3 0.33) // 20% y-dir, 30% cells, expansion = 0.25 (1/4) ) ) // N hex (48 51 54 45 49 53 55 47) (60 35 25) simpleGrading ( 1 // x-direction expansion ratio 1 ( (0.2 0.3 3) // 20% y-dir, 30% cells, expansion = 4 (0.6 0.4 1) // 60% y-dir, 40% cells, expansion = 1 (0.2 0.3 0.33) // 20% y-dir, 30% cells, expansion = 0.25 (1/4) ) ) // O hex (50 56 57 51 52 58 59 53) (140 35 25) simpleGrading ( 1 // x-direction expansion ratio 1 ( (0.2 0.3 3) // 20% y-dir, 30% cells, expansion = 4 (0.6 0.4 1) // 60% y-dir, 40% cells, expansion = 1 (0.2 0.3 0.33) // 20% y-dir, 30% cells, expansion = 0.25 (1/4) ) ) // P hex (51 60 61 54 53 62 63 55) (140 35 25) simpleGrading ( 1 // x-direction expansion ratio 1 ( (0.2 0.3 3) // 20% y-dir, 30% cells, expansion = 4 (0.6 0.4 1) // 60% y-dir, 40% cells, expansion = 1 (0.2 0.3 0.33) // 20% y-dir, 30% cells, expansion = 0.25 (1/4) ) ) // Q ); edges ( ); boundary ( inlet { type patch; faces ( (0 3 7 4) ); } outlet1 { type patch; faces ( (60 61 63 62) ); } outlet2 { type patch; faces ( (56 57 59 58) ); } walls { type wall; faces ( (2 6 7 3) (0 4 5 1) (2 9 11 6) (1 5 10 8) (8 10 18 16) (12 17 19 14) (9 21 23 11) (13 15 22 20) (17 25 27 19) (16 18 26 24) (21 29 31 23) (20 22 30 28) (13 33 35 15) (12 14 34 32) (33 37 39 35) (32 34 38 36) (25 36 38 27) (24 26 41 40) (28 30 39 37) (29 42 43 31) (42 45 47 43) (40 41 46 44) (44 46 52 50) (50 52 58 56) (51 57 59 53) (51 53 62 60) (54 61 63 55) (45 54 55 47) ); } topBottom { type wall; faces ( (4 7 6 5) (0 1 2 3) (5 6 11 10) (1 8 9 2) (10 11 15 14) (8 12 13 9) (10 14 19 18) (8 16 17 12) (11 23 22 15) (9 13 20 21) (18 19 27 26) (16 24 25 17) (22 23 31 30) (20 28 29 21) (14 15 35 34) (12 32 33 13) (34 35 39 38) (32 36 37 33) (27 38 41 26) (24 40 36 25) (30 31 43 39) (28 37 42 29) (38 39 43 41) (36 40 42 37) (41 43 47 46) (40 44 45 42) (46 49 53 52) (52 53 59 58) (49 47 55 53) (53 55 63 62) (44 50 51 48) (48 51 54 45) (50 56 57 51) (51 60 61 54) ); } merge1 { type wall; faces ( (44 46 47 45) ); } merge2 { type wall; faces ( (44 48 49 46) (48 45 47 49) ); } ); mergePatchPairs ( (merge1 merge2) ); // ************************************************************************* // Last edited by wyldckat; April 30, 2017 at 13:17. Reason: Added [CODE][/CODE] markers |
|
January 30, 2017, 13:42 |
|
#2 |
Senior Member
khedar
Join Date: Oct 2016
Posts: 111
Rep Power: 10 |
1. Please use code blocks to share your code. Its more readable that way. It can be inserted using the "#" button in the edit menu while creating the message.
2. Regarding your problem, this might help: https://www.cfd-online.com/Forums/op...nal-faces.html https://www.youtube.com/watch?v=7Ex1RHDQqIc |
|
February 2, 2017, 07:59 |
|
#3 |
New Member
Masoud
Join Date: Nov 2015
Posts: 6
Rep Power: 11 |
Thank you. I already looked into these links. I want to make internal patch in blockMesh not using Gmsh. If i try to merge 2 faces using mergepatchpairs so there is no patches after that to measure mass flow on them. I want to add internal face as a patch to me use the patchAverage utility to compute the pressure average in given section. How can I set it in the blockMeshDict. Is it possible? How can I set it on the boundary condtions file inside of "0" directory?
I tried the "patch" and "empty" to set internal face patches and blockMesh doesn't work! |
|
February 2, 2017, 09:13 |
|
#4 |
Senior Member
Kevin van As
Join Date: Sep 2014
Location: TU Delft, The Netherlands
Posts: 252
Rep Power: 21 |
You should treat them as external faces.
That is, an internal face comprises two external faces that happen to share the same position in space. As a simple 1D example: Code:
The situation: | | | ext1 int ext2 should be created as: | || | ext1 int1int2 ext2 which is achieved by duplicating the vertices that make up the internal patch, such that you do not create two faces with the same set of vertices. That would be ambiguous! |
|
February 3, 2017, 04:57 |
|
#5 |
Senior Member
|
Hi all,
@m.delta68 1. Are you forced to use patchAverage? Why not use surfaceRegion function object to calculate average value on a faceSet? I.e. you still merge patch pairs, then use topoSet to create faceSet of a given cross-section, and then use surfaceRegion function object (http://cpp.openfoam.org/v4/a02578.html) to calculate average. 2. What BC you are going to use on the created patch to avoid flow disturbance? |
|
February 14, 2017, 04:17 |
|
#6 |
New Member
Masoud
Join Date: Nov 2015
Posts: 6
Rep Power: 11 |
Thank you for your answer alexeym. No i am not forced to use patchAverage. My problem is that i dont know how exactly create faceSet of a given cross-section using topoSet. Can you please tell me what i need to do step by step because i am not familiar with topoSet. I prefer to not define any BC on created patches or maybe set them as empty.
|
|
February 14, 2017, 11:50 |
|
#7 |
Senior Member
|
Since you were going to define patches, guess, you know where your cross-section is located. Use boxToFace topo source to create faceSet (https://github.com/OpenFOAM/OpenFOAM...poSetDict#L248).
Having empty constrain across the flow is not very bright idea. It could be something processor-like, yet surfaceRegion function object is more convenient for the case. |
|
March 6, 2017, 07:51 |
|
#8 |
New Member
Masoud
Join Date: Nov 2015
Posts: 6
Rep Power: 11 |
Thank you alexeym. I did what you said and i used boxToFace topo source to create faceSet and it was Ok. Then i tried to create a patch using "createPatch" command but i have a error:
Create time Create polyMesh for time = 0 Reading createPatchDict Adding new patch feedback as patch 5 from { type patch; } Read 13422 faces from faceSet f0 --> FOAM FATAL ERROR: Face 3121100 specified in set f0 is not an external face of the mesh. This application can only repatch existing boundary faces. From function createPatch in file createPatch.C at line 731. FOAM exiting Is this application just for creating external faces? Can i just use the face which i created by topoSet (without making any patch) and then use surfaceRegion function to calculate mass flow and pressure on the face? |
|
March 7, 2017, 18:12 |
|
#9 |
New Member
Collin Strassburger
Join Date: Feb 2017
Location: Oak Ridge, TN, USA
Posts: 10
Rep Power: 9 |
You're correct that createPatch is only for boundary patches. I have used createBaffles to generate a patch within the field. The process for that is as follows:
1. Add an empty patch to your blockMeshDict 2. Mesh as normal 3. Use faceSet to extract the faces of the cells in the area of interest 4. Use setsToZones to change the faceSet to a faceZone 5. Use createBaffles with the name of your faceZone and the empty patch as the arguments You'll now have a patch which is in the middle of a formerly solid mesh. A few words of caution: If the region of interest is not thin enough, then your patch will not be flat. Also, just because the patch has been extracted does not mean that everything will handle it well (such as extrudeMesh; hopefully this won't be an issue for you). Note: I am running on foam-extend-3.2 so some of the behavior/names may be slightly different. As for your question about surfaceRegion, I have never tried it; however, in my experience, the "surface" operations require a surface rather than a polymesh. |
|
April 3, 2017, 11:35 |
|
#10 |
New Member
Masoud
Join Date: Nov 2015
Posts: 6
Rep Power: 11 |
Thank you for your answer Collin. I have a problem with creating empty patches inside my geometry. If i try to create a patch on the existing internal faces (existing coordinates) it says this patch is already belong to other pairs or its an internal patch. Also if i try to create a new box with new coordinate, So it would be a mesh inside my main mesh. So how do you exactly create empty patches? I just want to calculate mass flow and pressure somewhere in the middle of my mesh which i dont have any surface or patch. Do you know any any external program or any gadget which can do it without creating any surface or patch. For example i can use probes for calculating pressure but i am not sure if its also reliable for mass flow because its just a point.
|
|
April 3, 2017, 15:02 |
|
#11 |
New Member
Collin Strassburger
Join Date: Feb 2017
Location: Oak Ridge, TN, USA
Posts: 10
Rep Power: 9 |
1) To create an empty patch fur use in this instance, you can go into the OF generated boundary files and add a new one manually.
2) As I recall you can set up internal areas within paraview for such things; i.e. not just as a point probe but for area calculations as well. (I'm not sure about this though) |
|
May 2, 2017, 13:21 |
|
#12 | |
New Member
Masoud
Join Date: Nov 2015
Posts: 6
Rep Power: 11 |
Quote:
|
||
May 26, 2017, 13:21 |
|
#13 |
New Member
Collin Strassburger
Join Date: Feb 2017
Location: Oak Ridge, TN, USA
Posts: 10
Rep Power: 9 |
For the sake of assisting all those who come to these forums through search engines and the like, I'd prefer to keep things here.
|
|
July 12, 2018, 05:27 |
|
#14 |
New Member
bangun
Join Date: Feb 2015
Posts: 16
Rep Power: 11 |
Hi,
Is it possible to define a new patch after we run a simulation? My intention is to calculate a force over an area which is not a solid wall, but an area that is in the fluid domain. Perhaps I have a similar problem as given by Mamoud. I need to compute a force instead of a pressure at a single point. I have done the simulation, but did not define a patch to specify the area. I know I can use patchIntegrate command, but haven't specified the area on which I want to integrate the pressure to get the force. In this case, can I define a new patch and then do the integration using the command? Another question is how do I define a patch in a case where the simulation has completed? If someone knows or can suggest me things, I would appreciate it if you share your knowledge. Thank you. eb19 |
|
July 12, 2018, 15:43 |
|
#15 |
New Member
bangun
Join Date: Feb 2015
Posts: 16
Rep Power: 11 |
[QUOTE=Collin;639887]You're correct that createPatch is only for boundary patches. I have used createBaffles to generate a patch within the field. The process for that is as follows:
1. Add an empty patch to your blockMeshDict 2. Mesh as normal 3. Use faceSet to extract the faces of the cells in the area of interest 4. Use setsToZones to change the faceSet to a faceZone 5. Use createBaffles with the name of your faceZone and the empty patch as the arguments .... Hi Collin, Could you please explain a bit further about step 5. I am able to do until step4, but I still do not know how to create a patch from an internal face using this createBaffles command. Or would you please post your createBafflesDict? and what do you mean with "the empty patch as the arguments"? Please help me. Thank you. eb19 |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Decomposing meshes | Tobi | OpenFOAM Pre-Processing | 22 | February 24, 2023 10:23 |
[snappyHexMesh] Error snappyhexmesh - Multiple outside loops | avinashjagdale | OpenFOAM Meshing & Mesh Conversion | 53 | March 8, 2019 10:42 |
[OpenFOAM.org] Compile OF 2.3 on Mac OS X .... the patch | gschaider | OpenFOAM Installation | 225 | August 25, 2015 20:43 |
snappyhexmesh remove blockmesh geometry | philipp1 | OpenFOAM Running, Solving & CFD | 2 | December 12, 2014 11:58 |
Compressor Simulation using rhoPimpleDyMFoam | Jetfire | OpenFOAM Running, Solving & CFD | 107 | December 9, 2014 14:38 |