Skip to content

Commit

Permalink
Add integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
theo-brown committed Dec 4, 2024
1 parent 0d242e4 commit 283730c
Showing 8 changed files with 31 additions and 27 deletions.
27 changes: 0 additions & 27 deletions torax/examples/prad.py

This file was deleted.

1 change: 1 addition & 0 deletions torax/state.py
Original file line number Diff line number Diff line change
@@ -310,6 +310,7 @@ class PostProcessedOutputs:
P_ohmic: Ohmic heating power to electrons [W]
P_brems: Bremsstrahlung electron heat sink [W]
P_ecrh: Total electron cyclotron source power [W]
P_imp: Impurity radiation heat sink [W]
I_ecrh: Total electron cyclotron source current [A]
I_generic: Total generic source current [A]
Q_fusion: Fusion power gain
7 changes: 7 additions & 0 deletions torax/tests/sim.py
Original file line number Diff line number Diff line change
@@ -374,6 +374,13 @@ class SimTest(sim_test_case.SimTestCase):
_ALL_PROFILES,
0,
),
# Predictor-corrector solver with simple impurity radiation
(
'test_iterhybrid_predictor_corrector_impurity_radiation',
'test_iterhybrid_predictor_corrector_impurity_radiation.py',
_ALL_PROFILES,
0,
),
# Tests Newton-Raphson nonlinear solver for ITER-hybrid-like-config
(
'test_iterhybrid_newton',
Binary file modified torax/tests/test_data/test_changing_config_after.nc
Binary file not shown.
Binary file modified torax/tests/test_data/test_changing_config_before.nc
Binary file not shown.
Binary file modified torax/tests/test_data/test_implicit.nc
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2024 DeepMind Technologies Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Identical to test_iterhybrid_predictor_corrector but simple impurity radiation."""

import copy

from torax.tests.test_data import test_iterhybrid_predictor_corrector

CONFIG = copy.deepcopy(test_iterhybrid_predictor_corrector.CONFIG)

CONFIG['sources']['impurity_radiation_heat_sink'] = {}

0 comments on commit 283730c

Please sign in to comment.