jerabaul29 / Cylinder2DFlowControlDRL

code for performing active flow control of the 2D Karman street using Deep Reinforcement Learning
MIT License
150 stars 64 forks source link

about changing the geometry #16

Closed turtle-mei closed 4 years ago

turtle-mei commented 4 years ago

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.

jerabaul29 commented 4 years ago

Hi,

Yes, basically you will need to change this file as you said, which is basically a scripted description of your geometry in gmsh format:

https://github.com/jerabaul29/Cylinder2DFlowControlDRL/blob/master/Cylinder2DFlowControlWithRL/geometry_2d.template_geo

and possibly a bit of this, which is setting up the relevant parameters there:

https://github.com/jerabaul29/Cylinder2DFlowControlDRL/blob/master/Cylinder2DFlowControlWithRL/generate_msh.py

I also recommend that you base your work on the more recent code available there:

https://github.com/jerabaul29/Cylinder2DFlowControlDRLParallel

Let me know if anything is unclear. You may need to spend a bit of time learning about gmsh at first. Also, gmsh, fenics, and tensorforce are all packages undergoing rapid development, and the code here (and on the parallel repo) is already 2 and 1 years old respective, so if you want to use the latest features of the underlying packages, you may have a bit of porting / small updates to do.

turtle-mei commented 4 years ago

I think I know the general idea,thanks for your help! Thank you.

turtle-mei commented 4 years ago

hi, I apologize for distracting you. I would be very grateful for any help! i change the geo and parameters. when i run the code,there are the below error.

`Info : 5913 vertices 11054 elements Info : Writing 'mesh/turek_2d.msh'... Info : Done writing 'mesh/turek_2d.msh' Info : Stopped on Mon Apr 27 01:48:42 2020 Converting from Gmsh format (.msh, .gmsh) to DOLFIN XML format Expecting 5110 vertices Found all vertices Expecting 9810 cells Found all cells Traceback (most recent call last): File "/usr/bin/dolfin-convert", line 132, in main(sys.argv[1:]) File "/usr/bin/dolfin-convert", line 79, in main meshconvert.convert2xml(ifilename, ofilename, iformat=iformat) File "/usr/lib/python2.7/dist-packages/dolfin_utils/meshconvert/meshconvert.py", line 1304, in convert2xml convert(ifilename, XmlHandler(ofilename), iformat=iformat) File "/usr/lib/python2.7/dist-packages/dolfin_utils/meshconvert/meshconvert.py", line 1325, in convert gmsh2xml(ifilename, handler) File "/usr/lib/python2.7/dist-packages/dolfin_utils/meshconvert/meshconvert.py", line 495, in gmsh2xml index = nodes_as_facets[tuple(nodes)] KeyError: (0, 16) Aborted Traceback (most recent call last): File "make_mesh.py", line 2, in env.resume_env(plot=500, remesh=True) File "/home/ivan/Downloads/singularity/singularity-2.5.1/my img/square/empty/env.py", line 181, in resume_env simu_name = simu_name) File "/home/ivan/Downloads/singularity/singularity-2.5.1/my img/square/empty/../Env2DCylinder.py", line 132, in init self.start_class(complete_reset=True) File "/home/ivan/Downloads/singularity/singularity-2.5.1/my img/square/empty/../Env2DCylinder.py", line 190, in start_class convert(msh_file, h5_file) File "/home/ivan/Downloads/singularity/singularity-2.5.1/my img/square/empty/../msh_convert.py", line 17, in convert mesh = Mesh(xml_file) File "/usr/lib/python2.7/dist-packages/dolfin/mesh/meshes.py", line 63, in init cpp.Mesh.cppinit(self, *args, *kwargs) File "/usr/lib/python2.7/dist-packages/dolfin/cpp/mesh.py", line 2074, in init _mesh.Mesh_swiginit(self, _mesh.new_Mesh(args)) RuntimeError:

------------------------------------------------------------------------- DOLFIN encountered an error. If you are not able to resolve this issue *** using the information listed below, you can ask for help at


*** fenics-support@googlegroups.com


Remember to include the error message listed below and, if possible, include a minimal running example to reproduce the error.


------------------------------------------------------------------------- Error: Unable to read data from XML file. Reason: Error while parsing XML with status "Start-end tags mismatch". Where: This error was encountered inside XMLFile.cpp. *** Process: 0


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

Aborted` but when i comment out the part that about define the jet surface in the geometry_2d.template_geo ,it run normally. i feel so comfused.

jerabaul29 commented 4 years ago

https://github.com/jerabaul29/Cylinder2DFlowControlDRL/issues/12

https://github.com/jerabaul29/Cylinder2DFlowControlDRL/issues/4

jerabaul29 commented 4 years ago

Other than that, there is not much I can do, as things quickly become machine / installation / case specific.