Clockwise Void Frontier

Moderator: GiD Team

Post Reply
mjfigueroa
Posts: 2
Joined: Wed Jul 06, 2016 12:54 am

Clockwise Void Frontier

Post by mjfigueroa »

I am currently using GID to create an input file to be used with Diamond for heat transfer analysis. SAFIR2007 is the process used to analyze the file. When I create a void, I receive the following error:

ERROR from subroutine PROPVOID.
This void has a frontier described clockwise.
Only Counter clockwise description is allowed.

I also tried reversing the order of the elements listed for the void within the input file, but that returned the same error. How can I create a void within GID that is counter clockwise? The swap normals feature does not seem to help either.
User avatar
escolano
Posts: 1922
Joined: Sun Sep 05, 1982 10:51 pm

Re: Clockwise Void Frontier

Post by escolano »

What do you mean by 'a void'?
A hole in a geometrical GiD surface? a hole in a geometrical GiD volume?
When meshing a hole is simple a region without elements. It doesn't exists the concept of 'mesh element holed'.

For GiD surfaces the orientation of its curves is according with the parametric surface normal (Xu x Xv): "advancing along the oriented curve to the left must be the interior of the surface".
In a 2D surface with the normal pointing to +Z the outer boundary curves are counter-clockwise and the inner boundaries (holes) are clockwise.

For GiD volumes the orientation of its boundary surfaces must point inside the volume.

For mesh the GiD elements have its list of nodes arbitrarily ordered like this: http://www.gidhome.com/documents/refere ... ent%20type
Off course when exporting a elements or other data to third part programs they must be written following the syntax expected by this program.

About the faces of elements in GiD are not explicit entities, its definition is implicit in the element. Could see our definition of faces for each element for example in the documentation of the '.bas template command *Globalnodes'
http://www.gidhome.com/documents/custom ... 0commands

In our definition the 'normal of the faces of an element' points inside the element
mjfigueroa
Posts: 2
Joined: Wed Jul 06, 2016 12:54 am

Re: Clockwise Void Frontier

Post by mjfigueroa »

Thank you for your response. I am using the problem type: Safir_Thermal_2d . I create a 2D surface where a "void" is placed as a line condition. I believe it is similar to the hole that you mentioned. The only issue is that voids must be defined as a counterclockwise array of elements. When I use GID, it seems to select the first 2 elements of the void correctly, but the rest of the elements are not correct. They must be adjacent, counterclockwise elements. GID is not selecting adjacent elements for some reason. Please see the example from the GID SAFIR manual.
GID Void.PNG
GID Void.PNG (33.78 KiB) Viewed 5538 times
User avatar
escolano
Posts: 1922
Joined: Sun Sep 05, 1982 10:51 pm

Re: Clockwise Void Frontier

Post by escolano »

If the geometrical lines of the hole are marked with a GiD condition and do you generate a mesh of quadrilaterals from the surface, without explicitly force to generate also the mesh of lines, then the condition will mark the faces of the squares that are created from the line.

The colection of face elements of GiD is not ordered in any way.
In fact, if the case were 3D there is no definition of an 'ordered collection of faces' that enclose a volume or hole
(In the 2D case is is possible to define an ordenation of the faces by the single connectivity of two boundary edges by node)
probably is not a good idea to require this ordenation as input and use an unordered list of edges.
I think that should be enougth that each face element locally is well oriented.

In GiD the face of the quadrilateral element (e.g the *globalnodes .bas command) returns nA->nB, that walks around the element counter-clockwise.
To follow the adjacent hole in counter-clockwise direction, like your picture, you must write the face nodes just in opposite direction
*globalnodes(2) *globalnodes(1)

If it is not possible to modify the input format of Safir_Thermal (that I think that couldn't be genealized to 3D ) then to achieve an ordered collection of edges of a loop (e.g. a hole) then you must invoke from the .bas a *tcl command that do this re-ordenation of the edges (finding nnode-connected edges, starting by an arbitrary initial edge)

e.g. if you condition was defined like this

Code: Select all

CONDITION: hole
CONDTYPE: over lines
CONDMESHTYPE: over face elements
QUESTION: hole_id
Help: some id to identify the hole in case of more than one
VALUE: 0
END CONDITION
and unordered (but well oriented) edges could be

Code: Select all

VOID
*Set cond hole *elems
*loop elems *onlyincond
ELEM *elemsnum *condelemface
*end elems
END_VOID
and to have the list of elements ordered do something like this

Code: Select all

VOID
*tcl(get_hole_edges_ordered)
END_VOID
and in the .tcl command define the procedure

Code: Select all

proc get_hole_edges_ordered { } {
    set result ""
    foreach item [GiD_Info conditions hole mesh] {
	set element_id [lindex $item 0]
	set face_id  [lindex $item 1]
	set question_values [lrange $item 3 end]
	set face_nodes [GiD_Mesh get element $element_id face_linear $face_id]
	lassign $face_nodes n0 n1	
	set data_by_n1($n1) [list $element_id $face_id $n0]	
    }
    set start_node [lindex [array names data_by_n1] 0]
    set data $data_by_n1($start_node)
    lassign $data element_id face_id connect_node
    append result "ELEM $element_id $face_id\n"
    while { $connect_node != $start_node } {
	set data $data_by_n1($connect_node)
	lassign $data element_id face_id connect_node
	append result "ELEM $element_id $face_id\n"
    }
    return $result
}
Post Reply