Giter VIP home page Giter VIP logo

cylinder2dflowcontroldrl's Introduction

NOTE: in a follow-up work, we have parallelized the DRL part of the training. The code and container are also made available. If you want to use our code as a starting point for your own work, we strongly recommend to consider starting with the parallel code, rather than the code in this repository. The parallel code is simply more modern, and overall better. It is available at: https://github.com/jerabaul29/Cylinder2DFlowControlDRLParallel .

NOTE: cloning this repository may take quite a bit of time, because the full singularity container is committed through git-lfs in the container folder. The upside is that this makes all the code here "fully reproducible forever", the downside is that cloning takes time: be patient :) .

Cylinder2DFlowControlWithRL

This repository performs Flow Control of the 2D Kármán Vortex Street with Deep Reinforcement Learning. The simulations are done with FEniCS, while the Reinforcement Learning is performed with the help of the library TensorForce. You will need Fenics, Tensorflow, Tensorforce and Gmsh available on your system in order to be able to run the code, and all in the right versions (see later down to get our container).

A question? Open an issue. An improvement? Make a push request.

Basically, this repository allows you to produce results like the following, where top is baseline, bottom is controlled flow:

Update: training in parallel

We are working on parallelization of the DRL algorithm through the use of several environments. See our preprint here:

https://arxiv.org/pdf/1906.10382.pdf

and the repository with the parallel learning code here:

https://github.com/jerabaul29/Cylinder2DFlowControlDRLParallel

Update: coupling with spectral CFD code released by another research group

The DRL control can be coupled with a variety of CFD codes, and this was recently released by Li and Zhang, Reinforcement-learning-based control of confined cylinder wakes with stability analyses, in the case of Nek5000. Their code is available at: https://github.com/npuljc/RL_control_Nek5000 . That may also be a good further materials :) .

What is in the repo ?

The code is in the Cylinder2DFlowControlWithRL subfolder. Inside it, you will find :

  • Python scripts, that are unchanged from one simulation to another, and are also unchanged from one learning to another.

    • Env2DCylinder.py. This is the environment seen by the RL agent. It is the main class of the repo.
    • flow_solver.py
    • generate_msh.py
    • jet_bcs.py
    • msh_convert.py
    • probes.py
  • Simulation folders, that contain information relative to the learning process. For each set of parameter you would like to test, you will have to create one folder. You can change a lot of parameters by modifying the environment itself or the learning session. 4 python scripts and up to 4 folders are in each of these Simulation folders :

    • env.py is the script setting the environment parameters. Here you can modify, for example, the position of the probes, reward function used, etc.
    • make_mesh.py allows you to remake the mesh if the geometry changed, and to re-compute a base state.
    • perform_learning.py is the script for performing learning.
    • single_runner.py allows you to test a model by evaluating a model using no randomness. You will also eventually see some subfolders :
    • mesh, if mesh has been successfully created.
    • results, containing some flow data in vtu files (so, look at these with for example paraview).
    • saved_models, if you either launched a training session or tested some control on a single episode.
    • best_model, if you launched a training session.

In addition, there is a folder about LearningMaterial that should be useful for people with no background in DRL / PPO. Following the links and looking at the videos should be enough to get you started in the field.

Articles

This code corresponds to the articles:

If you use our code in your research, please consider citing our papers:

Rabault, J., Kuchta, M., Jensen, A., Reglade, U., Cerardi, N., 2018. Artificial Neural Networks trained through Deep Reinforcement Learning discover control strategies for active flow control. arXiv preprint arXiv:1808.07664.

Rabault, J., Reglade, U., Cerardi, N., Kuchta, M. and Jensen, A., 2018. Deep Reinforcement Learning achieves flow control of the 2D Karman Vortex Street. arXiv preprint arXiv:1808.10754.

Rabault, J., Kuchta, M., Jensen, A., Réglade, U., & Cerardi, N. (2019). Artificial neural networks trained through deep reinforcement learning discover control strategies for active flow control. Journal of Fluid Mechanics, 865, 281-302. doi:10.1017/jfm.2019.62

In addition, some slides of a lecture about this work are available on my website:

Note that, in the first article (and the JFM article), we adopt a renormalization where the diameter of the cylinder is 1. In both the second article and the code, the renormalization is a bit different and follows what is done in the Turek benchmark. This simply means that lengths and times are scaled a factor 10 between the simulations / second article and the first one

Video of the lecture at AFMS

I was recently invited to give a guest lecture about DRL for flow control at AFMS; the recording is available at: https://youtu.be/irNheFmWZTo .

AFMS guest lecture: DRL for flow control

You can find the corresponding slides at: https://github.com/jerabaul29/2023_slides_DeepReinforcementLearning_ActiveFlowControl_AFMS/blob/main/slides_2023_03_01_RABAULT_DRL_active_flow_control.pdf .

First steps

I present two methods here: install everything by hand in the right versions, or use a singularity container for virtualization and reproducibility. The singularity container is the recommended solution, that has been tested at many institutions and reproducibility has been confirmed and validated. Several users who tried to install things by hand contacted me because they had problem to reproduce the software stack: this is not the recommended solution and I will not help with debugging problems you encounter in this case.

Installing by hand (discouraged)

Before launching any script, check that you have installed (tested on Ubuntu 16.04) :

  • Tensorflow (tested with tensorflow 1.8.0)
  • TensorForce (tested with tensorforce 0.4.2, commit from the tensorforce repo: 5f770fd)
  • Gmsh (versions 3.+ but not 4.+, tested with 3.0.6; you can use the gmsh binary for linux 64 bits provided alongside this readme)
  • Fenics (2017.1.0 or 2017.2.0)

For this, you can either install these modules on your computer yourself (respecting the version / commit, otherwise some things may break), or use the singularity image we provide (recommended). Some of the steps below assume that you are working on a Linux machine, but you can adapt to a windows / Mac.

Using through our container (recommended)

If you want to use our singularity container (recommended, credits to Terje Kvernes, UiO / IT of the Department of Mathematics for setting up this infrastructure):

  • Download and install singularity (see for example the tutorial here http://www.sdsc.edu/support/user_guides/tutorials/singularity.html , or the singularity documentation).
  • Download our singularity container parts from the repo, available in the container folder of hte present repo: https://github.com/jerabaul29/Cylinder2DFlowControlDRL/tree/master/container . The previous solution that relied on the folk.uio.no personal websites has been end-of-lifed and discontinued.
  • The container was committed using git-lfs in several segments, to make sure that the size limit is not over-run. To put the segments from the container folder together. A note here: while git-lfs should allow to download sucessfully all segments upon cloning the repository, it seems that there is a problem, either with github serving the git-lfs files, or with git checking out the large files. So to get all the fragments, you may have to use the github web GUI, i.e. to 1) go to the right folder (https://github.com/jerabaul29/Cylinder2DFlowControlDRL/tree/master/container) 2) for each fragment there, to click on the filename and use the download button to start downloading directly from your browser. Once this is done, you can assemble by:
> cat fenics-and-more.img_part.?? > fenics-and-more.img
> sha256sum fenics-and-more.img
e6e3c6b24d4edb93022d1156aba1a458367242d0ba1f249508bd2669f87ee4b8  fenics-and-more.img

Remember to check the checksum to make sure that the image was correctly assembled.

  • Download from their website ( http://gmsh.info/ ) and unpack Gmsh, in the right version.
  • Now you should be able to load your singularity container inside which you can work in command line as a normal UNIX and run our scripts (of course, you will nedd to adapt the SET_YOUR_PATH stuff to your local paths; note that the gmsh path can only be DOWNSTREAM of the root path for your home if you use the -H option):
singularity shell SET_YOUR_PATH/fenics-and-more.img -c "export DISPLAY=:0.0 && export PATH="SET_YOUR_PATH/gmsh-git-Linux64/bin:$PATH" && /bin/bash"

Note that if you want to execute on an external media, you can type a command as following, but you will also need a copy of gmsh on the corresponding media (as the -H acts as a mounting point, so your usual home will not be available anymore):

singularity shell -H SET_YOUR_BASE_PATH SET_YOUR_PATH/fenics-and-more.img -c "export DISPLAY=:0.0 && export PATH="SET_YOUR_BASE_PATH/gmsh-git-Linux64/bin:$PATH" && /bin/bash"

This singularity image contains tensorflow, tensorforce, fenics, and a Python install with the packages you need to run our scripts. If you want to mesh, you have to make sure that the path export to your gmsh is valid (the path export works only from folders visible to singularity, i.e. under the SET_YOUR_BASE_PATH in the tree). If you have problems with the gmsh calls, you may also hard code the paths to gmsh in the calls lines 35 and 52 in Cylinder2DFlowControlWithRL/generate_msh.py, putting the path to the gmsh in your cloned repo. If you do this, remember to make gmsh executable first (chmod +x gmsh).

Launching one episode without training

Without controlling the flow

Go in Cylinder2DFlowControlWithRL/baseline_flow. Just launch single_runner.py to look at the baseline flow. During the computation, the graphical interface shows the state of the flow, and the data is saved in baseline_flow/results for the vtu files, and in baseline_flow/saved_models for the csv files.

With a control

Go in Cylinder2DFlowControlWithRL/ANN_controlled_flow_singlerun. This folder contains a copy of one of our best model. The velocity field shown in our article stems from this model. You can run this model by launching single_runner.py.

Launching a training session

Go in Cylinder2DFlowControlWithRL/ANN_controlled_flow_learning. You will see that this folder contains less elements than ANN_controlled_flow_singlerun. Indeed, we made a copy and deleted the results from the learning session. You can try to launch a session, it will have the same parameters as ANN_controlled_flow_singlerun, and you can compare the model you obtain with ours.

To start a learning, launch perform_learning.py. This will create three directories: results, saved_models, and best_model.

results contains the .vtu outputs for the pressure, velocity, and the recirculation area for the last epoch.

saved_models contains the last stat of the ANN, as well as output.csv, the history of the training, debug.csv, the history of the console debug. Please note that if the training is interrupted, it will automatically restart from it's last save.

Finally, best_model contains the save of the best neural network encountered during the training phase.

Making a new mesh

In some situation, you will have to recreate the mesh. If you change the geometry of the simulation, for instance if you change the jets positions, you will have to do so.

For this, go in empty_simulation and run make_mesh.py. This script will create a directory mesh that contains all the needed files to start the training. This includes the mesh, as well as the converged pressure and velocity fields. If the directory already exists, it will be automatically overwritten.

By default, the graphical debug is launched, but to run this script on a distant computer, it's preferable to turn it off. Just go ahead and edit make_mesh.py:

import env
env.resume_env(plot=False, remesh=True) #plot to 500 if a graphical debug needed

Once this is finished, you have a new folder containing the mesh and converged pressure and velocity fields, and you are ready to perform more learning.

To go further

Making a new simulation of your own

We are going to see how to configure and launch a simple simulation where the jets form an angle of 5 degree with the vertical. First, we highly recommend you to run the simulations in a copy of the GitHub directory, in order to not pollute the Git with simulation results. Make a copy of the repo, and within this new folder an empty_simulation within Cylinder2DFlowControlWithRL. Rename it with an appropriate name. Here, we will call it angle5.

Now, we are going to edit env.py. This file contains all the parameters relative to the simulation. In our case we will simply set jet_angle to 5 degrees:

jet_angle = 5

Here is a non exhaustive list of all the parameters that can be changed and their effect:

  • nb_actuations: The number of controls performed during an epoch.
  • simulation_duration: The duration in seconds of the simulation (an epoch).
  • dt: The time step in second of the simulation
    • Note that this parameter might need to be adjust to respect CFL condition.
    • The number of actuations must not exceed the duration of the simulation divided by dt.
  • jet_angle: angle of the jets, can be positive or negative.
  • 'coarse_size': The refinement of the mesh far from the cylinder.
  • 'cylinder_size': The refinement of the mesh far cloth to the cylinder.
  • reward_function: The type of reward function to train the NN, can be:
    • 'plain_drag'
    • 'drag'
    • 'drag_plain_lift'
    • 'recirculation_area'

Creation of the mesh

Now, just run make_mesh.py. This script will create a directory mesh that will contains all the needed files to start the training. This includes the mesh, as well as the converged pressure and velocity fields. If the directory already exists, it will be automatically overwritten.

By default, the graphical debug is launched, but to run this script on a distant computer, it's preferable to turn it off. Just go ahead and edit make_mesh.py:

import env
env.resume_env(plot=False, remesh=True) #plot to 500 if a graphical debug needed

You have a number of parameters you can adjust regarding the mesh. These are summarized in the geometry_params dictionary of the env.py file of each simulation. You can control the shape of the cylinder and simulation box, the position and number of the jets, the mesh refinement, etc. You can also set up different input velocity profiles through the profile function of the same file.

Starting the training

To launch the training, just run perform_learning.py. This will create three directories: results, saved_models, and best_model. The first one contains the .vtu outputs for the pressure, velocity, and the recirculation area for the last epoch.

saved_models contains the last stat of the NN, as well as output.csv, the history of the training, debug.csv, the history of the console debug. Please note that if the training is interrupted, it will automatically restart from it's last save.

Finally, best_model contains the save of the best neural network encountered during the training phase.

Notes

Confusing choices in the code

  • The code is for some bad legacy reasons written in a 'dimensional' form. All results in the JFM paper are by contrast non dimensional. This can be confusing. For a detailed discussion of the non-dimensionalization process, see the discussion on this issue: #3 . Note that if you want to change the Reynolds number, you may need to adapt the renormalization coefficients: #6 .

Errata and problems in code

  • There is a small erratum in one of the dumping routine, that is not fixed because of backwards compatibility of some of our plotting routines. Namely, files of the kind debug.csv have columns in a different order than indicated by the header; the real order is [Name;Episode;Step;RecircArea;Drag;lift]).

  • There is a memory leak in the specific matplotlib version included in the container... This means that, if you let your code run with plotting, the RAM of your computer will saturate after a while. To avoid this, only use matplotlib showing when you want to visually inspect training. When you want to perform 'heavy' training, disable plotting by setting the plot named argument to False in your perform_learning.py

Typo in the paper

  • In the JFM paper

    • Eqn. defining Q_ref (just after Eqn. 2.6, in the text): rho should not be needed in non-dimensional form. Anyways, rho is 1, so this makes not difference.

    • Eqn. B3: there is a typo, this should be /R, not /R^2. This is purely a typo and is of course correctly implemented in the code (i.e., the code is correct).

cylinder2dflowcontroldrl's People

Contributors

jerabaul29 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cylinder2dflowcontroldrl's Issues

About Q<0.06

hello:
I found that you set up |Q|<0.06,to prevent non-physically large actuation.And I can not find where the programm to achieve this function.
It would be nice if you can tell me where I can find The Q in programm

Lift fluctuations resulting from DRL training using the OpenFOAM platform

Hi, Mr.Jean,
At present, I want to conduct simple DRL training on The OpenFoam platform with the cylinder flow case. But in trying for a long time did not achieve the ideal control effect in your paper. And lift changes dramatically every time the action changes.
I have used the control method about speed change in your paper, but this phenomenon still occurs. May I ask how to solve it?
My training parameters are:

network_spec = [ dict(type='dense', size=512), dict(type='dense', size=512) ]

agent = dict( agent='ppo', batch_size=20, network=network_spec, learning_rate=0.001, state_preprocessing=None, entropy_regularization=0.01, likelihood_ratio_clipping=0.2, subsampling_fraction=0.2, saver=dict(directory='saved_models/checkpoint', frequency=1), summarizer=dict(directory='summary') )

deltaT=0.0005 2000epoch 80 steps every epoch The suction range is (-2,2) agent_interaction_period=0.025s Vortex shedding period=0.34s Parallel environments

The lifting drag curve is compared to the baseline as shown below:
image

动作曲线如图:

image

How to define Neumann boundary condition

Hello:
I want to know how to define Neumann boundary condition with fenics such as (du/dy=0),are there any examples to refer to,a more easier example?(I didn't understand the example in fenics-manual-2011).
Thank you for your help!
Best wishes!

New airfoil model encountered mesh convertion probelm

Dear professor,

Thanks you so much for this greak work. I repleaced the Cylinder to a NACA-0012 airfoil. When I converted the mesh by msh_convert.py file. DOLFIN encountered an error. It seem that DOLFIN can not generate a facet_region.xml, thus can not found this file. Here is the error information:

*** Error: Unable to read data from XML file.
*** Reason: Unable to open file "mesh/NACA0012_2D_facet_region.xml".
*** Where: This error was encountered inside XMLFile.cpp.
*** Process: 0


*** DOLFIN version: 2017.2.0
*** Git changeset: unknown

Actually, I am wonderring why to convert the mesh to h5 file and facet_region.xml file from 18 to 26 line in msh_convert.py:

17 mesh = Mesh(xml_file)
18 out = HDF5File(mesh.mpi_comm(), h5_file, 'w')
19 out.write(mesh, 'mesh')
20
21 for region in ('facet_region.xml', ):
22 name, _ = region.split('')
23 r_xml_file = '
'.join([root, region])
24
25 f = MeshFunction('size_t', mesh, r_xml_file)
26 out.write(f, name)

I have searched the MeshFunction in

https://fenicsproject.org/olddocs/dolfin/latest/python/_autogenerated/dolfin.cpp.mesh.html?highlight=meshfunction#dolfin.cpp.mesh.MeshFunctionSizet

However, I got no answer. And I have tried to email the [email protected] for help. But the owner of the group may have removed this group and my email was rejected.

Looking forward to your help. Thank you so much!

Here is the geo file for NACA0012, It could generate the msh file.

1 //Scirpt
2
3 Li = 50.0; Lo = 50.0; // distance of inflow and outflow boundary from origin
4 Li1 = 2.0; Lo1 = 2.0; // distance of intermediate inflow and outflow f rom origin
5
6 n = 100; // points on upper/lower surface of airfoil used to define air foil
7 // These points may not appear in the mesh.
8
9 lc1 = 10.0; lc2 = 0.00001; // characteristic lengths of elements on airf oil and at farfield
10 lc3 = 0.1; //characteristic length for the inetrmediate domain
11 m = 2n - 2; // total number of points on airfoil without repetition
12 // LE and TE points are common to upper/lower surface
13
14 nle = n; // point number of LE = no. of points on upper surface
15 // Point(1) is trailing edge
16
17 // NACA0012 profile: formula taken from http://turbmodels.larc.nasa.gov/ naca0012_val.html
18 Macro NACA0012
19 x2 = x * x;
20 x3 = x * x2;
21 x4 = x * x3;
22 y = 0.594689181
(0.298222773Sqrt(x) - 0.127125232x - 0.357907906x2 + 0.291984971x3 - 0.105174606x4);
23 Return
24
25 // put points on upper surface of airfoil
26 For i In {1:n}
27 theta = Pi * (i-1) / (n-1);
28 x = 0.5 * (Cos(theta) + 1.0);
29 Call NACA0012;
30 Point(i) = {x, y, 0.0, lc2};
31 xx[i] = x;
32 yy[i] = y;
33 EndFor
34
35 // put points on lower surface of airfoil, use upper surface points and reflect
36 For i In {n+1:m}
37 Point(i) = {xx[2
n-i], -yy[2*n-i], 0.0, lc2};
38 EndFor
39
40 Spline(1) = {1:n}; Spline(2) = {n:m,1};
41
42 Transfinite Line{1,2} = n Using Bump 0.1;
43
44 Point(1001) = { 0.0, Li, 0.0,lc1};
45 Point(1002) = { 0.0, -Li, 0.0, lc1};
46 Point(1003) = {Lo, -Li, 0.0, lc1};
47 Point(1004) = {Lo, Li, 0.0, lc1};
48
49 Line(3) = {1004, 1001};
50 Circle(4) = {1001, nle, 1002};
51 Line(5) = {1002, 1003};
52 Line(6) = {1003, 1004};
53
54 Line Loop(1) = {1,2};
55 Line Loop(2) = {3,4,5,6};
56
57 //Intermediate Domain
58 Point(2001) = { 0.0, Li1, 0.0,lc3};
59 Point(2002) = { 0.0, -Li1, 0.0, lc3};
60 Point(2003) = {Lo1, -Li1, 0.0, lc3};
61 Point(2004) = {Lo1, Li1, 0.0, lc3};
62
63 Line(13) = {2004, 2001};
64 Circle(14) = {2001, nle, 2002};
65 Line(15) = {2002, 2003};
66 Line(16) = {2003, 2004};
67
68 Line Loop(3) = {13,14,15,16};
69
70 Plane Surface(201) = {3,1};
71 Plane Surface(202) = {3,2};
72
73 //Extrude {0,0,lc1} { Surface{201,202}; Layers{1}; Recombine;}
74
75 //Define Boundary Layer
76 Field[1] = BoundaryLayer;
77 Field[1].EdgesList = {1,2};
78 Field[1].AnisoMax = 1.0;
79 Field[1].FanNodesList = {1};
80 Field[1].hfar = 0.03;
81 Field[1].hwall_n = 0.001;
82 Field[1].thickness = 0.05;
83 Field[1].ratio = 1.1;
84 Field[1].Quads = 1;
85 Field[1].IntersectMetrics = 0;
86 BoundaryLayer Field = 1;
87
88 Physical Surface(201) = {201,202}; //Periodic at z = 0
89 Physical Surface(202) = {276, 234}; //Periodic at z = lc1
90 Physical Surface(203) = {271, 275, 263, 267}; //Farfield
91 //Physical Volume(1) = {1, 2};
92
93 Mesh 2;
94 Save "NACA0012_2D.msh";

Easy confusion on non-dimensionalization

Dear professor:
I'm really sorry to bother you again! In your code ,the range_drag_plot is about from -0.175 to -0.13,and my results are totally in this range with your program.However,the drag coefficient in article is about 2 or 3.And I tried to use equation(2.3) to process data ,still can not get the same results(the range from 2 to 3). It is very kind if you can explain those!
Thank you professor!
sincerely:
best wishes!
A student!

How the reward function working

Hello:
Here is a question when I used the deep reinforcement learning.I got the reward,and I wonder how does this reward guide the PPO to train the ANNs?In other words,how can I connect the reward and the PPO,and which part of this program show this proess!
Thank you

Negative drag values while training

Hi,

I've recently started using RL to fluid problems. So please excuse for naive questions. While training, the value of drag force is coming negative using fenics. Then how come Cd graph is plotted with the positive value? Can you elaborate

can not run properly with display error

Dear SIr
I am using your singularity image to run some simulation. But I get problem with running even single_runer case with followling error, can you please help me to fix that?

vagrant@vagrant:/vagrant/Cylinder2DFlowControlDRL/Cylinder2DFlowControlWithRL/baseline_flow$ python single_runner.py

[[52445,1],0]: A high-performance Open MPI point-to-point messaging module
was unable to find any relevant network interfaces:

Module: OpenFabrics (openib)
Host: vagrant

Another transport will be used instead, although this may result in
lower performance.

iUFL can be obtained from https://github.com/MiroK/ufl-interpreter
resume env
--- call init ---
mesh_file = mesh/turek_2d.h5
-0.2 0.21
total_number_of_probes = 151
--- done init ---
define network specs
define agent
environment.states = {'shape': (151,), 'type': 'float'}
environment.actions = {'max_value': 0.01, 'shape': (2,), 'min_value': -0.01, 'type': 'float'}
network_spec = [{'type': 'dense', 'size': 512}, {'type': 'dense', 'size': 512}]
2019-06-15 00:57:31.474054: I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
2019-06-15 00:57:31.508053: E tensorflow/stream_executor/cuda/cuda_driver.cc:406] failed call to cuInit: CUDA_ERROR_UNKNOWN
2019-06-15 00:57:31.508848: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:145] kernel driver does not appear to be running on this host (vagrant): /proc/driver/nvidia/version does not exist
Trained Network not found...
start simulation
2019-06-15 00:57:32.020531: W tensorflow/core/grappler/optimizers/arithmetic_optimizer.cc:1441] Failed to build SimpleGraphView.
2019-06-15 00:57:32.022051: E tensorflow/core/grappler/optimizers/dependency_optimizer.cc:586] Iteration = 0, topological sort failed with message: Non-existent input ^ConstantFoldingCtrl/ppo/cond/add/Switch_0 for node ConstantFolding/ppo/cond/strided_slice_1/stack_const_axis
2019-06-15 00:57:32.022916: E tensorflow/core/grappler/optimizers/dependency_optimizer.cc:586] Iteration = 1, topological sort failed with message: Non-existent input ^ConstantFoldingCtrl/ppo/cond/add/Switch_0 for node ConstantFolding/ppo/cond/strided_slice_1/stack_const_axis
Traceback (most recent call last):
File "single_runner.py", line 150, in
one_run()
File "single_runner.py", line 119, in one_run
state, terminal, reward = environment.execute(null_action)
File "/vagrant/Cylinder2DFlowControlDRL/Cylinder2DFlowControlWithRL/baseline_flow/../Env2DCylinder.py", line 799, in execute
self.visual_inspection()
File "/vagrant/Cylinder2DFlowControlDRL/Cylinder2DFlowControlWithRL/baseline_flow/../Env2DCylinder.py", line 461, in visual_inspection
plt.subplots(total_number_subplots, 1)
File "/usr/lib/python2.7/dist-packages/matplotlib/pyplot.py", line 1177, in subplots
fig = figure(**fig_kw)
File "/usr/lib/python2.7/dist-packages/matplotlib/pyplot.py", line 527, in figure
**kwargs)
File "/usr/lib/python2.7/dist-packages/matplotlib/backends/backend_tkagg.py", line 84, in new_figure_manager
return new_figure_manager_given_figure(num, figure)
File "/usr/lib/python2.7/dist-packages/matplotlib/backends/backend_tkagg.py", line 92, in new_figure_manager_given_figure
window = Tk.Tk()
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1818, in init
self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: couldn't connect to display ":0.0"
Aborted (core dumped)

related to value of mean Drag

why mean drag coffecient value is come too less that (-.4409(approx) while as in many research paper it is mentioned that Drag coffecient value is close 1.34 for Reynolds number = 100 ??
pls explain this

UnicodeDecodeError on exec under Singularity's img

Hi,

I've tried to run your code on my computer and to make everything easier I wanted to use your singularity container. Everything is working fine for the container but when I run the code I got this error :

UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 15: ordinal not in range(128)

And here is the full traceback :

Traceback (most recent call last): File "single_runner.py", line 2, in <module> from env import resume_env File "/home/***/Cylinder2DFlowControlWithRL/baseline_flow/env.py", line 10, in <module> from Env2DCylinder import Env2DCylinder File "/home/***/Cylinder2DFlowControlWithRL/baseline_flow/../Env2DCylinder.py", line 3, in <module> from tensorforce.environments import Environment File "/usr/local/lib/python2.7/dist-packages/tensorforce/environments/__init__.py", line 17, in <module> from tensorforce.environments.environment import Environment File "/usr/local/lib/python2.7/dist-packages/tensorforce/environments/environment.py", line 22, in <module> import tensorforce.util File "/usr/local/lib/python2.7/dist-packages/tensorforce/util.py", line 19, in <module> import tensorflow as tf File "/usr/local/lib/python2.7/dist-packages/tensorflow/__init__.py", line 24, in <module> from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/__init__.py", line 82, in <module> from tensorflow.python.estimator import estimator_lib as estimator File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/estimator/estimator_lib.py", line 41, in <module> from tensorflow.python.estimator.inputs import inputs File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/estimator/inputs/inputs.py", line 22, in <module> from tensorflow.python.estimator.inputs.numpy_io import numpy_input_fn File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/estimator/inputs/numpy_io.py", line 26, in <module> from tensorflow.python.estimator.inputs.queues import feeding_functions File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/estimator/inputs/queues/feeding_functions.py", line 40, in <module> import pandas as pd File "/usr/local/lib/python2.7/dist-packages/pandas/__init__.py", line 42, in <module> from pandas.core.api import * File "/usr/local/lib/python2.7/dist-packages/pandas/core/api.py", line 10, in <module> from pandas.core.groupby.groupby import Grouper File "/usr/local/lib/python2.7/dist-packages/pandas/core/groupby/__init__.py", line 2, in <module> from pandas.core.groupby.groupby import ( File "/usr/local/lib/python2.7/dist-packages/pandas/core/groupby/groupby.py", line 49, in <module> from pandas.core.frame import DataFrame File "/usr/local/lib/python2.7/dist-packages/pandas/core/frame.py", line 74, in <module> from pandas.core.series import Series File "/usr/local/lib/python2.7/dist-packages/pandas/core/series.py", line 80, in <module> import pandas.plotting._core as gfx File "/usr/local/lib/python2.7/dist-packages/pandas/plotting/__init__.py", line 11, in <module> from pandas.plotting._core import boxplot File "/usr/local/lib/python2.7/dist-packages/pandas/plotting/_core.py", line 45, in <module> from pandas.plotting import _converter File "/usr/local/lib/python2.7/dist-packages/pandas/plotting/_converter.py", line 8, in <module> import matplotlib.units as units File "/usr/lib/python2.7/dist-packages/matplotlib/__init__.py", line 1133, in <module> rcParams = rc_params() File "/usr/lib/python2.7/dist-packages/matplotlib/__init__.py", line 967, in rc_params fname = matplotlib_fname() File "/usr/lib/python2.7/dist-packages/matplotlib/__init__.py", line 782, in matplotlib_fname cwd = os.getcwdu() UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 15: ordinal not in range(128)

Any help will be much appreciated !

Thibaut

about changing the geometry

Hi, Mr.Jean,
I want to change the geometry ,change the cylinder to other geometry.Should i change the geometry_2d.template_geo file? and i want to change it directly the shape rather the code .so sorry to distract you .i would be so grateful for any suggestions.

higher Reynolds problem

Hi,Sir. I am interested in this work you did, I carefully read your code and articles and lectures on Youtube.I also successfully run your code on linux, and I try to simulate an new cylinder simulation at higher Reynolds number, so I change the value of Um in line 61 of empty_simulation/env.py. After trying that, I found that when Um exceeds 1.5*1.3 there will be an error in simulation running information,Rec Area, drag and lift all three variables are invalid. And I checked the code of probes.py and have no clue, if you still remember the code, can you elaborate? The code running information is in the following:

Simu_lift | Ep N: 0, step: 0, Rec Area: 0.0977, drag: -2.2200, lift: -0.0144
/home/triwonsx/Cylinder2DFlowControlDRL-master/Cylinder2DFlowControlWithRL/empty_simulation/../probes.py:325: RuntimeWarning: invalid value encountered in less
mask = np.where(coefs0 < self.threshold)[0] # This is local to coefs0 numbering
/usr/local/lib/python2.7/dist-packages/numpy/core/_methods.py:26: RuntimeWarning: invalid value encountered in reduce
return umr_maximum(a, axis, None, out, keepdims)
/usr/local/lib/python2.7/dist-packages/numpy/core/_methods.py:29: RuntimeWarning: invalid value encountered in reduce
return umr_minimum(a, axis, None, out, keepdims)
/usr/lib/python2.7/dist-packages/matplotlib/quiver.py:627: RuntimeWarning: Mean of empty slice.
amean = a[~self.Umask].mean()
/usr/local/lib/python2.7/dist-packages/numpy/core/_methods.py:80: RuntimeWarning: invalid value encountered in double_scalars
ret = ret.dtype.type(ret / rcount)
/usr/lib/python2.7/dist-packages/matplotlib/quiver.py:701: RuntimeWarning: invalid value encountered in less
short = np.repeat(length < minsh, 8, axis=1)
/usr/lib/python2.7/dist-packages/matplotlib/quiver.py:711: RuntimeWarning: invalid value encountered in less
tooshort = length < self.minlength
/usr/lib/python2.7/dist-packages/matplotlib/colors.py:941: UserWarning: Warning: converting a masked element to nan.
vmin = float(vmin)
/usr/lib/python2.7/dist-packages/matplotlib/colors.py:942: UserWarning: Warning: converting a masked element to nan.
vmax = float(vmax)
Simu_lift | Ep N: 0, step: 100, Rec Area: 0.0000, drag: nan, lift: nan
Simu_lift | Ep N: 0, step: 200, Rec Area: 0.0000, drag: nan, lift: nan
Simu_lift | Ep N: 0, step: 300, Rec Area: 0.0000, drag: nan, lift: nan
Simu_lift | Ep N: 0, step: 400, Rec Area: 0.0000, drag: nan, lift: nan
Simu_lift | Ep N: 0, step: 500, Rec Area: 0.0000, drag: nan, lift: nan

could not connect to display ":0.0"

Conversion done mesh_file = mesh/turek_2d.h5 -0.2 0.21 total_number_of_probes = 151 No protocol specified No protocol specified Traceback (most recent call last): File "make_mesh.py", line 2, in <module> env.resume_env(plot=500, remesh=True) File "/home/yufeimei/Downloads/singularity-2.5.1/my img/ellipse/ellipse_y/baseline_flow/env.py", line 181, in resume_env simu_name = simu_name) File "/home/yufeimei/Downloads/singularity-2.5.1/my img/ellipse/ellipse_y/baseline_flow/../Env2DCylinder.py", line 132, in __init__ self.start_class(complete_reset=True) File "/home/yufeimei/Downloads/singularity-2.5.1/my img/ellipse/ellipse_y/baseline_flow/../Env2DCylinder.py", line 286, in start_class self.visual_inspection() File "/home/yufeimei/Downloads/singularity-2.5.1/my img/ellipse/ellipse_y/baseline_flow/../Env2DCylinder.py", line 461, in visual_inspection plt.subplots(total_number_subplots, 1) File "/usr/lib/python2.7/dist-packages/matplotlib/pyplot.py", line 1177, in subplots fig = figure(**fig_kw) File "/usr/lib/python2.7/dist-packages/matplotlib/pyplot.py", line 527, in figure **kwargs) File "/usr/lib/python2.7/dist-packages/matplotlib/backends/backend_tkagg.py", line 84, in new_figure_manager return new_figure_manager_given_figure(num, figure) File "/usr/lib/python2.7/dist-packages/matplotlib/backends/backend_tkagg.py", line 92, in new_figure_manager_given_figure window = Tk.Tk() File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1818, in __init__ self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use) _tkinter.TclError: couldn't connect to display ":0.0" Aborted (core dumped)

I can run the code correctly in debian,but there are some qusetions when i use a new ubantu.could not display ":0.0", It can not show the figure.can you give me some suggestions?

No file in mesh directory

Hi Jean,
I was able to get the singularity image working and I can properly import everything however I believe that there was some type of problem with how I have gmsh setup.

These are the files in the current directory:

ls
fenics-and-more.img  
Cylinder2DFlowControlDRL-master    gmsh-3.0.6-Linux64

And this is the command I ran to setup singularity and gmsh:

singularity shell fenics-and-more.img -c "export DISPLAY=:0.0 && export PATH="gmsh-3.0.6-Linux64/bin:$PATH" && /bin/bash"

Then I ran single_runner.py in the empty_simulation folder to get this error output.

IOError                                   Traceback (most recent call last)
<ipython-input-2-6dc4ee2a2e60> in <module>()
     20 printi("resume env")
     21 
---> 22 environment = resume_env(dump=10, single_run=True)
     23 deterministic=True
     24 

/home/vagrant/vboxshare/Cylinder2DFlowControlDRL-master/Cylinder2DFlowControlWithRL/empty_simulation/env.pyc in resume_env(plot, step, dump, remesh, random_start, single_run)
    179                                     reward_function=reward_function,
    180                                     number_steps_execution=number_steps_execution,
--> 181                                     simu_name = simu_name)
    182 
    183     return(env_2d_cylinder)

/home/vagrant/vboxshare/Cylinder2DFlowControlDRL-master/Cylinder2DFlowControlWithRL/empty_simulation/../Env2DCylinder.pyc in __init__(self, path_root, geometry_params, flow_params, solver_params, output_params, optimization_params, inspection_params, n_iter_make_ready, verbose, size_history, reward_function, size_time_state, number_steps_execution, simu_name)
    130         self.initialized_visualization = False
    131 
--> 132         self.start_class(complete_reset=True)
    133 
    134         printi("--- done init ---")

/home/vagrant/vboxshare/Cylinder2DFlowControlDRL-master/Cylinder2DFlowControlWithRL/empty_simulation/../Env2DCylinder.pyc in start_class(self, complete_reset)
    203                         printi("Load buffer history")
    204 
--> 205                     with open('mesh/dict_history_parameters.pkl', 'rb') as f:
    206                         self.history_parameters = pickle.load(f)
    207 

IOError: [Errno 2] No such file or directory: 'mesh/dict_history_parameters.pkl'

It can't find some file that is supposed to be in the mesh folder, my best guess is that gmsh isn't generating the file that it is looking for. But I don't know what I could have done incorrectly with gmsh.
Thanks for the help

Using Dolphin Expression

Hello,

With the Fenics version available on their official Docker container, it seems that your definition of python JetBCValue is outdated because your are building it on top of an python Expression :

class JetBCValue(Expression):

    def __init__(self, radius, width, theta0, Q, **kwargs):
        assert width > 0 and radius > 0
        theta0 = np.deg2rad(theta0)
        assert theta0 >= 0 
        self.radius = radius
        self.width = np.deg2rad(width)
        self.theta0 = normalize_angle(theta0)

        self.Q = Q

It seems that you need to pass a UserExpression to make it work :

class JetBCValue(UserExpression):


    def __init__(self, radius, width, theta0, Q, **kwargs):
        super().__init__(**kwargs)
        assert width > 0 and radius > 0 
        theta0 = np.deg2rad(theta0)
        self.width = np.deg2rad(width)
        self.radius = radius
        self.theta0 = normalize_angle(theta0)

        self.Q = Q

the rest of the class can remain the same.

question when made a new mesh

hello ,i want to make a new simulation of my own.When i run make_mesh.py,here is a mistake .

iUFL can be obtained from https://github.com/MiroK/ufl-interpreter
Make converge initial state for 10000 iterations
--- call init ---
Traceback (most recent call last):
File "make_mesh.py", line 2, in
env.resume_env(plot=False, remesh=True)
File "/home/yang/Downloads/jet_angle5/Cylinder2DFlowControlWithRL/empty_simulation/env.py", line 181, in resume_env
simu_name = simu_name)
File "/home/yang/Downloads/jet_angle5/Cylinder2DFlowControlWithRL/empty_simulation/../Env2DCylinder.py", line 132, in init
self.start_class(complete_reset=True)
File "/home/yang/Downloads/jet_angle5/Cylinder2DFlowControlWithRL/empty_simulation/../Env2DCylinder.py", line 183, in start_class
generate_mesh(self.geometry_params, template=self.geometry_params['template'])
File "/home/yang/Downloads/jet_angle5/Cylinder2DFlowControlWithRL/empty_simulation/generate_msh.py", line 11, in generate_mesh
printiv(template)
File "/usr/local/lib/python2.7/dist-packages/printind/printind_function.py", line 38, in printiv
string = inspect.getframeinfo(frame[0]).code_context[0].strip()
TypeError: 'NoneType' object has no attribute 'getitem'
Aborted (core dumped)

it is really appreciated for your help! and i am really sorry to trouble you for a debug question.

How to customize the .xdmf file for initial conditions?

Hi,
I'm trying to create a new mesh model and run that in the baseline flow. But if I just plug in my mesh model, the line XDMFFile(comm, flow_params[path]).read_checkpoint(func, name, 0) will give Segmentation fault (core dumped), where flow_params[path] is 'u_init.xdmf' file.
Could you plz give an instruction on how I can customize my own .xdmf files fitting the new mesh model?
Thanks a lot!

problems about singularity container parts

Hello Professor, I want to download the singularity container fragment, but the integrity of the segments is not correct. What is the reason


> (base) lzy@lzy-virtual-machine:~$ cd /home/lzy/Cylinder2DFlowControlDRL/container
> (base) lzy@lzy-virtual-machine:~/Cylinder2DFlowControlDRL/container$ cat fenics-and-more.img_part.?? > fenics-and-more.img
> (base) lzy@lzy-virtual-machine:~/Cylinder2DFlowControlDRL/container$ sha256sum fenics-and-more.img
> 141a0faf677f1d24d2e7643a9c763c355a18e34a7ccfc33d7ce4ef65524c004a  fenics-and-more.img
> 

how to downlowd

well,dear professor!,I want to download the singularity,however ,the website you offered is not avaliable .

issues about running single_runner.py

Mr. Jean, after I downloaded singularity and your container, I tried to run single_runner.py in singularity. However, it seemed something went wrong. Was it about not downloading tensorforce, python and so on successfully? Hope to get your instruction.

Singularity> exec '/home/yr/Cylinder2DFlowControlDRL-master/Cylinder2DFlowControlWithRL/baseline_flow/single_runner.py'
from: can't read /var/mail/printind.printind_function
from: can't read /var/mail/env
/home/yr/Cylinder2DFlowControlDRL-master/Cylinder2DFlowControlWithRL/baseline_flow/single_runner.py: line 4: import: command not found
from: can't read /var/mail/tensorforce.agents
from: can't read /var/mail/tensorforce.execution
/home/yr/Cylinder2DFlowControlDRL-master/Cylinder2DFlowControlWithRL/baseline_flow/single_runner.py: line 7: import: command not found
/home/yr/Cylinder2DFlowControlDRL-master/Cylinder2DFlowControlWithRL/baseline_flow/single_runner.py: line 8: import: command not found
/home/yr/Cylinder2DFlowControlDRL-master/Cylinder2DFlowControlWithRL/baseline_flow/single_runner.py: line 9: import: command not found
/home/yr/Cylinder2DFlowControlDRL-master/Cylinder2DFlowControlWithRL/baseline_flow/single_runner.py: line 18:
import sys
import os
cwd = os.getcwd()
sys.path.append(cwd + /../Simulation/)

Can not get the "fenics-and-more.img" file

Hello,
Thank you for sharing your code for flow control problems, it's very useful for my research. I have been working on setting up the container and I found that I couldn't get the "fenics-and-more.img" file from the following link:
https://folk.uio.no/jeanra/Informatics/fenics-and-more.img
I've tried both curl and wget but neither of them works.
I got the following information:
sminder@sminder-VirtualBox:~$ wget "https://folk.uio.no/jeanra/Informatics/fenics-and-more.img" --2020-10-21 18:52:39-- https://folk.uio.no/jeanra/Informatics/fenics-and-more.img Resolving folk.uio.no (folk.uio.no)... 129.240.118.92, 2001:700:100:118::92 Connecting to folk.uio.no (folk.uio.no)|129.240.118.92|:443... connected. HTTP request sent, awaiting response... 301 Moved Permanently Location: https://folk.universitetetioslo.no/jeanra/Informatics/fenics-and-more.img [following] --2020-10-21 18:52:40-- https://folk.universitetetioslo.no/jeanra/Informatics/fenics-and-more.img Resolving folk.universitetetioslo.no (folk.universitetetioslo.no)... 129.240.118.41, 2001:700:100:118::41 Connecting to folk.universitetetioslo.no (folk.universitetetioslo.no)|129.240.118.41|:443... connected. HTTP request sent, awaiting response... 404 Not Found 2020-10-21 18:52:40 ERROR 404: Not Found.
Is there another method to download this image?

Many thanks.
Shaoze

Problem with creating a new mesh

Hi Jean,
I want to make a new simulation with jet_angle=5. I'm using the singularity container. When i try to run make_mesh.py it outputs this

Info    : 4821 vertices 9670 elements
Info    : Writing 'mesh/turek_2d.msh'...
Info    : Done writing 'mesh/turek_2d.msh'
Info    : Stopped on Thu Feb 27 20:33:14 2020
Traceback (most recent call last):
  File "/usr/bin/dolfin-convert", line 36, in <module>
    from dolfin_utils.commands import getoutput
ModuleNotFoundError: No module named 'dolfin_utils'
Traceback (most recent call last):
  File "make_mesh.py", line 2, in <module>
    env.resume_env(plot=500, remesh=True)
  File "/home/ugr/Downloads/Cylinder2DFlowControlDRL-master/Cylinder2DFlowControlWithRL/empty_simulation/env.py", line 181, in resume_env
    simu_name = simu_name)
  File "/home/ugr/Downloads/Cylinder2DFlowControlDRL-master/Cylinder2DFlowControlWithRL/empty_simulation/../Env2DCylinder.py", line 132, in __init__
    self.start_class(complete_reset=True)
  File "/home/ugr/Downloads/Cylinder2DFlowControlDRL-master/Cylinder2DFlowControlWithRL/empty_simulation/../Env2DCylinder.py", line 190, in start_class
    convert(msh_file, h5_file)
  File "/home/ugr/Downloads/Cylinder2DFlowControlDRL-master/Cylinder2DFlowControlWithRL/empty_simulation/../msh_convert.py", line 15, in convert
    assert os.path.exists(xml_file)
AssertionError
Aborted (core dumped)

So It can't import dolfin_utils, but when i try to run
python2 -c "import dolfin_utils"
or
python2 -c "from dolfin_utils.commands import getoutput"
It does not display any errors. I also tried several versions of gmsh, including the one in your archive.

This is the command I ran to setup singularity and gmsh (Using the "built-in" version):
singularity shell ~/Downloads/fenics-and-more.img -c "export DISPLAY=:0.0 && export PATH="~/Downloads/Cylinder2DFlowControlDRL-master:$PATH" && /bin/bash"
and the version i downloaded by my own
shell ~/Downloads/fenics-and-more.img -c "export DISPLAY=:0.0 && export PATH="~/Downloads/gmsh-3.0.6-Linux64/bin:$PATH" && /bin/bash"

Also want to clarify that there are no problems running single_runner.py with ready-made mesh.

I apologize for distracting you. I would be very grateful for any help!

About changing Re

Hello,i want to use a larger Nu with your code,so i change Um from 1.5 to 4.5 ,Um=4.5,after this ,i think the Nu number is 300.At the same time ,i also change the refinement of the mesh ,dt ,something related.However,when i run make_mesh.py,there is something wrong about the drag results.(the drag results should be close between Nu=100 and Nu=300,and this is mush larger) .
are there any others factors that may cause this problem?
Thank you again!(it is embarrassed for me that lack knowledge in this respect ,please don't mind)
Simu_M005_lift | Ep N: 0, step: 1000, Rec Area: 0.0045, drag: -1.1114, lift: 0.0100
Simu_M005_lift | Ep N: 0, step: 1100, Rec Area: 0.0050, drag: -1.1644, lift: 0.0103
Simu_M005_lift | Ep N: 0, step: 1200, Rec Area: 0.0055, drag: -1.1837, lift: 0.0106
Simu_M005_lift | Ep N: 0, step: 1300, Rec Area: 0.0059, drag: -1.1701, lift: 0.0121
Simu_M005_lift | Ep N: 0, step: 1400, Rec Area: 0.0065, drag: -1.1448, lift: 0.0152
Simu_M005_lift | Ep N: 0, step: 1500, Rec Area: 0.0071, drag: -1.1253, lift: 0.0198
Simu_M005_lift | Ep N: 0, step: 1600, Rec Area: 0.0078, drag: -1.1147, lift: 0.0255
Simu_M005_lift | Ep N: 0, step: 1700, Rec Area: 0.0086, drag: -1.1090, lift: 0.0318
Simu_M005_lift | Ep N: 0, step: 1800, Rec Area: 0.0090, drag: -1.1046, lift: 0.0383
Simu_M005_lift | Ep N: 0, step: 1900, Rec Area: 0.0096, drag: -1.0996, lift: 0.0448
Simu_M005_lift | Ep N: 0, step: 2000, Rec Area: 0.0100, drag: -1.0931, lift: 0.0514
Simu_M005_lift | Ep N: 0, step: 2100, Rec Area: 0.0106, drag: -1.0850, lift: 0.0579
Simu_M005_lift | Ep N: 0, step: 2200, Rec Area: 0.0113, drag: -1.0757, lift: 0.0640
Simu_M005_lift | Ep N: 0, step: 2300, Rec Area: 0.0113, drag: -1.0663, lift: 0.0690
Simu_M005_lift | Ep N: 0, step: 2400, Rec Area: 0.0119, drag: -1.0575, lift: 0.0727
Simu_M005_lift | Ep N: 0, step: 2500, Rec Area: 0.0122, drag: -1.0500, lift: 0.0742
Simu_M005_lift | Ep N: 0, step: 2600, Rec Area: 0.0127, drag: -1.0437, lift: 0.0728
Simu_M005_lift | Ep N: 0, step: 2700, Rec Area: 0.0130, drag: -1.0382, lift: 0.0677
Simu_M005_lift | Ep N: 0, step: 2800, Rec Area: 0.0132, drag: -1.0332, lift: 0.0585
Simu_M005_lift | Ep N: 0, step: 2900, Rec Area: 0.0140, drag: -1.0287, lift: 0.0448
Simu_M005_lift | Ep N: 0, step: 3000, Rec Area: 0.0141, drag: -1.0245, lift: 0.0263
Simu_M005_lift | Ep N: 0, step: 3100, Rec Area: 0.0144, drag: -1.0207, lift: 0.0031

How to confirm the total simulation step

Hello:
I expand the simulation area and leave the other conditions the same as before,
the simulation_duration=2.0,dt=0.0005,and I think the total simulation step=4000,however,when I run the base_line.py or single_runner.py(First I run make_mesh.py),there are more than 4000 steps ,would you like to offer any suggestions ?
Thank you,best wishes!
Simu_lift | Ep N: 0, step: 4000, Rec Area: 0.0547, drag: -0.1108, lift: 0.0021
Simu_lift | Ep N: 0, step: 4100, Rec Area: 0.0542, drag: -0.1109, lift: 0.0018
Simu_lift | Ep N: 0, step: 4200, Rec Area: 0.0544, drag: -0.1110, lift: 0.0010
Simu_lift | Ep N: 0, step: 4300, Rec Area: 0.0535, drag: -0.1113, lift: -0.0003
Simu_lift | Ep N: 0, step: 4400, Rec Area: 0.0550, drag: -0.1116, lift: -0.00

Could not open image; image format not recognized

Hi,

I installed the Singularity and put the segments from the container folder together.
Then I tried to run the following line, but I got a Fatal Error:

singularity shell ~/Cylinder2DFlowControlDRL-master/container/fenics-and-more.img -c "export DISPLAY=:0.0 && export PATH="~/gmsh-3.0.6-Linux64/bin:$PATH" && /bin/bash"

FATAL:   could not open image /home/zww/Cylinder2DFlowControlDRL-master/container/fenics-and-more.img: image format not recognized

would you please give me some ideas about this?

Thanks very much.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.