|
[Sponsors] |
July 13, 2009, 07:19 |
Is there an 'internal' boundary condition?!
|
#1 |
Senior Member
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 20 |
Hello World.
Due to the fact that the sample tool can't handle curved surfaces I had to create a patch, which can be accessed from sample. The patch containing the surfaces of interest lie within the domain and I created a patch (or rather two) from the faceSet using splitMesh. This patch (or faceSet) should stay 'internal' so I am running into a problem which boundary condition I should choose. Because of the fact that this patch has no physical meaning and its sole purpose is the sample location it should simple be treated as an internal surface. How can I assign an appropriate boundary condition to this patch?
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!" |
|
July 14, 2009, 03:16 |
|
#2 |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,715
Rep Power: 40 |
You'd need something like a cyclic patch (maybe see the jump condition too), but then you have to ensure that the face numbering matches up etc (lots of annoying work).
IMO you should actually just attempt to solve the problem directly - it would be less work and be more useful in the future. That is to say, write some new sampledFaceSet/sampledFaceZone classes. The classes would resemble in large sampledPatch, but get their values from a faceSet or faceZone, respectively. I think that others could benefit from it too. |
|
July 14, 2009, 03:50 |
|
#3 | |
Senior Member
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 20 |
Quote:
Unfortunately I don't know how writing such a class can be done. Do you have a suggestion where I could start investigating on this subject?
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!" |
||
July 14, 2009, 04:23 |
|
#4 |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,715
Rep Power: 40 |
It really isn't too difficult. In src/sampling/sampledSurface, there is a sampledPatch class. Copy it to sampledFaceSet (for example), change all the class names in the file and then build the list of faces from the faceSet.toc(). There'll also be other things to adjust, but once you get started you'll find it isn't too hard.
|
|
July 14, 2009, 04:56 |
|
#5 |
Senior Member
Henrik Rusche
Join Date: Mar 2009
Location: Wernigerode, Sachsen-Anhalt, Germany
Posts: 281
Rep Power: 18 |
Dear Sebastian,
there are more alternatives 1) Create two separate meshes + equation coupling ($FOAM_TUTORIALS/conjugateHeatFoam/heatedBlock/) 2) Single mesh + topological changes ($FOAM_TUTORIALS/icoDyMFoam/mixer2D/) none of which I would recommend. All the sampling is on runtime-selection. So have a look through here $FOAM_SRC/sampling/sampledSurface/plane/sampledPlane.C $FOAM_SRC/sampling/sampledSurface/patch/sampledPatch.C and create a modified version that uses a faceZone to set up the interpolation. Henrik |
|
July 14, 2009, 05:43 |
|
#6 |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,715
Rep Power: 40 |
||
July 14, 2009, 05:52 |
|
#7 | |
Senior Member
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 20 |
Quote:
Meanwhile I have to say I made a huge effort to create a faceSet. What is the difference between faceSet and faceZone? Do I have to discard my work on the faceSet?
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!" |
||
July 14, 2009, 06:08 |
|
#8 | |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,715
Rep Power: 40 |
Quote:
A {face,cell,point}Set is stored as a labelHash. A {face,cell,point}Zone is stored as a labelList. A {face,cell,point} can belong to any number of sets, but can only belong to zero or one zones. The zones have the advantage that they are directly part of the polyMesh class. Since there is a maximum of one-to-one correspondence between a face and its zone, renumbering (eg, domain-decomposition) works much more easily. Depending on how you create your sets, you might be able to create zones directly. Otherwise, the 'setsToZones' utility might help you. |
||
July 14, 2009, 07:56 |
|
#9 | |
Senior Member
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 20 |
Quote:
I think this is too much for me as I don't have any idea what I am doing. Blindly replacing names just don't seems right to me in such a challenging task. What is the meaning of "build the list of faces from the faceSet.toc()"? I thought "building" involves some wmake command?
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!" |
||
July 14, 2009, 08:05 |
|
#10 | |
Senior Member
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 20 |
Quote:
Thanks for your suggestion. The code in these two files look even worse to me than sampledSurface. As I have mentioned in my previous post I fear we are overestimating my knowledge in this case. I can only suggest you take my problem as a recommendation for some future implementation (which should be done by someone more experienced). Meanwhile I will take a look into your 'reciepe' for beginners in http://www.cfd-online.com/Forums/ope...ogramming.html
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!" |
||
July 14, 2009, 09:02 |
|
#11 |
Senior Member
Henrik Rusche
Join Date: Mar 2009
Location: Wernigerode, Sachsen-Anhalt, Germany
Posts: 281
Rep Power: 18 |
Dear Sebastian,
"SampledSurface is the virtual base class of both sampledPlane and sampledPatch and cannot be instantiated or used on its own" If your asking yourself: - How do I know that sampledSurface is the base class - How do I know that sampledSurface is virtual - and why it cannot be instatiated or used then, IMHO, you will find it quite hard to make this fly. However, I can only stress what Mark said: This is not very difficult, especially if you create the sampledSurface from a faceZone, but it requires some basic C++-knowledge. Saying that, the questions above are not really covered by the step-by-step intro to OF programming that I mapped out in the link. So questions remains: "What do I need to know to be able to do XYZ in OpenFOAM?". I would love to see such step-by-step guides on the Wiki - for future reference and to throw at newbies I think the first thing to do would be to formulate what YOU want to be able to do and then WE can start threads/Wiki documents to provide step-by-step guides. A list of books (or better chapters of books) would be helpful, too. Henrik |
|
July 14, 2009, 09:26 |
|
#12 | ||
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,715
Rep Power: 40 |
Quote:
Quote:
Code:
labelList myFaces = myFaceSet.toc(); // or to avoid copying labelList myFaces(myFaceSet.size()); label i=0; forAllConstIter(labelHashSet, myFaceSet, iter) { myFaces[i++] = iter.key(); } |
|||
July 14, 2009, 10:09 |
|
#13 | |
Senior Member
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 20 |
Quote:
I'm glad I've got your attention - I appreciate that. As proposed by you I will give you an overview what I want to do. As a matter of fact I have scattered these information all over the forum, but I will give you a short overview. Although it is not directly related to the sampling-solution I will tell what simulation we are dealing with. Its the turbulent simulation of the flow inside of an axisymmetric 3D domain (actually its the combustion chamber of an aircraft's turbine). After the simulation inside the domain is finished we want to take a close look on some part of the domain. Have a look at this image. I'm talking about the red sub-domain: We want to use a different solver and a different discretization on the sub-domain (which exists separately from the big domain!) as we assume there is something interesting happening to the fuel jet. This should be made possible by:
But in the real case we are dealing with curved surfaces whose boundaries lie within the domain and therefore can't be accessed by the sample tool (which deals only with cutting planes or patches). This is why I thought about making sample work on faceSets, because the faces of interest (the red ones) can easily be selected as one. I hope I made the case clear. Discussion is open ...
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!" |
||
July 14, 2009, 10:11 |
|
#14 |
Senior Member
Henrik Rusche
Join Date: Mar 2009
Location: Wernigerode, Sachsen-Anhalt, Germany
Posts: 281
Rep Power: 18 |
Dear Mark, dear Sebastian,
why don't you both come to the Stammtisch and do the trade there (programming and payment)? Henrik |
|
July 7, 2014, 08:49 |
creating circular patch
|
#15 |
Member
CFDUser
Join Date: Mar 2014
Posts: 59
Rep Power: 13 |
Hi,
I have gone through this threat and felt like it is the better place to seek if it is possible to create circular patch on hex faces. topoSet can be used to list all the faces in specified circular region and can create new patch but solution is diffusive as the patch looks like castled circle. Is there any way to create circular patches? Regards, CFDUser_ |
|
March 26, 2019, 13:23 |
|
#16 | |
Senior Member
Reviewer #2
Join Date: Jul 2015
Location: Knoxville, TN
Posts: 141
Rep Power: 11 |
Quote:
For who came after that is trying to define the monitor patch within the mesh, you just need to delete the internal face in boundary file under polyMesh and use the faceZone as the index for the monitor |
||
March 23, 2022, 11:49 |
|
#17 | |
New Member
saeed sangchooly
Join Date: Feb 2022
Posts: 17
Rep Power: 4 |
Quote:
I'm new to openfoam how should I use the faceZone as the index foe the monitor? |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Boundary Conditions | Thomas P. Abraham | Main CFD Forum | 20 | July 7, 2013 06:05 |
inlet velocity boundary condition | murali | CFX | 5 | August 3, 2012 09:56 |
how to set up a wall boundary condition according to calculated wall shear stress? | gameoverli | OpenFOAM Pre-Processing | 1 | May 21, 2009 09:28 |
spanwiperiodic boundary condition for LES | Sungho Yoon | CFX | 5 | July 8, 2008 07:21 |
Boundary Condition of internal Faces | Gernot | FLUENT | 5 | August 26, 2005 14:02 |