[MOAB-dev] Neumann boundary condition

Iulian Grindeanu iulian at mcs.anl.gov
Wed Dec 11 18:00:13 CST 2013


----- Original Message -----

| | What solver do you use?
| 
| I'm trying to implement MOAB in our CFD code
| | Again, I don't understand the question, what do you need?
| 
| Initially i've got only nodes and hexes.

| Every time step i've got loop over cells (hexes). For each cell the
| scheme demands info from its each face. I can get faces with
| get_adjacencies method. I've read somewhere that after first calling
| of that method MOAB stores faces array internally to speed up future
| calls. Or i should better store them myself before time-stepping?

moab, after first adjacency call, will store up-vertex adjacencies (so for each vertex in the mesh, what are the entities adjacent to each vertex; it will be a list ordered by handles, it will contain edges, faces, hexas) 
In your case, you should first create all faces with get_adjacency() call, with create = true 
No edges will be created if you do not request it. 

These lists (upvertex adjacencies) will be used for subsequent adjacency calls, to determine the adjacency between a face and a hex, for example; 

If you do it many times, it may be better to store those adjacencies yourself, in your arrays/data 

| | Opposing face to what?
| 
| For each face X i also have to get two faces which are:
| - belong to the cells sharing face X
| - not having common vertices with face X
| That's what i meant by faces lying opposite to face X

| Sorry for not always being clear

You can use for this: 
ErrorCode MeshTopoUtil::opposite_entity(const EntityHandle parent, 
const EntityHandle child, 
EntityHandle &opposite_element) 

Again, if you do it many times, it may be better to store that info somewhere else. 

be careful about orientation of the face within a hexa; you can use side_number to see how are they oriented 
(so one face between 2 hexas will be oriented positively for one, and negatively for the other one; moab convention is positive if its normal points outward) 

| Thanks

Best Regards, 
Iulian 

| On Wed, 11 Dec 2013 16:56:35 -0600 (CST), Iulian Grindeanu wrote:
| | p { margin: 0; }
| 

| | | So, as i can understand, any value of NEUMANN_SET tag corresponds
| | | to
| | | some certain rule implemented in solver
| | 
| 
| | the value is set by the user, but used by the solver. What solver
| | do
| | you use? for moab, the value is just an integer, and should be
| | unique for each set, but it is not mandatory. It is really just a
| | way to group and differentiate boundary conditions;
| 

| | | I've got one more question - having only nodes and hexagonals in
| | | .h5m
| | | mesh file, what is the best way to find and store the opposite
| | | face
| | | from the neighbouring cell for each hexagonal's face?
| | 
| 
| | hexagons? I assume you mean hexahedra, because you are asking about
| | "faces". A hexagon is 2d, it has only one face, in moab terms.
| 
| | a hexahedron has 6 faces.
| 

| | a hexahedron can have though 6 neighbors, with which shares a face
| | (unless it is on the boundary).
| 
| | Again, I don't understand the question, what do you need?
| 
| | from each hexahedron, you get the connected vertices with
| | get_connectivity; you can get adjacent faces with get_adjacencies
| | method.
| 

| | Opposing face to what?
| 
| | A common face between 2 hexagons can be found with get_adjacencies
| | method too, something like this:
| 
| | std::vector adjacencies, from_entities = {hex1, hex2};
| 
| | // generate common face between these 2 hexas, if it exists
| 
| | mb->get_adjacencies( from_entities, 2, 2, true, adjacencies,
| | Interface::INTERSECT);
| 

| | // adjacencies.size() should be 1 (or 0, if the hexes for not share
| | a
| | face)
| 

| | Iulian
| 

| | | Thanks
| | 
| 

| | | On Wed, 11 Dec 2013 15:25:00 -0600 (CST), Iulian Grindeanu wrote:
| | 
| 
| | | | p { margin: 0; }
| | | 
| | 
| 
| | | | programmatically?
| | | 
| | 
| 
| | | | a neumann set in moab is usually a set of boundary faces (quads
| | | | in
| | | | a
| | | | hexahedral mesh, or triangles in a tetrahedral mesh)
| | | 
| | 
| 
| | | | what kind of solver do you have?
| | | 
| | 
| 
| | | | if you know the tag value, you can obtain the set that has that
| | | | tag
| | | | value, with something like
| | | 
| | 
| 
| | | | Range neumann_sets;
| | | 
| | 
| 
| | | | Tag neu_tag;
| | | 
| | 
| 
| | | | int value_neumann_tag= 100; // your value, set it accordingly
| | | 
| | 
| 

| | | | mb->tag_get_handle(NEUMANN_SET_TAG_NAME, neu_tag, 1,
| | | | MB_TYPE_INTEGER);
| | | 
| | 
| 
| | | | mb->get_entities_by_type_and_tag(0, MBENTITYSET, &neu_tag,
| | | | &value_neumann_tag, 1, neumann_sets);
| | | 
| | 
| 

| | | | neumann_sets[0] should be your set.
| | | 
| | 
| 

| | | | then you can get entities from it with
| | | 
| | 
| 
| | | | Range entities;
| | | 
| | 
| 
| | | | mb->get_entities_by_handle(neumann_sets[0], entities);
| | | 
| | 
| 

| | | | Entities should be your quads or triangles. it is up to the
| | | | specific
| | | | solver syntax to set pressure on them (or other BCs)
| | | 
| | 
| 

| | | | Maybe I didn't understand your question
| | | 
| | 
| 

| | | | Iulian
| | | 
| | 
| 

| | | | | Hello MOAB-dev,
| | | | 
| | | 
| | 
| 

| | | | | Can you please explain how can i set a certain Neumann
| | | | | boundary
| | | | | condition
| | | | 
| | | 
| | 
| 
| | | | | for selected set of faces via NEUMANN_SET tag?
| | | | 
| | | 
| | 
| 

| | | | | For example the normal derivative of pressure
| | | | 
| | | 
| | 
| 

| | | | | Thanks
| | | | 
| | | 
| | 
| 
| | | | | Anton
| | | | 
| | | 
| | 
| 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/moab-dev/attachments/20131211/5fb93bf4/attachment-0001.html>


More information about the moab-dev mailing list