VacuumCost crashing out with data conversion error

Hi all

I’m having trouble running VacuumCost to simulate beam conditioning behaviour at fixed timesteps. I’m not sure if it is a problem with my Molflow model or the version of Molflow GUI (2.9.28), MolflowCli (2.9.28) or VacuumCost (Dec 10th 2024 version from the GitHub repository).

VacuumCost always crashes out at this line in store_abs_des(…) in worker.py:

N_abs_before_scaling[i,j] = int(data.find(‘MolflowResults/Moments/Moment/FacetResults’)[i].find(‘Hits’).attrib[‘nbAbsEquiv’])

with i=0, j=0, which_to_store=1

The error is:

invalid literal for int() with base 10: ‘4.8469250335578151e-08’

In the Molflow xml file we have the following fragment:

So it looks like it is finding the correct number but it’s just not a integer.

Does anyone have any ideas how to fix this?

Thanks

Matthew

My fragment of xml disappeared when I posted. Here’s a screen grab instead:

This is a bug in vacuumcoost, the line should be correctly

N_abs_before_scaling[i,j] = int(float(data.find(‘MolflowResults/Moments/Moment/FacetResults’)[i].find(‘Hits’).attrib[‘nbAbsEquiv’]))

as we are converting a float, which can be scientific notation. We can have a look.

That said, the nbAvsEquiv should be integer, except when low flux mode is on. Can you check that it is disabled in your base simulation?

It’s in the mid-right of Global Settings:

Hi Marton

Thanks for this.

Low flux mode is indeed “on” in my model. I didn’t realise it was important to turn it off for VacuumCost. I will turn it off and try again. The int function in Python is very unforgiving in case of non-integer input. It takes several hours running on my PC before the error appears, as my model is quite big.

I guess it is not a priority to look at, but VacuumCost does run very slowly for large models due in part to all the lxml find functions. I already tweaked some code sections to reduce the number of find functions which does make it run a bit faster.

Once again thanks for making all the code available and for being so responsive. I’ll keep the forum updated.

Matthew

Jus one other point. I do tend to use low flux mode in Molflow quite a lot to get better statistics. Can VacuumCost handle low flux mode at all?

I have pushed a fix to the bug you reported, thank you - it will now correctly parse low flux simulations. If you checked out the repo with Git, just pull the latest master branch. Vacuumcost was written by Peter who left CERN two years ago, and we currently don’t have resources to look at the code (apart from bug fixes) - our goal is to integrate it into Molflow. Sorry for the slow lxml find functions.

Out of curiosity, in what scenarios does low flux mode give better statistics? At CERN we couldn’t see any benefits, and thought of even removing the feature. Because of the cosine reflection, we thought it’s not the sticking factor but the low “forward propagating” probability that limits statistics at sticking areas.

I haven’t done a proper quantitative comparison of low flux mode and normal mode. However …
In my experience, low flux mode can make a big difference in Synrad where you have a few strongly irradiated areas and it takes a lot of reflections to get the radiation to the weakly irradiated areas. Low flux mode means the flux in the weakly illuminated areas converges to a stable value much more quickly.
In Molflow but I suspect something similar happens when you have a few small strongly outgassing areas and a relatively high sticking probability, e.g. NEG coating. In low flux mode you probably get quicker convergence of the pressure in the lower outgassing regions.
I always leave low flux mode enabled in both Synrad and Molflow..

So for me, low flux mode seems important in Synrad but I’m not so sure about Molflow due to their different reflection / propagation geometries at surfaces. It would be good to keep the options open if possible.

1 Like

Thanks for the quick bug fixed version. Did you just add the float() function as you proposed earlier or did you change anything else? Effectively you are throwing away the non-integer part of the value by forcing it to an int. Does that matter?

I added float to gas mass and nbAbs, used round() instead of int(), you can see all changes here.

We agree that in Synrad low flux is efficient due to the specular reflection. For Molflow maybe it still helps.