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

New lines strike again with append_nuclide #666

Open
MicahGale opened this issue Feb 19, 2025 · 0 comments
Open

New lines strike again with append_nuclide #666

MicahGale opened this issue Feb 19, 2025 · 0 comments
Assignees
Labels
alpha testing Issues that came up during alpha testing bugs A deviation from expected behavior that does not reach the level of being reportable as an "Error".
Milestone

Comments

@MicahGale
Copy link
Collaborator

Describe the bug

In certain circumstances when you add a new nuclide to an existing material, and then write it out to file again invalid syntax is created.

To Reproduce

This uses the demo model from MontePy.

problem = montepy.read_input("demo/pin_cell.imcnp")
uranium = problem.materials[1]
if "O-16" not in uranium:
    for comp_idx in range(len(uranium)):
        uranium.values[comp_idx] *= 1/3
    uranium.add_nuclide("O-16.80c", 2/3)
problem.write_to_file("new_pin_cell.imcnp")

MCNP Original input file snippet

If applicable, please include a small section of the input file you were working on. If it includes any specific values please change or remove them. For example:

Made up PWR pin Cell Problem
c uranium rod 
1    1  10.0   -1     101 -102 imp:n=1
c gas gap
2    0           1  -2 101 -102 imp:n=1
c cladding
3    10 5.0     2  -3 101 -102 imp:n=1
c water cell
5    2  1.0    2     101 -102
                       103 -104
                       105 -106 imp:n=1

1 CZ 0.39
2 CZ 0.40
3 CZ 0.46
101 PZ -0.63
102 PZ  0.63
103 PX -0.63
104 PX  0.63
105 PY -0.63
106 PY  0.63

M1    92235.80c 0.04 
      92238.80c 0.96
M2     1001.80c 0.66
       8016.80c 0.33
M10   40090.80c 0.515
      40091.80c 0.112
      40092.80c 0.171
      40094.80c 0.174
      40096.80c 0.028
mode n
nps 1e3 

Outputs:

c .... 
M1    92235.80c 0.01
      92238.80c 0.328016.80c   0.6666666666666666
c ...

Version

  • Version 1.0.0a1
@MicahGale MicahGale added alpha testing Issues that came up during alpha testing bugs A deviation from expected behavior that does not reach the level of being reportable as an "Error". labels Feb 19, 2025
@MicahGale MicahGale added this to the release-1.0.0 milestone Feb 19, 2025
MicahGale added a commit that referenced this issue Feb 21, 2025
@MicahGale MicahGale self-assigned this Feb 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alpha testing Issues that came up during alpha testing bugs A deviation from expected behavior that does not reach the level of being reportable as an "Error".
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant