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

Linear Source Random Ray #3072

Merged
merged 65 commits into from
Jul 17, 2024
Merged
Changes from 1 commit
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
9effa47
added inheriting LinearSourceDomain class
jtramm Jun 24, 2024
f9692a7
finished linear source dummy implementation and class hierarchy
jtramm Jun 24, 2024
d554c18
added in linear sources, need to fix flux swap in RR simulation
RufusN Jun 25, 2024
cc90512
added method for flux swap
RufusN Jun 25, 2024
50a9cb9
removed prints/include
RufusN Jun 25, 2024
a09fa97
added external source to source, for fixed source calculations
RufusN Jun 25, 2024
74d913d
added LS method section
RufusN Jun 25, 2024
9eb3906
updates to method, edits to bias section and start of usersguide LS…
RufusN Jun 25, 2024
ead9a4a
added to usersguide
RufusN Jun 25, 2024
ab0e899
further edits
RufusN Jun 26, 2024
82cc0a7
moved 2x2 lattice to examples.
jtramm Jun 26, 2024
4860316
simplified vacuum test
jtramm Jun 26, 2024
904e420
changed fixed source test to cube, and added cube to examples
jtramm Jun 26, 2024
5591972
changed random ray test names
jtramm Jun 26, 2024
b35b7ec
cleanup of cube example
jtramm Jun 26, 2024
23a8102
reduced comment block width
jtramm Jun 26, 2024
28bf71b
formatted examples.py with autopep8
jtramm Jun 26, 2024
6348358
removed vacuum tests
jtramm Jun 26, 2024
1931213
working on moment matrix object
jtramm Jun 27, 2024
f190a0a
made symmetric matrix class to handle moments operations
jtramm Jun 27, 2024
fdb82b2
using scale
jtramm Jun 28, 2024
41a00a8
partial progress
jtramm Jun 28, 2024
7743154
partial progress on refactor
jtramm Jun 29, 2024
cdd20fa
finished refactor to Position
jtramm Jun 29, 2024
cf1e272
fixed bug with flat vs linear scatter source update
jtramm Jun 29, 2024
96b678e
fixed bug with flat vs linear scatter source update
jtramm Jun 29, 2024
0344853
progress on refactor
jtramm Jun 29, 2024
dbb460d
progress on refactor
jtramm Jun 30, 2024
2da90ac
refactoring mostly done
jtramm Jun 30, 2024
56d9da8
fixed bug with always zero centroid
jtramm Jun 30, 2024
07ad808
going to add 2D option to LS
jtramm Jul 1, 2024
566462d
testing with centroid corrected estimators, not useful
jtramm Jul 1, 2024
4c2c1ba
brought tests up to date with develop
jtramm Jul 1, 2024
72066e3
enabled volume normalized tallies on new example problems for testing
jtramm Jul 1, 2024
31b9b67
enabled tally normalization by default in fixed source domain example…
jtramm Jul 1, 2024
efc8f67
added test specifically on volume normalization
jtramm Jul 1, 2024
bf696fa
refactored Position to MomentArray
jtramm Jul 1, 2024
87f31d2
refactor to MomentMatrix from SymmetricMatrix
jtramm Jul 1, 2024
0fd8997
removed matrix linear solve, as the inverse works well enough
jtramm Jul 2, 2024
16af861
added comment
jtramm Jul 2, 2024
82a8243
updated doc string of new model
jtramm Jul 2, 2024
4bd5332
merged with main and trrm_examples
jtramm Jul 2, 2024
45f5071
added tests for linear source
jtramm Jul 2, 2024
ab17665
edits on docs
jtramm Jul 2, 2024
35cb4b2
edits on docs
jtramm Jul 2, 2024
11dba82
adding more to docs
jtramm Jul 2, 2024
551e386
removed nan inits
jtramm Jul 2, 2024
11acd0a
ran clang format
jtramm Jul 4, 2024
92de902
merged with develop
jtramm Jul 4, 2024
ebf7971
ran llvm 15 format
jtramm Jul 4, 2024
f19a0a3
test MPI fix
RufusN Jul 6, 2024
b3c1c71
fix for MPI domain replication for LS
jtramm Jul 9, 2024
72f94d0
update mom_matrix and centroids even if missed
jtramm Jul 9, 2024
61bce36
ensure no nans if missed
jtramm Jul 9, 2024
bd4999e
Fixed wrong array reset
jtramm Jul 9, 2024
6ed9089
updated strings, and added MPI control to printouts
jtramm Jul 9, 2024
1e40537
renamed variables, added comments
RufusN Jul 9, 2024
d86984b
Introduced distance_2 for repeated distance squared calculations
RufusN Jul 9, 2024
0970263
ran clang format
RufusN Jul 9, 2024
e86a9c3
Merge branch 'develop' into ls_edits
jtramm Jul 12, 2024
b46dd16
adjusted formatting of python test files to match develop
jtramm Jul 12, 2024
c613d2b
formatting of docs
jtramm Jul 12, 2024
91fae90
fix period in docs, and added OpenMOC license for G1 and G2 functions
jtramm Jul 12, 2024
49815e2
review fix items from @jtramm review
jtramm Jul 12, 2024
06f2eef
Typo and style fixes
paulromano Jul 16, 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 method for flux swap
RufusN committed Jun 25, 2024

Verified

This commit was signed with the committer’s verified signature.
snyk-bot Snyk bot
commit cc905125255329effec93d3cd86ea36f8db98499
1 change: 1 addition & 0 deletions include/openmc/random_ray/flat_source_domain.h
Original file line number Diff line number Diff line change
@@ -109,6 +109,7 @@ class FlatSourceDomain {
void all_reduce_replicated_source_regions();
void convert_external_sources();
void count_external_source_regions();
virtual void flux_swap();

//----------------------------------------------------------------------------
// Public Data members
1 change: 1 addition & 0 deletions include/openmc/random_ray/linear_source_domain.h
Original file line number Diff line number Diff line change
@@ -37,6 +37,7 @@ class LinearSourceDomain : public FlatSourceDomain {
void all_reduce_replicated_source_regions(); //override
void convert_external_sources();
void count_external_source_regions();
void flux_swap() override;

//----------------------------------------------------------------------------
// Public Data members
1 change: 0 additions & 1 deletion include/openmc/random_ray/random_ray_simulation.h
Original file line number Diff line number Diff line change
@@ -33,7 +33,6 @@ class RandomRaySimulation {
private:
// Contains all flat source region data
unique_ptr<FlatSourceDomain> domain_;
//unique_ptr<LinearSourceDomain> domain_ls_;

// Random ray eigenvalue
double k_eff_ {1.0};
4 changes: 4 additions & 0 deletions src/random_ray/flat_source_domain.cpp
Original file line number Diff line number Diff line change
@@ -928,5 +928,9 @@ void FlatSourceDomain::convert_external_sources()
}
}
}
void FlatSourceDomain::flux_swap()
{
scalar_flux_old_.swap(scalar_flux_new_);
}

} // namespace openmc
9 changes: 9 additions & 0 deletions src/random_ray/linear_source_domain.cpp
Original file line number Diff line number Diff line change
@@ -301,4 +301,13 @@ int64_t LinearSourceDomain::add_source_to_scalar_flux()
// ...
// }

void LinearSourceDomain::flux_swap()
{
FlatSourceDomain::flux_swap();
flux_x_old_.swap(flux_x_new_);
flux_y_old_.swap(flux_y_new_);
flux_z_old_.swap(flux_z_new_);
}


} // namespace openmc
7 changes: 1 addition & 6 deletions src/random_ray/random_ray_simulation.cpp
Original file line number Diff line number Diff line change
@@ -329,12 +329,7 @@ void RandomRaySimulation::simulate()
}

// Set phi_old = phi_new

//LinearSourceDomain* domain = static_cast<LinearSourceDomain*>(domain_);
domain_->scalar_flux_old_.swap(domain_->scalar_flux_new_);
domain_->flux_x_old_.swap(domain_->flux_x_new_);
domain_->flux_y_old_.swap(domain_->flux_y_new_);
domain_->flux_z_old_.swap(domain_->flux_z_new_);
domain_->flux_swap();

// Check for any obvious insabilities/nans/infs
instability_check(n_hits, k_eff_, avg_miss_rate_);