Description
Hi,
I was running some fields with the OPGEE's model. I found it to crash on some fields with steam flooding. I have attached the following file to replicate the error. The error is the following.
_Traceback (most recent call last):
File "c:\users\martin\documents\internship_grenoble\opgeev4\opgee\tool.py", line 339, in main
_main(argv)
File "c:\users\martin\documents\internship_grenoble\opgeev4\opgee\tool.py", line 309, in _main
tool.run(args=args)
File "c:\users\martin\documents\internship_grenoble\opgeev4\opgee\tool.py", line 239, in run
obj.run(args, self)
File "c:\users\martin\documents\internship_grenoble\opgeev4\opgee\built_ins\run_plugin.py", line 375, in run
for results in mgr.run_packets(
File "c:\users\martin\documents\internship_grenoble\opgeev4\opgee\manager.py", line 322, in run_packets
results = pkt.run(result_type)
File "c:\users\martin\documents\internship_grenoble\opgeev4\opgee\manager.py", line 134, in run
results = run_serial(self.model_xml_file, self.analysis_name, field_names,
File "c:\users\martin\documents\internship_grenoble\opgeev4\opgee\manager.py", line 386, in run_serial
result = _run_field(analysis_name, field_name, xml_string, result_type)
File "c:\users\martin\documents\internship_grenoble\opgeev4\opgee\manager.py", line 370, in _run_field
field.run(analysis)
File "c:\users\martin\documents\internship_grenoble\opgeev4\opgee\field.py", line 533, in run
self.run_processes(analysis)
File "c:\users\martin\documents\internship_grenoble\opgeev4\opgee\field.py", line 1528, in run_processes
proc.run_if_enabled(analysis)
File "c:\users\martin\documents\internship_grenoble\opgeev4\opgee\process.py", line 791, in run_if_enabled
self.run(analysis)
File "c:\users\martin\documents\internship_grenoble\opgeev4\opgee\processes\steam_generation.py", line 142, in run
self.steam_generator.once_through_SG(prod_water_mass_rate * fraction_OTSG,
File "c:\users\martin\documents\internship_grenoble\opgeev4\opgee\processes\steam_generator.py", line 152, in once_through_SG
temp = exhaust_consump_sum * exhaust_consump_MW / gas_MW_combust / available_enthalpy
File "C:\Users\martin\AppData\Local\miniconda3\envs\opgee\lib\site-packages\pint\facets\plain\quantity.py", line 1383, in truediv
return self._mul_div(other, operator.truediv)
File "C:\Users\martin\AppData\Local\miniconda3\envs\opgee\lib\site-packages\pint\facets\plain\quantity.py", line 108, in wrapped
return f(self, *args, **kwargs)
File "C:\Users\martin\AppData\Local\miniconda3\envs\opgee\lib\site-packages\pint\facets\plain\quantity.py", line 88, in wrapped
result = f(self, *args, **kwargs)
File "C:\Users\martin\AppData\Local\miniconda3\envs\opgee\lib\site-packages\pint\facets\plain\quantity.py", line 1323, in _mul_div
magnitude = magnitude_op(self._magnitude, other_magnitude)
FloatingPointError: divide by zero encountered in scalar divide
_
test_opgee_error.txt
Just change the name of the field to .xml extension to run it easily.
By deepening a bit in this issue, I found that this is due to the fact that the input_enthalpy_per_unit_fuel is negative in most of the fields.
Then the computation of the available_enthalpy equals to zero and the computation of the temp crashes the model because there is a division by the available _enthalpy.
OPGEEv4/opgee/processes/steam_generator.py
Lines 135 to 150 in fff85c8
What should we do to avoid the problem ? Can you send a few documentation on the process if you want me to correct the error ?