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

Issues with the run_simulation.py script #10

Open
ThibautVanHoof opened this issue May 4, 2021 · 2 comments
Open

Issues with the run_simulation.py script #10

ThibautVanHoof opened this issue May 4, 2021 · 2 comments

Comments

@ThibautVanHoof
Copy link
Collaborator

Different errors are obtained depending on the executing directory:

from the pylbm_ui/Outputs directory, try the command: python ../../scripts/run_simulation.py ../simu_0/simu_config.json
leads to the following error:
Traceback (most recent call last):
File "../../scripts/run_simulation.py", line 10, in
from pylbm_ui.simulation import simulation
ModuleNotFoundError: No module named 'pylbm_ui'

from the pylbm_ui/scripts directory, try the command: python run_simulation.py ../Outputs/simu_0/simu_config.json
leads to the following error:
Traceback (most recent call last):
File "run_simulation.py", line 10, in
from pylbm_ui.simulation import simulation
File "../pylbm_ui/simulation.py", line 21, in
from .widgets.pylbmwidget import out
File "../pylbm_ui/widgets/init.py", line 11, in
from .simulation import SimulationWidget
File "../pylbm_ui/widgets/simulation.py", line 18, in
from ..simulation import simulation, Plot
ImportError: cannot import name 'simulation' from partially initialized module 'pylbm_ui.simulation' (most likely due to a circular import) (../pylbm_ui/simulation.py)

@ThibautVanHoof ThibautVanHoof changed the title Module import issues with the run_simulation.py script Issues with the run_simulation.py script Jun 11, 2021
@ThibautVanHoof
Copy link
Collaborator Author

The main goal of the run_simulatio.py script is to allow the user to run a single simulation based on a simu_config.json file in command line (without the pylbm_ui graphical interface). That functionality add flexibility to the proposed toolset, especially for advanced users used to run simulation on super-computers or to develop advanced shell scripts or chain of codes.

In the framework of the LBMHYPE ESA project, the main target of the run_simulatio.py script is to allows for the coupling of pylbm_ui with the Minamo software to access the advanced data analysis functionalities of the Cenaero software. The coupling method provided by Minamo as depicted in the theory manual is:

image

Basically, as the PS functionality provided in pylbm_ui, Minamo will create a list of sample point (DoE) with different values of the design space parameters. To evaluate the responses for all the points, Minamo will interact in command line with a simulation script, in the present case: run_simulatio.py which need to have the following functionalities:

  • read the Input file(s) provided by Minamo which basically contains the parameter values for the point to be evaluated
  • run the LBM simulation with the pescribed parameters values and compute the expected responses
  • write the Output file(s) containing the computed responses values that can be read by Minamo for subsequent database filling and analysis.

As an example, in the LBMHYPE prototype, the following command line is used for Minamo evaluation:
python PATH_TO_run_simulatio.py PATH_TO_refSim_config.json -param Parameters.txt -dir .

  • PATH_TO_run_simulatio.py is the absolute path to the run_simulatio.py script
  • PATH_TO_refSim_config.json is the absolute path toward a reference input simulation file containing the full definition of a reference point. It also include the responses requests (list of responses to be computed as expected by Minamo). In practice, the command line "python PATH_TO_run_simulatio.py PATH_TO_refSim_config.json" allows to perform the pyLBM simulation for the reference point and write the responses in the Output file(s)
  • Parameters.txt is the file generated by minamo that contain the values of the design parameters for the current point to be evaluated (different from the reference). If "-param Parameters.txt" is provided in the command line, run_simulatio.py will first initialize the simulation parameters with these provided in PATH_TO_refSim_config.json and then overwrite the values of parameters provided in the Parameters.txt file prior to run the LBM simulation and write requested Output file(s)

I hope this is explain the expected functionalities of run_simulatio.py in a clear manner....

@ThibautVanHoof
Copy link
Collaborator Author

ThibautVanHoof commented Jun 14, 2021

status of version 54bee2b

the new script "scripts/run_parametric.py" seems to fulfill most of the requirements for the Minamo coupling, excepted:

  • loading of extra parameters from another file (not the simu_config.json)
  • computation of the LBM stability is missing

I will initiate the implementation of the Minamo coupling from that script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant