Hi Dio,
On 11/21/2017 11:59 AM, Dio Dwianto wrote:
Hi Robert,
I installed SfePy using the conda install. Would it be possible to get the "show_mesh_info.py" using the conda update?
Yes, but you need to wait for the next release.
I tried fixing the region definitions and the boundary conditions according to the bounding box ranges :
[image: Inline image 1]
But I still haven't got the proper temperature distribution and I'm all out of ideas.
[image: Inline image 2]
Does it matter what kind and how many nodes we have in the mesh?
Unlike the original mesh, where the cylinder is along the x axis, your mesh cylinder is along the z axis. The following changes are needed to make it work:
regions = { 'Omega' : 'all', 'Gamma_Left' : ('vertices in (z < 0.00001)', 'facet'), 'Gamma_Right' : ('vertices in (z > 999.99)', 'facet'), # 'Gamma_Left' : ('vertices in (x < 0.00001)', 'facet'), # 'Gamma_Right' : ('vertices in (x > 0.099999)', 'facet'), }
def get_ic(coor, ic): """Non-constant initial condition.""" import numpy as nm # Normalize z coordinate. mi, ma = coor[:,2].min(), coor[:,2].max() nx = (coor[:,2] - mi) / (ma - mi) # # Normalize x coordinate. # mi, ma = coor[:,0].min(), coor[:,0].max() # nx = (coor[:,0] - mi) / (ma - mi) return nm.where( (nx > 0.25) & (nx < 0.75 ), 8.0 * (nx - 0.5), 0.0 )
Also, to verify, that your regions are correct, use --save-regions-as-groups option as follows:
./simple.py time_poisson.py --save-regions-as-groups --solve-not
and then display <mesh-name>_regions.vtk (steel_cylinder_regions.vtk in your case).
r.
Thank you so much for your help,
Dio
On Sat, Nov 18, 2017 at 8:09 PM, Robert Cimrman cimrman3@ntc.zcu.cz wrote:
On 11/17/2017 08:46 PM, Dio Dwianto wrote:
Hi Robert,
thank you very much for your reply, I really appreciate it. I do have some follow up questions and I hope you would be so kind to bear with me.
I can't seem to find show_mesh_info.py at the Script folder, or any folder in my SfePy directory for that matter. Is there any way for me to update my scripts?
How did you install sfepy? I have just noticed, that the show_mesh_info.py script is missing in the latest release (2017.3) source distribution (will be fixed in the next release). It is only in the git repository sources. It shows for steel_cylinder.med:
sfepy: CMesh: n_coor: 9878, dim 3, tdim: 3, n_el 44215 sfepy: element types: ['3_4'] sfepy: nodal BCs: [] sfepy: bounding box: x: [-500.0, 500.0], y: [-499.996756531, 499.996756531], z: [0.0, 1000.0] sfepy: centre: [ 7.83762706 1.08148282 496.65201085]
and for cylinder.mesh:
sfepy: CMesh: n_coor: 354, dim 3, tdim: 3, n_el 1348 sfepy: element types: ['3_4'] sfepy: nodal BCs: [] sfepy: bounding box: x: [-1.2246063538e-18, 0.1], y: [-0.02, 0.02], z: [-0.019999827242, 0.019999872274] sfepy: centre: [ 5.05445344e-02 -2.40167062e-05 -1.92192931e-05]
Check the bounding box ranges with the region definitions (Gamma_Left, Gamma_Right) in your file.
I found some seemingly useful scripts like "mesh_generators.py" and
"mesh_tools.py" (files attached) but I'm not sure how to use them because I don't see any line of codes where I could add a directory to my geometry file. Or do I use some command combinations on the Command Line?
You normally need not to use the first one, if you already have a mesh. The second one is useful for treating meshes coming from CT and similar images.
I'm also curious about these lines of codes
[image: Inline image 1]
This is just a definition of some function of coordinates that is used as an initial condition.
[image: Inline image 2]
You can ignore those for now - the gen_lines() function is related to probing the results. I recommend reading in detail the tutorial and the primer chapters of the documentation.
Cheers, r.
what are these for? If I want to use the script to do some simulations for
complex geometries, do I have to edit these codes accordingly?
Thanks again for your help and I hope you have a great weekend!
Dio
On Fri, Nov 17, 2017 at 2:52 PM, Robert Cimrman cimrman3@ntc.zcu.cz wrote:
Hi Dio,
On 11/16/2017 02:14 PM, Dio Dwianto wrote:
Hi,
I'm trying to use one of the example "time_poisson.py" for heat transfer simulation. I used my own mesh data ("steel_cylinder.med" ), which I created using Salome.
Somehow I didn't get the temperature distribution like what we would have gotten if we run the "time_poisson.py", which looked like this
[image: Inline image 1] Instead I could only get these results
[image: Inline image 2]
I attached the relevant files. Can somebody please tell me what I did wrong with the scripting?
You need to adjust the region definitions for the "steel_cylinder.med" mesh - it has different dimensions than "cylinder.mesh". The mesh dimensions can be easily printed using "script/show_mesh_info.py".
Check the example [1] for a way that would work for both the meshes (using the mesh bounding box).
r.
Thanks for your help!
participants (1)
-
Robert Cimrman