mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 05:35:49 -04:00
Add test for multithreaded CMFD
This commit is contained in:
parent
362e4d16b4
commit
62c50ea302
2 changed files with 27 additions and 9 deletions
|
|
@ -350,20 +350,14 @@ extern "C"
|
|||
int openmc_run_linsolver(const double* A_data, const double* b, double* x,
|
||||
double tol)
|
||||
{
|
||||
int result;
|
||||
|
||||
switch (cmfd::ng) {
|
||||
case 1:
|
||||
result = cmfd_linsolver_1g(A_data, b, x, tol);
|
||||
break;
|
||||
return cmfd_linsolver_1g(A_data, b, x, tol);
|
||||
case 2:
|
||||
result = cmfd_linsolver_2g(A_data, b, x, tol);
|
||||
break;
|
||||
return cmfd_linsolver_2g(A_data, b, x, tol);
|
||||
default:
|
||||
result = cmfd_linsolver_ng(A_data, b, x, tol);
|
||||
break;
|
||||
return cmfd_linsolver_ng(A_data, b, x, tol);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void free_memory_cmfd()
|
||||
|
|
|
|||
|
|
@ -140,3 +140,27 @@ def test_cmfd_feed():
|
|||
# Initialize and run CMFD test harness
|
||||
harness = CMFDTestHarness('statepoint.20.h5', cmfd_run)
|
||||
harness.main()
|
||||
|
||||
def test_cmfd_multithread():
|
||||
"""Test 1 group CMFD solver with CMFD feedback"""
|
||||
# Initialize and set CMFD mesh
|
||||
cmfd_mesh = cmfd.CMFDMesh()
|
||||
cmfd_mesh.lower_left = (-10.0, -1.0, -1.0)
|
||||
cmfd_mesh.upper_right = (10.0, 1.0, 1.0)
|
||||
cmfd_mesh.dimension = (10, 1, 1)
|
||||
cmfd_mesh.albedo = (0.0, 0.0, 1.0, 1.0, 1.0, 1.0)
|
||||
|
||||
# Initialize and run CMFDRun object
|
||||
cmfd_run = cmfd.CMFDRun()
|
||||
cmfd_run.mesh = cmfd_mesh
|
||||
cmfd_run.tally_begin = 5
|
||||
cmfd_run.solver_begin = 5
|
||||
cmfd_run.display = {'dominance': True}
|
||||
cmfd_run.feedback = True
|
||||
cmfd_run.gauss_seidel_tolerance = [1.e-15, 1.e-20]
|
||||
cmfd_run.use_all_threads = True
|
||||
cmfd_run.run()
|
||||
|
||||
# Initialize and run CMFD test harness
|
||||
harness = CMFDTestHarness('statepoint.20.h5', cmfd_run)
|
||||
harness.main()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue