|
[Sponsors] |
March 10, 2015, 04:46 |
Mesh motion with several .csv files
|
#1 |
Senior Member
Lance
Join Date: Mar 2009
Posts: 669
Rep Power: 22 |
Hi,
I have a set of .csv files (>100) that contain coordinates and mesh deformation. For each time step in the simulation I want to load one of the files and use that as the current “specified mesh displacement”. I asked Ansys support for an example on how to it efficiently (using fortran subroutines?) but they had no clue. Anyone here that have an example or idea on how to do this? |
|
March 10, 2015, 06:15 |
|
#2 |
Member
Peter
Join Date: Sep 2011
Location: Germany
Posts: 39
Rep Power: 15 |
Do the .csv files contain the complete displaced mesh or just the specified displacement Parameter (so x/y/z components ,based on the previous or initial mesh) ?
For the latter it should be possible to set up a JunctionBox, reading the displacement Parameter from the csv and with an additional UserFunction define the displacement Parameter (never done it that way, just a guess ) |
|
March 10, 2015, 06:19 |
|
#3 |
Senior Member
Lance
Join Date: Mar 2009
Posts: 669
Rep Power: 22 |
The .csv files contain the mesh displacement per time step, i.e. displacement relative to previous mesh position.
That is just what I want, however my fortran skills are a bit limited. I would love to see an example on how to set it up. |
|
March 10, 2015, 06:44 |
|
#4 |
Member
Peter
Join Date: Sep 2011
Location: Germany
Posts: 39
Rep Power: 15 |
Ok lets have a look, in principle you need three routines/functions:
1. JunctionBox Routine (Location: Start of Time Step) Is reading your .csv file and save the variables 2. User CEL Function Read the variables at the position specified above 3. User Function (Argument [s]/ result unit [m]) Lets say this function is named setX you should be able to set the x-displacement with an Expression setX(t) Have a look at the Junction Box examples on how to access time/time step etc. (CALL USER_GET_TRANS_INFO) To read the csv you need some basic fortran skills (OPEN(UNIT=15, file='file.csv',status='old', action='read',) The variables are stored with POKER and accessed with PEEKR Just use the examples of the Tutorial and adapt them to your needs. What remains is a lot trial and error - have fun... |
|
March 10, 2015, 06:55 |
|
#5 |
Senior Member
Lance
Join Date: Mar 2009
Posts: 669
Rep Power: 22 |
Many thanks for the suggestions - I will certainly look into it. I spent a couple of weeks to get another fortran routine to work, so I know that it can be done, but I just wanted to check if someone else already had a working example. It is a bit strange that Ansys didnt have one.
|
|
March 10, 2015, 08:05 |
|
#6 |
Member
Peter
Join Date: Sep 2011
Location: Germany
Posts: 39
Rep Power: 15 |
As I mentioned I never did it for mesh motion but as long as a time dependent variable is accepted for the specified displacement I see no reason why this shouldn't work
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[snappyHexMesh] No layers in a small gap | bobburnquist | OpenFOAM Meshing & Mesh Conversion | 6 | August 26, 2015 10:38 |
Update of the variables after dynamic mesh motion. | gtg258f | OpenFOAM Programming & Development | 9 | January 18, 2014 11:08 |
[ICEM] Generating Mesh for STL Car in Windtunnel Simulation | tommymoose | ANSYS Meshing & Geometry | 48 | April 15, 2013 05:24 |
very fragile mesh motion on SnappyHexMesh generated mesh | matteoL | OpenFOAM Running, Solving & CFD | 0 | April 14, 2012 14:51 |
How to control Minximum mesh space? | hung | FLUENT | 7 | April 18, 2005 10:38 |