CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Is there an 'internal' boundary condition?!

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By olesen
  • 1 Post By randolph

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 13, 2009, 07:19
Default Is there an 'internal' boundary condition?!
  #1
Senior Member
 
sega's Avatar
 
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 20
sega is on a distinguished road
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!"
sega is offline   Reply With Quote

Old   July 14, 2009, 03:16
Default
  #2
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,714
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
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.
ernarasimman likes this.
olesen is offline   Reply With Quote

Old   July 14, 2009, 03:50
Default
  #3
Senior Member
 
sega's Avatar
 
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 20
sega is on a distinguished road
Quote:
Originally Posted by olesen View Post
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.
Yes I have thought about somthing like that, too.
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!"
sega is offline   Reply With Quote

Old   July 14, 2009, 04:23
Default
  #4
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,714
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
Quote:
Originally Posted by sega View Post
Yes I have thought about somthing like that, too.
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?
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.
olesen is offline   Reply With Quote

Old   July 14, 2009, 04:56
Default
  #5
Senior Member
 
Henrik Rusche
Join Date: Mar 2009
Location: Wernigerode, Sachsen-Anhalt, Germany
Posts: 281
Rep Power: 18
henrik is on a distinguished road
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
henrik is offline   Reply With Quote

Old   July 14, 2009, 05:43
Default
  #6
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,714
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
Quote:
Originally Posted by olesen View Post
... then build the list of faces from the faceSet.toc().
A small additional point - use faceZone rather than faceSet if possible.
It is not only more memory efficient, it will also work better with domain decomposition etc.
olesen is offline   Reply With Quote

Old   July 14, 2009, 05:52
Default
  #7
Senior Member
 
sega's Avatar
 
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 20
sega is on a distinguished road
Quote:
Originally Posted by olesen View Post
A small additional point - use faceZone rather than faceSet if possible.
It is not only more memory efficient, it will also work better with domain decomposition etc.
I will try to have a look into this in the afternoon.
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!"
sega is offline   Reply With Quote

Old   July 14, 2009, 06:08
Default
  #8
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,714
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
Quote:
Originally Posted by sega View Post
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?
From storage:
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.
olesen is offline   Reply With Quote

Old   July 14, 2009, 07:56
Default
  #9
Senior Member
 
sega's Avatar
 
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 20
sega is on a distinguished road
Quote:
Originally Posted by olesen View Post
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.
Woho. I had a look into the file, but this is really cryptic to me.
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!"
sega is offline   Reply With Quote

Old   July 14, 2009, 08:05
Default
  #10
Senior Member
 
sega's Avatar
 
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 20
sega is on a distinguished road
Quote:
Originally Posted by henrik View Post

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
Dear Henrik.

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!"
sega is offline   Reply With Quote

Old   July 14, 2009, 09:02
Default
  #11
Senior Member
 
Henrik Rusche
Join Date: Mar 2009
Location: Wernigerode, Sachsen-Anhalt, Germany
Posts: 281
Rep Power: 18
henrik is on a distinguished road
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
henrik is offline   Reply With Quote

Old   July 14, 2009, 09:26
Default
  #12
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,714
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
Quote:
Originally Posted by sega View Post
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.
For a case (or two) of decent Weizen (eg, Erdinger, K. Ludwig, Maisel), I could whip it together for you. We'd just have to sove the transport problem (pun intended).

Quote:
What is the meaning of "build the list of faces from the faceSet.toc()"?
That would simply mean something like this
Code:
  labelList myFaces = myFaceSet.toc();
// or to avoid copying
  labelList myFaces(myFaceSet.size());
  label i=0;
  forAllConstIter(labelHashSet, myFaceSet, iter)
  {
    myFaces[i++] = iter.key();
  }
olesen is offline   Reply With Quote

Old   July 14, 2009, 10:09
Default
  #13
Senior Member
 
sega's Avatar
 
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 20
sega is on a distinguished road
Quote:
Originally Posted by henrik View Post
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
Dear Henrik.

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:
  • sampling all face values on the red area from the first simulation results
  • mapping them on the small domain with the timeVaryingMappedFixedValue boundary condition
We have tested this approach on some simple domain which consists only of plane surfaces and the results are satisfying.

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!"
sega is offline   Reply With Quote

Old   July 14, 2009, 10:11
Default
  #14
Senior Member
 
Henrik Rusche
Join Date: Mar 2009
Location: Wernigerode, Sachsen-Anhalt, Germany
Posts: 281
Rep Power: 18
henrik is on a distinguished road
Dear Mark, dear Sebastian,

why don't you both come to the Stammtisch and do the trade there (programming and payment)?

Henrik
henrik is offline   Reply With Quote

Old   July 7, 2014, 08:49
Default creating circular patch
  #15
Member
 
CFDUser
Join Date: Mar 2014
Posts: 59
Rep Power: 13
CFDUser_ is on a distinguished road
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_
CFDUser_ is offline   Reply With Quote

Old   March 26, 2019, 13:23
Default
  #16
Senior Member
 
Reviewer #2
Join Date: Jul 2015
Location: Knoxville, TN
Posts: 141
Rep Power: 11
randolph is on a distinguished road
Quote:
Originally Posted by sega View Post
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?
I know this post is about 10 years old...
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
babakflame likes this.
randolph is offline   Reply With Quote

Old   March 23, 2022, 11:49
Post
  #17
New Member
 
saeed sangchooly
Join Date: Feb 2022
Posts: 17
Rep Power: 4
saeed sangchooly is on a distinguished road
Quote:
Originally Posted by randolph View Post
I know this post is about 10 years old...
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
dear randolph
I'm new to openfoam
how should I use the faceZone as the index foe the monitor?
saeed sangchooly is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 07:20.