mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 21:55:41 -04:00
optimize the switch of white boundary
This commit is contained in:
parent
46367e8369
commit
dd9bff40a1
1 changed files with 5 additions and 9 deletions
|
|
@ -458,15 +458,11 @@ Particle::cross_surface()
|
|||
score_surface_tally(this, model::active_meshsurf_tallies);
|
||||
this->r() = r;
|
||||
}
|
||||
|
||||
Direction u;
|
||||
if(surf->bc_ == BC_REFLECT) {
|
||||
// Reflect particle off surface
|
||||
u = surf->reflect(this->r(), this->u());
|
||||
} else if(surf->bc_ == BC_WHITE) {
|
||||
// Diffuse reflect particle off surface
|
||||
u = surf->diffuse_reflect(this->r(), this->u());
|
||||
}
|
||||
|
||||
Direction u = (surf->bc_ == BC_REFLECT) ?
|
||||
surf->reflect(this->r(), this->u()) :
|
||||
surf->diffuse_reflect(this->r(), this->u());
|
||||
|
||||
// Make sure new particle direction is normalized
|
||||
this->u() = u / u.norm();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue