Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Composition verification for external sources #443

Merged
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
0074f9c
Add a test for the composition of the gas with external forcing
dmontgomeryNREL Nov 14, 2024
08edad4
Update README.md
dmontgomeryNREL Nov 14, 2024
6d52dc5
Merge branch 'AMReX-Combustion:development' into composition-test
dmontgomeryNREL Nov 27, 2024
eb2d108
add input file for composition test and analysis scripts
dmontgomeryNREL Nov 27, 2024
d62fdd3
update test to require fewer time steps, pass old_time into external …
dmontgomeryNREL Nov 27, 2024
837804a
Added add_test_rt to CMakeLists
dmontgomeryNREL Nov 28, 2024
b2ca739
formatting
dmontgomeryNREL Nov 28, 2024
344b4c7
ensure temporal data is numeric for ubuntu test
dmontgomeryNREL Dec 2, 2024
1033f76
debug error in ubuntu EB-ON test
dmontgomeryNREL Dec 2, 2024
997d674
debug-2
dmontgomeryNREL Dec 2, 2024
058c370
debug-3: MPI?
dmontgomeryNREL Dec 2, 2024
8f4291e
debug-4 wasn't MPI...
dmontgomeryNREL Dec 2, 2024
a53b029
debug 5: ctest with one proc.
dmontgomeryNREL Dec 3, 2024
c7a863a
debug 6: set PELE_NP 1 in CMakeLists
dmontgomeryNREL Dec 3, 2024
c7170e8
debug 7: set PELE_ENABLE_MPI OFF
dmontgomeryNREL Dec 3, 2024
a3d989d
debug 8: remove MPI commands from add_test_rt
dmontgomeryNREL Dec 3, 2024
18fd75e
Cleanup after debugging
dmontgomeryNREL Dec 3, 2024
5f1cc4f
Merge branch 'development' into composition-test
dmontgomeryNREL Dec 3, 2024
f685611
Try ubuntu-latest with MPI_COMMANDS
dmontgomeryNREL Dec 10, 2024
a8d3595
use ubuntu 22.04
dmontgomeryNREL Dec 12, 2024
d0cf66a
Merge branch 'development' into composition-test
dmontgomeryNREL Dec 13, 2024
76a330a
Merge branch 'development' into composition-test
dmontgomeryNREL Dec 16, 2024
d86f5ae
Remove amrex::unused
dmontgomeryNREL Dec 17, 2024
672cf65
Merge branch 'development' into composition-test
dmontgomeryNREL Dec 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added add_test_rt to CMakeLists
  • Loading branch information
dmontgomeryNREL committed Nov 28, 2024
commit 837804afe84b8f441d05d8c39841266992b230c0
11 changes: 7 additions & 4 deletions Exec/RegTests/EB_ODEQty/test.py
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
import unittest

class CompTestCase(unittest.TestCase):
"""Tests composition of species with external sources"""
"""Test composition of species with external sources"""

def test_composition(self):
"""Are the number of moles, mass fractions, and density correct?"""
@@ -14,11 +14,11 @@ def test_composition(self):
molar_masses = {"AR": 0.040, "N2": 0.028, "CO2": 0.044}

# Load the data
file_dir = os.path.dirname(os.path.abspath(__file__))
file_dir = os.path.abspath(".")
file_name = os.path.join(file_dir, "temporals/tempExtremas")
col_names = ["time", "max_density", "max_rho.Y(AR)", "max_rho.Y(N2)", "max_rho.Y(CO2)"]
var_names = ["AR", "N2", "CO2"]
data = pd.read_csv(file_name, usecols=col_names)
data = pd.read_csv(file_name, usecols=col_names, delimiter=',')
time = data["time"]

# Parse input file for necessary solution parameters
@@ -36,6 +36,10 @@ def test_composition(self):
data_rhoY = data.iloc[:, 2:].copy()
data_rhoY.columns = var_names

# Ensure numeric types for all data columns
data_rho = pd.to_numeric(data_rho, errors="coerce")
data_rhoY = data_rhoY.apply(pd.to_numeric, errors="coerce")

# Initial values
AR_0, N2_0, CO2_0 = data_rhoY.iloc[0].to_dict().values()
rho_0 = data_rho.iloc[0]
@@ -89,6 +93,5 @@ def test_composition(self):
err_msg="Maximum density error exceeds specified tolerance."
)


if __name__ == "__main__":
unittest.main()
11 changes: 11 additions & 0 deletions Tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -110,6 +110,14 @@ function(add_test_rev TEST_NAME TEST_EXE_DIR)
set_tests_properties(${TEST_NAME} PROPERTIES LABELS "regression;verification;no-ci")
endfunction(add_test_rev)

# Regression test with case-specific verification test.py
function(add_test_rt TEST_NAME TEST_EXE_DIR)
setup_test()
set(RUNTIME_OPTIONS "amr.max_step=10 peleLM.do_temporals=1 peleLM.do_extremas=1 peleLM.temporal_int=1 ${RUNTIME_OPTIONS}")
add_test(${TEST_NAME} sh -c "${MPI_COMMANDS} ${CURRENT_TEST_EXE} ${MPIEXEC_POSTFLAGS} ${CURRENT_TEST_BINARY_DIR}/${TEST_NAME}.inp ${RUNTIME_OPTIONS} > ${TEST_NAME}.log ${SAVE_GOLDS_COMMAND} ${FCOMPARE_COMMAND} && nosetests ${CURRENT_TEST_BINARY_DIR}/test.py")
set_tests_properties(${TEST_NAME} PROPERTIES TIMEOUT 18000 PROCESSORS ${PELE_NP} WORKING_DIRECTORY "${CURRENT_TEST_BINARY_DIR}/" LABELS "regression;verification" ATTACHED_FILES_ON_FAIL "${CURRENT_TEST_BINARY_DIR}/${TEST_NAME}.log")
endfunction(add_test_rt)

# Regression tests excluded from CI
function(add_test_re TEST_NAME TEST_EXE_DIR)
add_test_r(${TEST_NAME} ${TEST_EXE_DIR})
@@ -234,5 +242,8 @@ if(NOT PELE_ENABLE_EB)
add_test_r(hit-les-${PELE_DIM}d HITDecay)
endif()
else()
if(PELE_DIM EQUAL 2)
add_test_rt(composition-test-${PELE_DIM}d EB_ODEQty)
endif()
add_test_r(eb-odeqty-${PELE_DIM}d EB_ODEQty)
endif()