Closed tjlaboss closed 3 months ago
MWE of Material not added: Source
C cells
c # hidden vertical Do not touch
c
1 1 20
-1000 $ dollar comment
imp:n,p=1 U=350 trcl=5
c Cell filled with the material to copy
2 4444 -4.44
-1005
imp:n=1
imp:p=0.5
c
3 3 -1
1000 1005 -1010
imp:n,p=1
99 0
1010
imp:n,p=0
5 0
#99
imp:n,p=3 fill=350 (1 0 0 )
c foo end comment
C surfaces
1000 SO 1
1005 RCC 0 1.5 -0.5 0 0 1 0.25
1010 SO 3
C data
C materials
C UO2 5 atpt enriched
m1 92235.80c 5 &
92238.80c 95
C Iron
m2 26054.80c 5.85
26056.80c 91.75
26057.80c 2.12
26058.80c 0.28
C water
C foo
m3 1001.80c 2
8016.80c 1
MT3 lwtr.23t h-zr.20t h/zr.28t
C
C Material to Copy
C ================
m4444 92238.01c 8 92235.01c 5
MWE of Material not added
C cells
c # hidden vertical Do not touch
c
1 1 20
-1000 $ dollar comment
imp:n,p=1 U=350 trcl=5
c Cell to fill with the new material
2 2 8
-1005
imp:n=1
imp:p=0.5
3 3 -1
1000 1005 -1010
imp:n,p=1
99 0
1010
imp:n,p=0
5 0
#99
imp:n,p=3 fill=350 (1 0 0 )
c foo end comment
C surfaces
1000 SO 1
1005 RCC 0 1.5 -0.5 0 0 1 0.25
1010 SO 3
C data
C materials
C UO2 5 atpt enriched
m1 92235.80c 5 &
92238.80c 95
C Iron
m2 26054.80c 5.85
26056.80c 91.75
26057.80c 2.12
26058.80c 0.28
C water
C foo
m3 1001.80c 2
8016.80c 1
MT3 lwtr.23t h-zr.20t h/zr.28t
C execution
ksrc 0 0 0
kcode 100000 1.000 50 1050
phys:p j 1 2j 1
mode n p
vol NO 2J 1 1.5 J
MWE of Material not added
C cells
c # hidden vertical Do not touch
c
1 1 20
-1000 $ dollar comment
imp:n,p=1 U=350 trcl=5
c Cell to fill with the new material
2 4444 -4.44
-1005
imp:n=1
imp:p=0.5
3 3 -1
1000 1005 -1010
imp:n,p=1
99 0
1010
imp:n,p=0
5 0
#99
imp:n,p=3 fill=350 (1 0 0 )
c foo end comment
C surfaces
1000 SO 1
1005 RCC 0 1.5 -0.5 0 0 1 0.25
1010 SO 3
C data
C materials
C UO2 5 atpt enriched
m1 92235.80c 5 &
92238.80c 95
C Iron
m2 26054.80c 5.85
26056.80c 91.75
26057.80c 2.12
26058.80c 0.28
C water
C foo
m3 1001.80c 2
8016.80c 1
MT3 lwtr.23t h-zr.20t h/zr.28t
C execution
ksrc 0 0 0
kcode 100000 1.000 50 1050
phys:p j 1 2j 1
mode n p
vol NO 2J 1 1.5 J
Material needs to be added to problem.data_inputs
as well. There is an open issue about this as well that I can't look up right now.
Issue #93
The related problem I've found is that updating the Material.material_components
does not update the material written out. I will test if editing data_inputs
solves that as well.
The card in materials
and in data_inputs
is the same instance:
>>> id(deck2.data_inputs[1])
139756433280640
>>> id(deck2.materials[2])
139756433280640
>>> deck2.data_inputs[1] is deck2.materials[2]
True
Editing the material_components
of Material 2 in one location obviously updates them in the other, but somehow the original composition is still written out.
Workaround: bring in a separate Material
object and renumber it:
deck1.materials[4444].link_to_problem(deck2)
deck2.materials.append(deck1.materials[4444])
deck2.materials.remove(deck2.materials[2])
deck2.data_inputs[1] = deck1.materials[4444]
deck2.data_inputs[1].number = 2
deck2.write_to_file("deck4.i", overwrite=True)
C data
C materials
C UO2 5 atpt enriched
m1 92235.80c 5 &
92238.80c 95
C
C Material to Copy
C ================
m2 92238.01c 8 92235.01c 5
C water
C foo
m3 1001.80c 2
8016.80c 1
MT3 lwtr.23t h-zr.20t h/zr.28t
C execution
ksrc 0 0 0
kcode 100000 1.000 50 1050
phys:p j 1 2j 1
mode n p
vol NO 2J 1 1.5 J
Ok so yes this would be solved by #93.
I'm entirely following the second part. Could you open a new issue about that?
New issue: #470
Resolved by the combination of #488 and #482.
Describe the bug
When materials are added to or modified within an input file, the material cards are not updated. Old materials are still written, and new materials are not written. However, the cell is updated correctly.
To Reproduce
A short code snippet of what you have ran. Please change or remove any specific values or anything that can't be public. For example:
Output
MCNP input file snippet
See comment below.
Version
Additional context
Add any other context about the problem here.