Commit a2fcf152 authored by Steffen Schotthöfer's avatar Steffen Schotthöfer
Browse files

repaired bug in MN solver. trimmed some test cases


Former-commit-id: 3ad7dc10
parent c8fc6e92
......@@ -95,7 +95,7 @@ std::vector<VectorVector> Checkerboard_PN::GetExternalSource( const Vector& /*en
VectorVector Q( _mesh->GetNumCells(), Vector( 1u, 0.0 ) );
auto cellMids = _mesh->GetCellMidPoints();
for( unsigned j = 0; j < cellMids.size(); ++j ) {
if( isSource( cellMids[j] ) ) Q[j] = 10.0 / std::sqrt( 4 * M_PI ); // isotropic source
if( isSource( cellMids[j] ) ) Q[j] = 1.0 / std::sqrt( 4 * M_PI ); // isotropic source
}
return std::vector<VectorVector>( 1u, Q );
}
......
......@@ -189,10 +189,12 @@ void MNSolver::FVMUpdate( unsigned idx_energy ) {
// Dirichlet Boundaries stay
if( _boundaryCells[idx_cell] == BOUNDARY_TYPE::DIRICHLET ) continue;
// Flux update
for( unsigned idx_sys = 0; idx_sys < _nTotalEntries; idx_sys++ ) {
_solNew[idx_cell][idx_sys] = _sol[idx_cell][idx_sys] - ( _dE / _areas[idx_cell] ) * _solNew[idx_cell][idx_sys]; /* cell averaged flux */
-_dE* _sol[idx_cell][idx_sys] * ( _sigmaT[idx_energy][idx_cell] /* absorbtion influence */
+ _sigmaS[idx_energy][idx_cell] * _scatterMatDiag[idx_sys] ); /* scattering influence */
for( unsigned idx_system = 0; idx_system < _nTotalEntries; idx_system++ ) {
_solNew[idx_cell][idx_system] = _sol[idx_cell][idx_system] -
( _dE / _areas[idx_cell] ) * _solNew[idx_cell][idx_system] /* cell averaged flux */
- _dE * _sol[idx_cell][idx_system] *
( _sigmaT[idx_energy][idx_cell] /* absorbtion influence */
+ _sigmaS[idx_energy][idx_cell] * _scatterMatDiag[idx_system] ); /* scattering influence */
}
// Source Term
_solNew[idx_cell][0] += _dE * _Q[0][idx_cell][0];
......
......@@ -150,10 +150,6 @@ void PNSolver::FluxUpdate() {
}
}
}
// std::cout << norm( _solNew[idx_cell] ) << "\n";
// if( norm( _solNew[idx_cell] ) > 0.001 ) {
// std::cout << _solNew[idx_cell] << "\n";
//}
}
}
......
......@@ -18,6 +18,7 @@ CT_FILE = phantom.png
PROBLEM = PHANTOM2D
HYDROGEN_FILE = ENDL_H.txt
OXYGEN_FILE = ENDL_O.txt
MAX_ENERGY_CSD = 0.01
%
% ---- Solver specifications ----
%
......
......@@ -18,6 +18,7 @@ CT_FILE = phantom.png
PROBLEM = PHANTOM2D
HYDROGEN_FILE = ENDL_H.txt
OXYGEN_FILE = ENDL_O.txt
MAX_ENERGY_CSD = 0.01
%
% ---- Solver specifications ----
%
......@@ -35,7 +36,7 @@ QUAD_ORDER = 6
% ----- Output ----
%
VOLUME_OUTPUT = (MINIMAL, MEDICAL)
VOLUME_OUTPUT_FREQUENCY = 1
VOLUME_OUTPUT_FREQUENCY = 0
SCREEN_OUTPUT = (ITER, MASS, RMS_FLUX, VTK_OUTPUT, CSV_OUTPUT)
SCREEN_OUTPUT_FREQUENCY = 0
HISTORY_OUTPUT = (ITER, MASS, RMS_FLUX, VTK_OUTPUT, CSV_OUTPUT)
......
......@@ -18,6 +18,7 @@ PROBLEM = WATERPHANTOM
HYDROGEN_FILE = ENDL_H.txt
OXYGEN_FILE = ENDL_O.txt
STOPPING_POWER_FILE = stopping_power.txt
MAX_ENERGY_CSD = 5.0
%
% ---- Solver specifications ----
%
......
......@@ -189,7 +189,6 @@ TEST_CASE( "MN_SOLVER", "[validation_tests]" ) {
}
}
}
/*
TEST_CASE( "CSD_SN_FP_SOLVER", "[validation_tests]" ) {
std::string csd_sn_fileDir = "input/validation_tests/CSD_SN_FP_solver/";
......@@ -261,7 +260,6 @@ TEST_CASE( "CSD_SN_FP_SH_2D_SOLVER", "[validation_tests]" ) {
}
}
*/
// --- Validation Tests Output ---
void tokenize( std::string const& str, const char delim, std::vector<std::string>& out ) {
size_t start;
......@@ -360,7 +358,6 @@ TEST_CASE( "screen_output", "[output]" ) {
REQUIRE( eqLen ); // Files must be of same length
}
/*
TEST_CASE( "Test the Data Generator", "[dataGen]" ) {
std::string out_fileDir = "input/validation_tests/dataGenerator/";
spdlog::drop_all(); // Make sure to write in own logging file
......@@ -421,4 +418,3 @@ TEST_CASE( "Test the Data Generator", "[dataGen]" ) {
}
REQUIRE( testPassed );
}
*/
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment