From da849c894445447bfcd3620193bc10e8b0ad5306 Mon Sep 17 00:00:00 2001 From: Jonathan Shimwell Date: Fri, 8 Mar 2024 14:19:08 +0000 Subject: [PATCH] commented out plotly part of examples --- .github/workflows/ci.yml | 3 +++ examples/point_source_example.py | 25 ++++++++++++++++--------- examples/ring_source_example.py | 14 +++++++++++++- examples/tokamak_source_example.py | 21 +++++++++++++++++---- 4 files changed, 49 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a475db9..89b2bec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,3 +31,6 @@ jobs: python examples/point_source_example.py python examples/ring_source_example.py python examples/tokamak_source_example.py + python examples/plot_tokamak_ion_temperature.py + python examples/plot_tokamak_neutron_source_density.py + python examples/plot_tokamak_neutron_source_strengths.py diff --git a/examples/point_source_example.py b/examples/point_source_example.py index d37d404..f9c83b5 100644 --- a/examples/point_source_example.py +++ b/examples/point_source_example.py @@ -2,8 +2,6 @@ import numpy as np import openmc -from openmc_source_plotter import plot_source_energy - from openmc_plasma_source import fusion_point_source # just making use of a local cross section xml file, replace with your own cross sections or comment out @@ -28,11 +26,20 @@ settings.particles = 1000 settings.source = my_source +model = openmc.model.Model(materials=None, geometry=geometry, settings=settings) -plot = plot_source_energy( - this=settings, - n_samples=100000, - energy_bins=np.linspace(0, 16e6, 1000), - yaxis_type="log", -) -plot.show() +model.run() + + +# optionally if you would like to plot the energy of particles then another package can be used +# https://github.com/fusion-energy/openmc_source_plotter + +# from openmc_source_plotter import plot_source_energy + +# plot = plot_source_energy( +# this=settings, +# n_samples=1000000, # increase this value for a smoother plot +# energy_bins=np.linspace(0, 16e6, 1000), +# yaxis_type="log", +# ) +# plot.show() diff --git a/examples/ring_source_example.py b/examples/ring_source_example.py index 18efd13..2c959dc 100644 --- a/examples/ring_source_example.py +++ b/examples/ring_source_example.py @@ -2,7 +2,6 @@ from pathlib import Path import openmc - from openmc_plasma_source import fusion_ring_source # just making use of a local cross section xml file, replace with your own cross sections or comment out @@ -31,3 +30,16 @@ model = openmc.model.Model(materials=None, geometry=geometry, settings=settings) model.run() + + +# optionally if you would like to plot the location of particles then another package can be used +# https://github.com/fusion-energy/openmc_source_plotter + +# from openmc_source_plotter import plot_source_position + +# plot = plot_source_position( +# this=settings, +# n_samples = 2000, +# ) + +# plot.show() diff --git a/examples/tokamak_source_example.py b/examples/tokamak_source_example.py index d8c9666..8f35a29 100644 --- a/examples/tokamak_source_example.py +++ b/examples/tokamak_source_example.py @@ -9,7 +9,7 @@ # minimal geometry -sphere_surface = openmc.Sphere(r=1000.0, boundary_type="vacuum") +sphere_surface = openmc.Sphere(r=100000.0, boundary_type="vacuum") cell = openmc.Cell(region=-sphere_surface) geometry = openmc.Geometry([cell]) @@ -24,9 +24,9 @@ ion_temperature_peaking_factor=8.06, ion_temperature_pedestal=6.09, ion_temperature_separatrix=0.1, - major_radius=9.06, - minor_radius=2.92258, - pedestal_radius=0.8 * 2.92258, + major_radius=906, + minor_radius=292.258, + pedestal_radius=0.8 * 292.258, mode="H", shafranov_factor=0.44789, triangularity=0.270, @@ -45,3 +45,16 @@ model = openmc.model.Model(materials=None, geometry=geometry, settings=settings) model.run() + + +# optionally if you would like to plot the direction of particles then another package can be used +# https://github.com/fusion-energy/openmc_source_plotter + +# from openmc_source_plotter import plot_source_direction + +# plot = plot_source_direction( +# this=settings, +# n_samples=200 +# ) + +# plot.show()