Skip to content

Commit

Permalink
Merge pull request #23 from ebknudsen/more_c2omc_models
Browse files Browse the repository at this point in the history
More c2omc models
  • Loading branch information
shimwell authored Jan 2, 2024
2 parents be22fb7 + 86fa413 commit 740dbe1
Show file tree
Hide file tree
Showing 21 changed files with 817 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/circular_torus_cad_to_openmc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: circular torus - cad to openmc

on:
pull_request:
branches:
- develop
- main
push:
- main

jobs:
testing:
runs-on: ubuntu-latest
steps:

- name: checkout actions
uses: actions/checkout@v4

- name: use upstream test composite action
uses: ./.github/actions/dependencies

- shell: bash
env:
OPENMC_CROSS_SECTIONS: /home/runner/work/model_benchmark_zoo/model_benchmark_zoo/cross_sections.xml
run: |
source "${HOME}/conda/etc/profile.d/conda.sh"
source "${HOME}/conda/etc/profile.d/mamba.sh"
mamba activate
pytest tests/test_cad_to_openmc/test_csg_cad_circulartorus.py
29 changes: 29 additions & 0 deletions .github/workflows/cuboid_cad_to_openmc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: cuboid - cad to openmc

on:
pull_request:
branches:
- develop
- main
push:
- main

jobs:
testing:
runs-on: ubuntu-latest
steps:

- name: checkout actions
uses: actions/checkout@v4

- name: use upstream test composite action
uses: ./.github/actions/dependencies

- shell: bash
env:
OPENMC_CROSS_SECTIONS: /home/runner/work/model_benchmark_zoo/model_benchmark_zoo/cross_sections.xml
run: |
source "${HOME}/conda/etc/profile.d/conda.sh"
source "${HOME}/conda/etc/profile.d/mamba.sh"
mamba activate
pytest tests/test_cad_to_openmc/test_csg_cad_cuboid.py
29 changes: 29 additions & 0 deletions .github/workflows/cylinder_cad_to_openmc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: cylinder - cad to openmc

on:
pull_request:
branches:
- develop
- main
push:
- main

jobs:
testing:
runs-on: ubuntu-latest
steps:

- name: checkout actions
uses: actions/checkout@v4

- name: use upstream test composite action
uses: ./.github/actions/dependencies

- shell: bash
env:
OPENMC_CROSS_SECTIONS: /home/runner/work/model_benchmark_zoo/model_benchmark_zoo/cross_sections.xml
run: |
source "${HOME}/conda/etc/profile.d/conda.sh"
source "${HOME}/conda/etc/profile.d/mamba.sh"
mamba activate
pytest tests/test_cad_to_dagmc/test_csg_cad_cylinder.py
29 changes: 29 additions & 0 deletions .github/workflows/elliptical_torus_cad_to_openmc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: elliptical torus - cad to openmc

on:
pull_request:
branches:
- develop
- main
push:
- main

jobs:
testing:
runs-on: ubuntu-latest
steps:

- name: checkout actions
uses: actions/checkout@v4

- name: use upstream test composite action
uses: ./.github/actions/dependencies

- shell: bash
env:
OPENMC_CROSS_SECTIONS: /home/runner/work/model_benchmark_zoo/model_benchmark_zoo/cross_sections.xml
run: |
source "${HOME}/conda/etc/profile.d/conda.sh"
source "${HOME}/conda/etc/profile.d/mamba.sh"
mamba activate
pytest tests/test_cad_to_openmc/test_csg_cad_ellipticaltorus.py
29 changes: 29 additions & 0 deletions .github/workflows/nested_cylinder_cad_to_openmc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: nested cylinder - cad to openmc

on:
pull_request:
branches:
- develop
- main
push:
- main

jobs:
testing:
runs-on: ubuntu-latest
steps:

- name: checkout actions
uses: actions/checkout@v4

- name: use upstream test composite action
uses: ./.github/actions/dependencies

- shell: bash
env:
OPENMC_CROSS_SECTIONS: /home/runner/work/model_benchmark_zoo/model_benchmark_zoo/cross_sections.xml
run: |
source "${HOME}/conda/etc/profile.d/conda.sh"
source "${HOME}/conda/etc/profile.d/mamba.sh"
mamba activate
pytest tests/test_cad_to_openmc/test_csg_cad_nestedcylinder.py
29 changes: 29 additions & 0 deletions .github/workflows/nested_sphere_cad_to_openmc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: nested sphere - cad to openmc

on:
pull_request:
branches:
- develop
- main
push:
- main

jobs:
testing:
runs-on: ubuntu-latest
steps:

- name: checkout actions
uses: actions/checkout@v4

- name: use upstream test composite action
uses: ./.github/actions/dependencies

- shell: bash
env:
OPENMC_CROSS_SECTIONS: /home/runner/work/model_benchmark_zoo/model_benchmark_zoo/cross_sections.xml
run: |
source "${HOME}/conda/etc/profile.d/conda.sh"
source "${HOME}/conda/etc/profile.d/mamba.sh"
mamba activate
pytest tests/test_cad_to_openmc/test_csg_cad_nestedsphere.py
29 changes: 29 additions & 0 deletions .github/workflows/sphere_cad_to_openmc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: sphere - cad to openmc

on:
pull_request:
branches:
- develop
- main
push:
- main

jobs:
testing:
runs-on: ubuntu-latest
steps:

- name: checkout actions
uses: actions/checkout@v4

- name: use upstream test composite action
uses: ./.github/actions/dependencies

- shell: bash
env:
OPENMC_CROSS_SECTIONS: /home/runner/work/model_benchmark_zoo/model_benchmark_zoo/cross_sections.xml
run: |
source "${HOME}/conda/etc/profile.d/conda.sh"
source "${HOME}/conda/etc/profile.d/mamba.sh"
mamba activate
pytest tests/test_cad_to_openmc/test_csg_cad_sphere.py
22 changes: 22 additions & 0 deletions src/model_benchmark_zoo/circulartorus.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,25 @@ def dagmc_model(self, filename="circulartorus.h5m", min_mesh_size=0.1, max_mesh_

model = openmc.Model(geometry=geometry, materials=materials)
return model

def dagmc_model_with_cad_to_openmc(self, filename="circulartorus.h5m"):
from CAD_to_OpenMC import assembly
import openmc

self.export_stp_file()

a=assembly.Assembly(["circulartorus.step"])
a.verbose=1
assembly.mesher_config['threads']=1
a.run(
backend='stl2',
merge=True,
h5m_filename=filename,
sequential_tags=[self.materials[0].name],
scale=1.0
)

universe = openmc.DAGMCUniverse(filename, auto_geom_ids=True).bounded_universe()
geometry = openmc.Geometry(universe)
model = openmc.Model(geometry=geometry)
return model
22 changes: 22 additions & 0 deletions src/model_benchmark_zoo/cuboid.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,25 @@ def dagmc_model(self, filename="Cuboid.h5m", min_mesh_size=0.1, max_mesh_size=10
materials = openmc.Materials([self.materials[0]])
model = openmc.Model(geometry=geometry, materials=materials)
return model

def dagmc_model_with_cad_to_openmc(self, filename="Cuboid.h5m"):
from CAD_to_OpenMC import assembly
import openmc

self.export_stp_file()

a=assembly.Assembly(["Cuboid.step"])
a.verbose=0
assembly.mesher_config['threads']=1
a.run(
backend='stl2',
merge=True,
h5m_filename=filename,
sequential_tags=[self.materials[0].name],
scale=1.0
)

universe = openmc.DAGMCUniverse(filename, auto_geom_ids=True).bounded_universe()
geometry = openmc.Geometry(universe)
model = openmc.Model(geometry=geometry)
return model
22 changes: 22 additions & 0 deletions src/model_benchmark_zoo/cylinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,25 @@ def dagmc_model(self, filename="sphere.h5m", min_mesh_size=0.1, max_mesh_size=10
geometry = openmc.Geometry(universe)
model = openmc.Model(geometry=geometry, materials=materials)
return model

def dagmc_model_with_cad_to_openmc(self, filename="cylinder.h5m"):
from CAD_to_OpenMC import assembly
import openmc

self.export_stp_file()

a=assembly.Assembly(["cylinder.step"])
a.verbose=0
assembly.mesher_config['threads']=1
a.run(
backend='stl2',
merge=True,
h5m_filename=filename,
sequential_tags=[self.materials[0].name],
scale=1.0
)

universe = openmc.DAGMCUniverse(filename, auto_geom_ids=True).bounded_universe()
geometry = openmc.Geometry(universe)
model = openmc.Model(geometry=geometry)
return model
22 changes: 22 additions & 0 deletions src/model_benchmark_zoo/ellipticaltorus.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,25 @@ def dagmc_model(self, filename="ellipticaltorus.h5m", min_mesh_size=0.1, max_mes

model = openmc.Model(geometry=geometry, materials=materials)
return model

def dagmc_model_with_cad_to_openmc(self, filename="ellipticaltorus.h5m"):
from CAD_to_OpenMC import assembly
import openmc

self.export_stp_file()

a=assembly.Assembly(["ellipticaltorus.step"])
a.verbose=2
assembly.mesher_config['threads']=1
a.run(
backend='stl2',
merge=True,
h5m_filename=filename,
sequential_tags=[self.materials[0].name],
scale=1.0
)

universe = openmc.DAGMCUniverse(filename, auto_geom_ids=True).bounded_universe()
geometry = openmc.Geometry(universe)
model = openmc.Model(geometry=geometry)
return model
22 changes: 22 additions & 0 deletions src/model_benchmark_zoo/nestedcylinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,25 @@ def dagmc_model(self, filename="nestedshpere.h5m", min_mesh_size=0.1, max_mesh_s
materials = openmc.Materials([self.materials[0], self.materials[1]])
model = openmc.Model(geometry=geometry, materials=materials)
return model

def dagmc_model_with_cad_to_openmc(self, filename="nestedcylinder.h5m"):
from CAD_to_OpenMC import assembly
import openmc

self.export_stp_file("nestedcylinder.step")

a=assembly.Assembly(["nestedcylinder.step"])
a.verbose=2
assembly.mesher_config['threads']=1
a.run(
backend='stl2',
merge=True,
h5m_filename=filename,
sequential_tags=[self.materials[0].name, self.materials[1].name],
scale=1.0
)

universe = openmc.DAGMCUniverse(filename, auto_geom_ids=True).bounded_universe()
geometry = openmc.Geometry(universe)
model = openmc.Model(geometry=geometry)
return model
22 changes: 22 additions & 0 deletions src/model_benchmark_zoo/nestedsphere.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,25 @@ def dagmc_model(self, filename="nestedshpere.h5m", min_mesh_size=0.1, max_mesh_s
geometry = openmc.Geometry(universe)
model = openmc.Model(geometry=geometry, materials=materials)
return model

def dagmc_model_with_cad_to_openmc(self, filename="nestedsphere.h5m"):
from CAD_to_OpenMC import assembly
import openmc

self.export_stp_file()

a=assembly.Assembly(["sphere.step"])
a.verbose=2
assembly.mesher_config['threads']=1
a.run(
backend='stl2',
merge=True,
h5m_filename=filename,
sequential_tags=[self.materials[0].name, self.materials[1].name],
scale=1.0
)

universe = openmc.DAGMCUniverse(filename, auto_geom_ids=True).bounded_universe()
geometry = openmc.Geometry(universe)
model = openmc.Model(geometry=geometry)
return model
22 changes: 22 additions & 0 deletions src/model_benchmark_zoo/sphere.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,25 @@ def dagmc_model(self, filename="sphere.h5m", min_mesh_size=0.1, max_mesh_size=10
geometry = openmc.Geometry(universe)
model = openmc.Model(geometry=geometry, materials=materials)
return model

def dagmc_model_with_cad_to_openmc(self, filename="sphere.h5m"):
from CAD_to_OpenMC import assembly
import openmc

self.export_stp_file()

a=assembly.Assembly(["sphere.step"])
a.verbose=0
assembly.mesher_config['threads']=1
a.run(
backend='stl2',
merge=True,
h5m_filename=filename,
sequential_tags=[self.materials[0].name],
scale=1.0
)

universe = openmc.DAGMCUniverse(filename, auto_geom_ids=True).bounded_universe()
geometry = openmc.Geometry(universe)
model = openmc.Model(geometry=geometry)
return model
Loading

0 comments on commit 740dbe1

Please sign in to comment.