Difference between revisions of "Grid BC Shape Commands"

From OSUPDOCS
Jump to navigation Jump to search
 
(17 intermediate revisions by the same user not shown)
Line 1: Line 1:
These commands define shapes. All nodes contained within the shape will be assigned [[Grid-Based Boundary Conditions|boundary conditions]] for [[Setting Velocity, Temperature, and Concentration|velocity, temperature and/or concentration]] that are specified within the shape command.
The method to create grid-based boundary conditions was changed in [[NairnMPM]] (April 2017) and [[OSParticulas]] (revision 1170) to the method using [[Grid-Based Boundary Conditions|<tt>GridBC</tt> and <tt>&lt;BCShape&gt;</tt> blocks]]. As a result, all boundary condition commands listed below are deprecated. They still work, but should be replaced by new methods as described below.


== Line (2D or Axisymmetric) ==
== Line (2D or Axisymmetric) ==


The command to select a line through a 2D mesh in scripted files is:
The command to select a line through a 2D mesh in scripted files:


  MoveLine (x1),(y1),(x2),(y2),(tolerance)
  MoveLine (x1),(y1),(x2),(y2),<(tolerance)>
   (one or more velocity, temperature, or concentration condition)
   (one or more velocity, temperature, or concentration condition)
    ...
  EndMoveLine
  EndMoveLine


In <tt>XML</tt> files, a line is selected with:
should be replaced by (and note change in order of parameters):
 
GridBC
  Line (x1),(x2),(y1),(y2),<(tolerance)>
  (one or more velocity, temperature, or concentration condition)
EndGridBC
 
In <tt>XML</tt> files, a line selected with:


  <BCLine units='(units)' x1='(x1)' y1='(y1)' x2='(x2)' y2='(y2)' tolerance='(tolerance)'>
  <BCLine units='(units)' x1='(x1)' y1='(y1)' x2='(x2)' y2='(y2)' tolerance='(tolerance)'>
   (one or more velocity, temperature, or concentration condition)
   (one or more velocity, temperature, or concentration condition)
    ...
  </BCLine>
  </BCLine>


where
should be replaced by:


* <tt>(x1, y1)</tt> to <tt>(x2, y2)</tt> define <tt>(x, y)</tt> coordinates for the points at the beginning and end of the line (or <tt>(R, Z)</tt> coordinates if axisymmetric). The units are mm (or determined by a [[Units Attribute|units attribute]] in <tt>XML</tt> files). In <tt>XML</tt> files, the coordinates can alternatively be specified [[#Relative Grid Locations|relative to the mesh edges]].
<BCShape>
* <tt>(tolerance)</tt> is an optional tolerance. The units are mm (or determined by a [[Units Attribute|units attribute]] in <tt>XML</tt> files). In <tt>XML</tt> files, you can optionally use the format <tt>'*0.5'</tt> to set the tolerance to any factor times the minimum cell dimension in the current mesh.  If it is omitted, the tolerance will be set to a small number appropriate for the current background grid cell dimensions.
  <Line x1='(x1)' y1='(y1)' x2='(x2)' y2='(y2)' tolerance='(tolerance)'>
 
  (one or more velocity, temperature, or concentration condition)
This command will apply [[Setting Velocity, Temperature, and Concentration|velocity, temperature, and/or concentration boundary conditions]] to all nodes within <tt>(tolerance)</tt> of the line from <tt>(x1, y1)</tt> to <tt>(x2, y2)</tt>.
</BCShape>


== Arc (2D or Axisymmetric) ==
== Arc (2D or Axisymmetric) ==


The command to select an arc through a 2D mesh in scripted files is:
The command to select an arc through a 2D mesh in scripted files:


  MoveArc (x1),(y1),(x2),(y2),(startAng),(endAng),<(tolerance)>
  MoveArc (x1),(y1),(x2),(y2),(startAng),(endAng),<(tolerance)>
   (one or more velocity, temperature, or concentration condition)
   (one or more velocity, temperature, or concentration condition)
    ...
  EndMoveLine
  EndMoveLine


In <tt>XML</tt> files, a line is selected with:
should be replaced by (and note change in order of parameters):
 
GridBC
  Arc (x1),(x2),(y1),(y2),(startAng),(endAng),<(tolerance)>
  (one or more velocity, temperature, or concentration condition)
EndGridBC
 
In <tt>XML</tt> files, an arc selected with:


  <BCArc units='(units)' x1='(x1)' y1='(y1)' x2='(x2)' y2='(y2)'
  <BCArc units='(units)' x1='(x1)' y1='(y1)' x2='(x2)' y2='(y2)'
Line 41: Line 52:
  </BCLine>
  </BCLine>


where
should be replaced by


* <tt>(x1, y1)</tt> to <tt>(x2, y2)</tt> define <tt>(x, y)</tt> coordinates for the corners of a rectangular area enclosing the arc (or <tt>(R, Z)</tt> coordinates if axisymmetric). The units are mm (or determined by a [[Units Attribute|units attribute]] in <tt>XML</tt> files). In <tt>XML</tt> files, the coordinates can alternatively be specified [[#Relative Grid Locations|relative to the mesh edges]].
<BCShape>
* <tt>(startAng)</tt> and <tt>(endAng)</tt> give the start and end angle (in degrees) to specify the arc.
    <Arc x1='(x1)' y1='(y1)' x2='(x2)' y2='(y2)'
* <tt>(tolerance)</tt> is an optional tolerance. The units are mm (or determined by a [[Units Attribute|units attribute]] in <tt>XML</tt> files). In <tt>XML</tt> files, you can optionally use the format <tt>'*0.5'</tt> to set the tolerance to any factor times the minimum cell dimension in the current mesh.  If it is omitted, the tolerance will be set to a small number appropriate for the current background grid cell dimensions.
            start='(startAng)' end='(endAng)' tolerance='(tolerance)'>
 
  (one or more velocity, temperature, or concentration condition)
This command will apply [[Setting Velocity, Temperature, and Concentration|velocity, temperature, and/or concentration boundary conditions]] to all nodes within <tt>(tolerance)</tt> of the arc. The arc is traced in a counter-clockwise direction from <tt>(startAng)</tt> to <tt>(endAng)</tt> with angle = 0 corresponding to the position along the positive x axis.
</BCShape>


== Rectangle (2D or Axisymmetric) ==
== Rectangle (2D or Axisymmetric) ==


The command to select a rectangle, which is only available in <tt>XML</tt> files, is
The command to select a rectangle (which is only available in <tt>XML</tt> files)


  <LdRect xmin='(xmin)' xmax='(xmax)' ymin='(ymin)' ymax='(ymax)' units='mm'>
  <LdRect xmin='(xmin)' xmax='(xmax)' ymin='(ymin)' ymax='(ymax)'>
   (one or more velocity, temperature, or concentration condition)
   (one or more velocity, temperature, or concentration condition)
    ...
  </LdRect>
  </LdRect>


* <tt>(xmin)</tt>,  <tt>(xmax)</tt>, <tt>(ymin)</tt>, and <tt>(xmax)</tt>define the <tt>x</tt> and <tt>y</tt> ranges for the rectangular area (or <tt>R</tt> and <tt>Z</tt> ranges if axisymmetric). The units are mm or determined by an optional [[Units Attribute|units attribute]] . The coordinates can alternatively be specified [[#Relative Grid Locations|relative to the mesh edges]].
should be replaced by


This command will apply [[Setting Velocity, Temperature, and Concentration|velocity, temperature, and/or concentration boundary conditions]] to all nodes within the rectangle. Although this command is not available in scripted files, it be be reproduced in scripted files using a [[#Line (2D or Axisymmetric)|line command]]:
<BCShape>
 
  <Rect xmin='(xmin)' xmax='(xmax)' ymin='(ymin)' ymax='(ymax)'>
MoveLine xmin,(ymin+ymax)/2,xmax,(ymin+ymax)/2,(ymax-ymin)/2
   (one or more velocity, temperature, or concentration condition)
   (one or more velocity, temperature, or concentration condition)
    ...
  </BCShape >
  EndMoveLine


== Box or Cylinder (3D) ==
== Box or Cylinder (3D) ==


The command to select a 3D box or cylinder in scripted files is:
The command to select a 3D box or cylinder in scripted files:


  MoveBox (x1),(y1),(z1),(x2),(y2),(z2),<(axis)>
  MoveBox (x1),(y1),(z1),(x2),(y2),(z2),<(axis)>
   (one or more velocity, temperature, or concentration condition)
   (one or more velocity, temperature, or concentration condition)
    ...
  EndMoveBox
  EndMoveBox


In <tt>XML</tt> files, a line is selected with:
should be replaced by (and note change in order of parameters):
 
GridBC
  Box (x1),(x2),(y1),(y2),(z1),(z1)
  (one or more velocity, temperature, or concentration condition)
EndGridBC
 
In <tt>XML</tt> files, a box or cylinder is selected with:


  <BCBox units='(units)' xmin='(x1)' xmax='(x2)' ymin='(y1)' ymax='(y2)'
  <BCBox units='(units)' xmin='(x1)' xmax='(x2)' ymin='(y1)' ymax='(y2)'
                         zmin='(z1)' zmax='(z2)' axis='(axis)'>
                         zmin='(z1)' zmax='(z2)' axis='(axis)'>
   (one or more velocity, temperature, or concentration condition)
   (one or more velocity, temperature, or concentration condition)
    ...
  </BCBox>
  </BCBox>


where
should be replaced by


* <tt>(x1, y1, z1)</tt> and <tt>(x2, y2, z2)</tt> define <tt>(x, y, z)</tt> coordinates for opposite corners of the box. The units are mm (or determined by a [[Units Attribute|units attribute]] in <tt>XML</tt> files). In <tt>XML</tt> files, the coordinates can alternatively be specified [[#Relative Grid Locations|relative to the mesh edges]].
<BCShape>
* <tt>(axis)</tt> is an optional parameter that will convert the shape from a box to the cylinder enclosed within the box with its axis along the specified direction (entered as x, 1, y, 2, z, or 3).
    <Box units='(units)' xmin='(x1)' xmax='(x2)' ymin='(y1)' ymax='(y2)'
 
                        zmin='(z1)' zmax='(z2)' axis='(axis)'>
This command will apply [[Setting Velocity, Temperature, and Concentration|velocity, temperature, and/or concentration boundary conditions]] to all nodes within the specified box or cylinder.
  (one or more velocity, temperature, or concentration condition)
 
</BCShape>
== Relative Grid Locations ==
 
Rather than hard code positions for boundary conditions or shapes that define material points, any coordinate specified in <tt>XML</tt> files (''e.g''., an entry for <tt>(x1)</tt>, <tt>(x2)</tt>, <tt>(xmin)</tt>, <tt>(xmax)</tt>, ''etc.'') can be the text <tt>'min'</tt>, <tt>'max'</tt>, <tt>'min-3'</tt>, <tt>'min+1.2'</tt>, <tt>'max-3.8'</tt>, <tt>'max+2'</tt>, ''etc.'', meaning the minimum, the maximum, or a specified number of cells relative to the minimum or maximum of the [[MPM Grid Generation|current mesh]]. For [[MPM Methods and Simulation Timing|GIMP calculations]] <tt>'min'</tt> and <tt>'max'</tt> will be limits of useable mesh while <tt>'min-1'</tt> and <tt>'max+1'</tt> will be limits to the total mesh. For backward compatibility, <tt>min+</tt>, <tt>min-</tt>, <tt>max+</tt>, and <tt>max-</tt> refer to plus or minus one cell from the minimum or maximum of the current mesh.
 
== Layers of Boundary Conditions ==
 
Grid boundary conditions are typcially placed one a layer of nodes that is outside the body defined by the material points and that layer defines the boundary. When using GIMP methods, however, a particle near the boundary will interact with that boundary layer, but may also interact with nodes beyond a single row of boundary conditions. To prevent non-physical results from the extra nodes that are physcially outside the body, it may be necessary to set up two rows (or columns) of boundary conditions. For example, to have a rigid wall, set the velocity of two rows (or columns) or nodes to be zero. An alternative solution is to fill a boundary area with rigid particles. Rigid particle automatically create the required boundary conditions on two rows (or columns) of nodes.

Latest revision as of 11:01, 8 April 2017

The method to create grid-based boundary conditions was changed in NairnMPM (April 2017) and OSParticulas (revision 1170) to the method using GridBC and <BCShape> blocks. As a result, all boundary condition commands listed below are deprecated. They still work, but should be replaced by new methods as described below.

Line (2D or Axisymmetric)

The command to select a line through a 2D mesh in scripted files:

MoveLine (x1),(y1),(x2),(y2),<(tolerance)>
  (one or more velocity, temperature, or concentration condition)
EndMoveLine

should be replaced by (and note change in order of parameters):

GridBC
  Line (x1),(x2),(y1),(y2),<(tolerance)>
  (one or more velocity, temperature, or concentration condition)
EndGridBC

In XML files, a line selected with:

<BCLine units='(units)' x1='(x1)' y1='(y1)' x2='(x2)' y2='(y2)' tolerance='(tolerance)'>
  (one or more velocity, temperature, or concentration condition)
</BCLine>

should be replaced by:

<BCShape>
  <Line x1='(x1)' y1='(y1)' x2='(x2)' y2='(y2)' tolerance='(tolerance)'>
  (one or more velocity, temperature, or concentration condition)
</BCShape>

Arc (2D or Axisymmetric)

The command to select an arc through a 2D mesh in scripted files:

MoveArc (x1),(y1),(x2),(y2),(startAng),(endAng),<(tolerance)>
  (one or more velocity, temperature, or concentration condition)
EndMoveLine

should be replaced by (and note change in order of parameters):

GridBC
  Arc (x1),(x2),(y1),(y2),(startAng),(endAng),<(tolerance)>
  (one or more velocity, temperature, or concentration condition)
EndGridBC

In XML files, an arc selected with:

<BCArc units='(units)' x1='(x1)' y1='(y1)' x2='(x2)' y2='(y2)'
       start='(startAng)' end='(endAng)' tolerance='(tolerance)'>
  (one or more velocity, temperature, or concentration condition)
    ...
</BCLine>

should be replaced by

<BCShape>
   <Arc x1='(x1)' y1='(y1)' x2='(x2)' y2='(y2)'
            start='(startAng)' end='(endAng)' tolerance='(tolerance)'>
  (one or more velocity, temperature, or concentration condition)
</BCShape>

Rectangle (2D or Axisymmetric)

The command to select a rectangle (which is only available in XML files)

<LdRect xmin='(xmin)' xmax='(xmax)' ymin='(ymin)' ymax='(ymax)'>
  (one or more velocity, temperature, or concentration condition)
</LdRect>

should be replaced by

<BCShape>
  <Rect xmin='(xmin)' xmax='(xmax)' ymin='(ymin)' ymax='(ymax)'>
  (one or more velocity, temperature, or concentration condition)
</BCShape >

Box or Cylinder (3D)

The command to select a 3D box or cylinder in scripted files:

MoveBox (x1),(y1),(z1),(x2),(y2),(z2),<(axis)>
  (one or more velocity, temperature, or concentration condition)
EndMoveBox

should be replaced by (and note change in order of parameters):

GridBC
  Box (x1),(x2),(y1),(y2),(z1),(z1)
  (one or more velocity, temperature, or concentration condition)
EndGridBC

In XML files, a box or cylinder is selected with:

<BCBox units='(units)' xmin='(x1)' xmax='(x2)' ymin='(y1)' ymax='(y2)'
                       zmin='(z1)' zmax='(z2)' axis='(axis)'>
  (one or more velocity, temperature, or concentration condition)
</BCBox>

should be replaced by

<BCShape>
   <Box units='(units)' xmin='(x1)' xmax='(x2)' ymin='(y1)' ymax='(y2)'
                       zmin='(z1)' zmax='(z2)' axis='(axis)'>
  (one or more velocity, temperature, or concentration condition)
</BCShape>