Irregular 3D geometries (CAD, etc.)

This category replaces the missing input manual
User avatar
Jaakko Leppänen
Site Admin
Posts: 2354
Joined: Thu Mar 18, 2010 10:43 pm
Security question 2: 0
Location: Espoo, Finland
Contact:

Irregular 3D geometries (CAD, etc.)

Post by Jaakko Leppänen » Mon Mar 31, 2014 6:40 pm

Serpent 2.1.19 provides two new geometry types, intended for modeling irregular mesh- and surface-based geometries. The idea is to develop methodology that supports models generated using engineering and medical imaging software (CAD, CT, etc.), without conversion to conventional surface-cell-based geometry. The calculation routines are still very much under development, and the work is part of the efforts to extend the applications of Serpent 2 beyond reactor physics. The two models are described below.

Unstructured mesh-based geometry type with OpenFOAM file format

This geometry type was created as a by-product of the unstructured mesh-based multi-physics interface (see related post). The difference is that, instead of passing the state-point information of a single material to the geometry routine, the geometry composition of an entire universe is defined by the OpenFOAM mesh. The syntax for this geometry type is:

Code: Select all

solid 1 <u> <bg>
<msh_split> <msh_dim> <s0> <sz1> ... <sz_dim>
<points_file>
<faces_file>
<owner_file>
<neighbour_file>
<materials_file>
Number 1 after the command word "solid" determines the geometry type, <u> is the universe name and <bg> is the background universe filling all undefined space. The next line defines the search mesh, and the format is similar to the unstructured mesh based multi-physics interface. This is followed by a list of OpenFOAM format files. The last file links the materials to cells, and the format is:

Code: Select all

<nc>
<mat_1>
<mat_2>
...
<mat_nc>
where <nc> is the number of entries (equal to the number of OpenFOAM cells), followed by the list of material names assigned to the respective cells.

The geometry type defines a universe that can be used as any other sub-universe in the geometry. For detectors there an option to link individual OpenFOAM cells to detector bins. The syntax is:

Code: Select all

det <name> dumsh <u> <N>
<c_1> <b_1>
<c_2> <b_2>
...
<c_N> <b_N>
where <u> is the universe name, <N> is the number of cell entries, and the list links cell <c_i> to bin <b_i>. Reaction rates can be calculated in a volume covered by several cells by linking them to a single bin.

CAD-type solid geometry with STL file format

Stereolithography (STL) format 3D solid models, which can be written by most CAD software, can be used to define Serpent geometries using:

Code: Select all

solid 2 <u> <bg>
<msh_split> <msh_dim> <s0> <sz1> ... <sz_dim>
<mode> <r0>
<cell1> <mat1> <file1> <scale1> <x1> <y1> <z1>
<cell2> <mat2> <file2> <scale2> <x2> <y2> <z2>
This creates universe <u>, consisting of cells <cell1> <cell2> ..., filled with materials <mat1> <mat2> ..., and defined by STL solid models read from files <file1> <file2> ... Each solid can be scaled and shifted separately by the factor and local origin followed by the file name. The space between the solids is filled with universe <bg>. Search mesh is defined similar to the OpenFOAM geometry type.

The two remaining parameters, <mode> and <r0> are related to the handling of the triangulated surface within Serpent geometry routine. Due to the STL data structure, adjoining surface triangles are not automatically sharing their corner points, which may create geometry errors due decimal round-off. Radius <r0> defines the minimum distance between two points, inside which they are joined into one. A reasonable value for this parameter is 1E-5.

Parameter <mode> determines the method used by the geometry routine for figuring out whether a point is inside or outside the triangulated surface. Without going into details, let's call these modes 1 = "fast" and 2 = "safe". As the names imply, the "fast" mode is faster, but more prone to errors in the geometry. Currently the method has problems with coinciding surfaces, so if the fast mode fails, try switching to the safe mode.

The STL solids can be checked for errors by sampling random points in the geometry with command line option:

Code: Select all

sss2 -checkstl <N> <M>
The code samples <N> points, and for each point <M> trajectories in random directions. If the triangulated surface has holes, overlaps or other problems, you will get a list of points where this test failed. With the STL solids I've used so far, this test has never had a 100% pass rate when a large number of points are sampled, but the results should be OK if the pass rate is close to 100%. I'm still working on the routines, but there is a chance that there are some errors due to decimal round-off, which cannot be corrected.

Test case

A test case containing OpenFOAM and STL based geometry models of the Stanford Critical Bunny can be found at:

http://virtual.vtt.fi/virtual/montecarl ... o_example/

The Stanford bunny is a classical 3D computer graphics test case, and the critical bunny is a high-enriched uranium variation of the bunny, provided by the Politecnico di Milano.
- Jaakko

User avatar
Jaakko Leppänen
Site Admin
Posts: 2354
Joined: Thu Mar 18, 2010 10:43 pm
Security question 2: 0
Location: Espoo, Finland
Contact:

Re: Irregular 3D geometries (CAD, etc.)

Post by Jaakko Leppänen » Thu Nov 27, 2014 11:49 am

Calculation routines handling STL-format geometry models were completely re-written in update 2.1.22. This fixed many of the problems caused by round-off errors in the ray test routines.

Support for STL files with multiple solids was also added. This required some modifications in the input syntax. The new format is:

Code: Select all

solid 2 <u> <bg>
<msh_split> <msh_dim> <s0> <sz1> ... <sz_dim>
<mode> <r0>
file <file1> <scale1> <x1> <y1> <z1>
file <file2> <scale2> <x2> <y2> <z2>
...
body <solid1> <cell1> <mat1>
body <solid2> <cell2> <mat2>
...
The STL format files are read after keyword "file". Solid bodies defined in the files are linked to cells and materials with keyword "body". The <solid> entry refers to the name given to the object in the STL file.
- Jaakko

User avatar
Jaakko Leppänen
Site Admin
Posts: 2354
Joined: Thu Mar 18, 2010 10:43 pm
Security question 2: 0
Location: Espoo, Finland
Contact:

Re: Irregular 3D geometries (CAD, etc.)

Post by Jaakko Leppänen » Tue Apr 28, 2015 9:56 am

The format was again changed in update 2.1.23, to be better suited for geometries consisting of several STL solids. The new format is:

Code: Select all

solid 2 <u> <bg>
<msh_split> <msh_dim> <s0> <sz1> ... <sz_dim>
<mode> <r0>
body <body1> <cell1> <mat1>
file <body1> <file1> <scale1> <x1> <y1> <z1>
file <body1> <file2> <scale2> <x2> <y2> <z2>
...
body <body2> <cell2> <mat2>
file <body2> <file3> <scale3> <x3> <y3> <z3>
file <body2> <file4> <scale4> <x4> <y4> <z4>
...
The difference to previous is that the files are linked to bodies, which are then linked to cells and materials. In the example syntax STL solids defined in files <file1> and <file2> form a single cell <cell1>, which is filled with material <mat1>. And similarly for solids in files <file3> and <file4> with cell <cell2> and material <mat2>. All components defined in a single "solid" entry belong to the same universe and they share the same search mesh.

Also the example at the website is updated.
- Jaakko

satkinson
Posts: 23
Joined: Thu Apr 09, 2015 6:14 pm
Security question 1: No
Security question 2: 92

Re: Irregular 3D geometries (CAD, etc.)

Post by satkinson » Mon Jun 22, 2015 8:09 pm

Is there a function for meshes to implement nests without smearing the materials into one materials card? I am trying to model TRISO fuel particles using mesh geometry.

User avatar
Jaakko Leppänen
Site Admin
Posts: 2354
Joined: Thu Mar 18, 2010 10:43 pm
Security question 2: 0
Location: Espoo, Finland
Contact:

Re: Irregular 3D geometries (CAD, etc.)

Post by Jaakko Leppänen » Tue Jun 23, 2015 11:19 am

Try the automated division into depletion zones:

http://ttuki.vtt.fi/serpent/viewtopic.php?f=24&t=1776

There's also another thread about using the div-card with particle fuels:

http://ttuki.vtt.fi/serpent/viewtopic.php?f=24&t=2172
- Jaakko

User avatar
Jaakko Leppänen
Site Admin
Posts: 2354
Joined: Thu Mar 18, 2010 10:43 pm
Security question 2: 0
Location: Espoo, Finland
Contact:

Re: Irregular 3D geometries (CAD, etc.)

Post by Jaakko Leppänen » Fri Jun 26, 2015 2:55 pm

Option to use the names given to solid bodies in the STL files was included in update 2.1.24. This option is used if the body name after the "file" entry is replaced by -1. This also allows reading multiple solids from a single file. The body names in the STL files may not contain white space characters, and this option only works with ASCII STL files (the names are not included in binary STL).
- Jaakko

satkinson
Posts: 23
Joined: Thu Apr 09, 2015 6:14 pm
Security question 1: No
Security question 2: 92

Re: Irregular 3D geometries (CAD, etc.)

Post by satkinson » Wed Jul 15, 2015 7:56 pm

Hi Jaakko,

I have split the single materials up as mentioned in the previous post without any issue, however I don't see how to apply this to a problem.

I am looking to use the random particle distribution in an OpenFoam scenario and as far as I am aware the only materials you can place into the tetrahedral cells are basic materials that you define as material cards. Can I call the random particles to be placed within my tetra cell? Or do I have to smear all of the materials across each cell?

satkinson
Posts: 23
Joined: Thu Apr 09, 2015 6:14 pm
Security question 1: No
Security question 2: 92

Re: Irregular 3D geometries (CAD, etc.)

Post by satkinson » Tue Jan 26, 2016 8:56 pm

With the irregular 3d geometries is there a way to output volPower or do you have to follow the multiphysics approach?

I have a lot of volumes (maybe 300) and creating a ifc card for each will take a lot of time which is why I preferred the materials cards. If the irregular geometries method is also intended to be used with OpenFoam it would be useful to be able to pull out the volpowers to get the temperatures of each cell. Or is there a way for serpent to update a temperature file output with each burnup step?

User avatar
Jaakko Leppänen
Site Admin
Posts: 2354
Joined: Thu Mar 18, 2010 10:43 pm
Security question 2: 0
Location: Espoo, Finland
Contact:

Re: Irregular 3D geometries (CAD, etc.)

Post by Jaakko Leppänen » Wed Jan 27, 2016 12:27 pm

Do you mean CAD or mesh-based geometry?

With mesh-based geometries you can use the "dumsh" option with detectors:

Code: Select all

det <name>
dumsh <uni> <N>
<c1> <b1>
<c2> <b2>
...
<cN> <bN>
where <uni> is the mesh universe. You can list <N> mesh cells (<c1>, <c2>, ... ) which are mapped into <N> detector bins (<b1>, <b2>, ...). You can have a single bin for each cell, or you can combine multiple cells in one bin. The list doesn't have to cover all mesh cells in the geometry, but the detector is scored only in the listed cells.

In CAD-based geometries you assign a cell name with one or multiple solids. These cells can be used with detectors as well.
- Jaakko

satkinson
Posts: 23
Joined: Thu Apr 09, 2015 6:14 pm
Security question 1: No
Security question 2: 92

Re: Irregular 3D geometries (CAD, etc.)

Post by satkinson » Thu Feb 04, 2016 6:25 pm

Hi Jakko,

I have used the "solid 1 <u> <bg>" notation in Serpent for my mesh based geometry. I know in the bunny example you can get the VolPower out if you are using the multiphysics approach which you can then multiple to find the temperature in Kelvin for OpenFoam. I was wondering how you can find the temperature using the "solid 1 <u> <bg>" notation. If you can use detectors what is the notation for thermal power in a detector? I will still need a T file out to place into OpenFoam for the next stage. I can swap to the multiphysics approach but it is a lot of leg work as I really appreciate the materials file option as this allows me to break up my materials easily with the celltoregion file from OpenFoam.

I have tried to make my geometry using tetra cells as required by Serpent. However to obtain a realistic volume of the mesh using tetra cells within a cylinder is difficult. So far have only been able to achieve 92.5% meshing volume (and keep my cells to a reasonable level of under 2.5mil) which is having quite a negative effect on my criticality. How does Serpent change non-tetra cells to tetra cells and have you done any experiments with the volumes after conversion, especially with cylinders? I am spending a lot of time creating a mesh which is not tetra based to account for this volume loss but this might all be in vein if Serpent corrects the mesh reduces the volume again.

Cheers

Post Reply