csg2csg icon indicating copy to clipboard operation
csg2csg copied to clipboard

Serpent does not allow UNION for cell surfaces

Open gvozdila opened this issue 4 years ago • 1 comments

I can cite Serpent-1.1.7 user manual obtained from OECD, p.28 :

  1. Only the intersection operator is available for cell definitions. This means that a point is inside the cell if and only if it is inside (or outside if defined by a negative surface number) all the boundary surfaces in the list.

May be it would be possible to build some decomposition from UNIONs to INTERSECTIONs. First time even warning printing could be helpful.

gvozdila avatar May 18 '20 17:05 gvozdila

Ok. I have some something about it. CSG is not a "real" boolean algebra over macro-bodies, only over basis macro-bodies. So we cannot use algebra directly. For example: A AND B = not ( not A OR not B) -- one can use #cell_id in MCNP, but there is no way like this in Serpent or KENO-VI (SCALE)

But we can use some other simple rules like this : a1) is equal a2) i will use MCNP notation here a1) 1 1 1.0 10: 20 u=0 imp:n=1

a2)101 1 1.0 -10 20 u=0 imp:n=1 102 1 1.0 10 -20 u=0 imp:n=1 103 1 1.0 -10 -20 u=0 imp:n=1

b) not (A and B) == (not A) or (not B) c) not (A or B) == (not A) and (not B)

For me it seems like we need some basic "expand" procedure in class InputDeck. And we are not really need to destroy original cell_list. Should we use self.create_cell_list_without_union() to build no_union_cell_list[] ?

gvozdila avatar Oct 20 '20 11:10 gvozdila