CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > CFX

Mesh motion with several .csv files

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 10, 2015, 04:46
Default Mesh motion with several .csv files
  #1
Senior Member
 
Lance
Join Date: Mar 2009
Posts: 669
Rep Power: 22
Lance is on a distinguished road
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?
Lance is offline   Reply With Quote

Old   March 10, 2015, 06:15
Default
  #2
Member
 
Peter
Join Date: Sep 2011
Location: Germany
Posts: 39
Rep Power: 15
PeMo is on a distinguished road
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 )
PeMo is offline   Reply With Quote

Old   March 10, 2015, 06:19
Default
  #3
Senior Member
 
Lance
Join Date: Mar 2009
Posts: 669
Rep Power: 22
Lance is on a distinguished road
The .csv files contain the mesh displacement per time step, i.e. displacement relative to previous mesh position.

Quote:
Originally Posted by PeMo View Post
[...] 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
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.
Lance is offline   Reply With Quote

Old   March 10, 2015, 06:44
Default
  #4
Member
 
Peter
Join Date: Sep 2011
Location: Germany
Posts: 39
Rep Power: 15
PeMo is on a distinguished road
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...
PeMo is offline   Reply With Quote

Old   March 10, 2015, 06:55
Default
  #5
Senior Member
 
Lance
Join Date: Mar 2009
Posts: 669
Rep Power: 22
Lance is on a distinguished road
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.
Lance is offline   Reply With Quote

Old   March 10, 2015, 08:05
Default
  #6
Member
 
Peter
Join Date: Sep 2011
Location: Germany
Posts: 39
Rep Power: 15
PeMo is on a distinguished road
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
PeMo is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 14:20.