Hello everyone
I have a problem :
I am executing an Ansys coupling model with persalys, and one of the points to simulate is not computable, Ansys stops with an error and persalys add a line of “nan” (not “Nan”) in cache outputs CSV file
and persalys stops also and quit automatically
After when i try to execute again the DOE, persalys can not execute DOE, except if I erase the last line with “nan” in cache files
but in this case persalys will launch this computation point again, whereas I know it will fail
And my computations are very long so I need to keep the same DOE, i just want to go to next computation
Hi Flore,
If I’m not wrong, the cache files are usefull since they “save in memory” the simulations “done in the past”.
So if you have to play again a simulation, Persalys will check the cache files, detect that the simulation have been played and will read the result in the cache files (instead of execute the FEM simulation). This backup allow to reduce the number of simulations especially if the computation times are importants.
In your case (I have not tested LHS DOE - sorry if i’m wrong), the DOE simulations are “scheduled in advance” so when Persalys execute the DOE model, Persalys detect this case have been already done, so Persalys read the simulation result in the cache files.
When the last simulation is executed and read, Persalys is not able to read the results. An error occurs. If you delete the last line, Persalys detect the case has not been “played”, so the simulation is done, with error.
I would suggest you, in order to know if the error come from Persalys or from your FEM software (Ansys in your case), to execute the FEM simulation with the DOE parameters that lead to the error. This FEM simluation should not be execute with Persalys but in a independent FEM study (write the parameters value directly in your FEM pre-processing tool - Workbench ? I don’t use this FEM software).
By this way, in one simulation, you will see if the same error occurs. In this case, this error come from your FEM model or from the FEM solver or your DOE Parameters (inertia, Young modulus too low for exemple) .
If not, the errors come from the Persalys, not necessary from Perslays code himself but check the FEM result, the format number of your results, the way you read this result…
I don’t use the ansys coupling tool so I can’t give you any idea. But with the indepedent simulation, it may you give you an idea of what’s wrong.
Hope it may help you (and I have not written wrongs informations ).
Thanks Laurent!
in my case I know that it is an error from my FEM computation (a case of no convergence I guess)
so I just want to forget this specific simulation and go on next simulations
but it seems that Persalys tries to re-run the computation that I know it will fail
in this case persalys stops abnormally; in cache file for outputs, a last line appears with only "nan"s
and in this case if I try to lauch again the DOE, Persalys quits without any messages (persalys main window disappears)
so I remove this last line in ‘outputs’ cache file, and also the corresponding last line in ‘inputs’ cache file, in order to continue my computations
But in this case persalys launches first the “bad” simulation (“snake biting its tail” ?)
Hi!
Thank you for sharing your experiments with us: this allows to see how the software performs in real situations.
I guess that there are two bugs at this point:
Ansys fails,
Persalys fails to see that Ansys failed, and fails.
The fact that Persalys runs over and over the same simulations is an expected behavior, because it is governed by the seed of the random number generator. This is constant and equal to zero by default:
We sure have to fix that Persalys bugs when the physical model returns a Nan or Inf. In the meantime, you could perhaps trick Persalys in some way that the code does not return a Nan or Inf. There might be other workaround, but I see at least two different ways:
Use a different seed. You might be able to find a seed which is so that there is no failure in your model. This depends on the probability of failure of … the Ansys model ;
import numpy as np
def smooth_my_failures(output_variable_name):
if np.isnan(output_variable_name):
fixed_output = 0.0 # Arbitrary value
else:
fixed_output = output_variable_name
return fixed_output
This might fix your issue, by replacing Nan values with zeros and might let Persalys do its job. These zero values will define a failure of the model, that might be post-processed afterwards.
Indeed, I guess I understand.
Thanks Mickael too… I have never used LHS DOE but it’s more than a “simple deterministic DOE”… I often use for analytical response surface calculation. In LHS DOE, we could understand that inital seed may be important if probabilistic study is done.
From my mechanical point of view, I would be afraid that another FEM simulations would not converge. If your DOE will explore the same area (not exactly the same point but a similar point), your FEM model may give the same result. If this area is important for you, It can be a problem.
So I would try to understand why this model doesn’t work : contact, extreme strain, buckling, … If this a mechanical behavior problem, like Mickael said, it may be representative of a system failure, and a correction of your output can be a solution (corrected value have to be adjusted to be relevant with your study).
But if it’s not, this output correction may remove important informations for your study.
I know how to add python command in persalys, I already use this feature, but I did not think about this to fix the case where I have “no results”
Actually my FEM computations fail sometimes, often because of a loss of connection with license server, or sometimes because geometry regeneration fails (it’s sometimes difficult to build a geometry model in which we can modify dimensions as we want)
Last time it was another problem: I had to re-execute my computation 2 or 3 times before I got a solution, I don’t know why, I dit not change any parameters, any convergence options etc
So in this case I run manually my computation and after I added corresponding inputs and results in cache files. After I was able to continue to execute my DOE with persalys.
my model is an electromagnetic problem, for magnetic part (simulation of magnets) we use an Ansys solver, for electronic part (simulation of electrons displacement in a system called “electron gun” composed by anode / cathode) we use our own solver, integrated in Ansys with an ACT
So it’s not the same physics than structural or fluid mechanics
So “don’t be afraid”