CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   CFX (https://www.cfd-online.com/Forums/cfx/)
-   -   Remeshing for Rotation in CFX via ICEMCFD (https://www.cfd-online.com/Forums/cfx/192386-remeshing-rotation-cfx-via-icemcfd.html)

gera September 2, 2017 11:37

Remeshing for Rotation in CFX via ICEMCFD
 
Dear All,
Could anyone please help me to make remeshing for rotation in ANSYS CFX through ICEMCFD.
I know how to do it for linear motion, but I would like to understand how to do remeshing for rotation. In order to do linear motion of a body with remeshing I use two scripts:

1st script looks like this:
Code:

set MeshFile {*.mesh}
set MeshReplayFile {*.rpl}
set ICEMCFDInst {C:/Program Files/ANSYS Inc/v145/icemcfd/win64_amd}
set ResFile {*/res}
set GeomFile {*.tin}
set ScalarParam(ICEM\ CFD\ Geometry\ Scale) 1.00000000e+000
set GeomCtrlFile {*/icemcfd_GeomCtrl.rpl}
set Displacement(INTER_CUBE) {0.430043637752533 0.430043637752533 0.430043548345566}


The last two lines are the most important:
“set GeomCtrlFile {*/icemcfd_GeomCtrl.rpl}” shows path to the rpl-script for ICEM CFD.
“set Displacement(INTER_CUBE) {0.430043637752533 0.430043637752533 0.430043548345566}” says that we need to do displacement.
Question #1: how to change command “Displacement” to rotation? Do I need just to write “Rotation”? For rotation, it is necessary to define axis and rotation origin.

Script “icemcfd_GeomCtrl.rpl” looks like this:
Code:

# ICEM CFD geometry update script

# Set geometry scaling factor based on Scalar Parameter
if [info exists ScalarParam(ICEM\ CFD\ Geometry\ Scale)] {
  set geoscale $ScalarParam(ICEM\ CFD\ Geometry\ Scale);
} else {
  set geoscale 1.0;
}
mess "Geometry scale for ICEM CFD: $geoscale \n";

# Loop over all moving parts
foreach part [array names Displacement] {
  for {set i 0} {$i < 3} {incr i} {set disp($i) [expr [lindex $Displacement($part) $i] / $geoscale ]};
  mess "Motion displacements for part $part: $disp(0) $disp(1) $disp(2) \n";
  set offset(0) 0;
  set offset(1) 0;
  set offset(2) 0;
  if { [info exists ScalarParam(OFFSET\ X\ $part)] } {set offset(0) [expr $ScalarParam(OFFSET\ X\ $part) / $geoscale ]};
  if { [info exists ScalarParam(OFFSET\ Y\ $part)] } {set offset(1) [expr $ScalarParam(OFFSET\ Y\ $part) / $geoscale ]};
  if { [info exists ScalarParam(OFFSET\ Z\ $part)] } {set offset(2) [expr $ScalarParam(OFFSET\ Z\ $part) / $geoscale ]};
  mess "Motion offsets for part $part: $offset(0) $offset(1) $offset(2) \n";
  set disp(0) [expr $disp(0) + $offset(0)];
  set disp(1) [expr $disp(1) + $offset(1)];
  set disp(2) [expr $disp(2) + $offset(2)];
  mess "Move part $part: $disp(0) $disp(1) $disp(2) \n";
  set item [ic_geo_get_objects surface $part ];
  if {[llength $item] > 0} {
    ic_move_geometry surface names $item translate "$disp(0) $disp(1) $disp(2)";
    mess "Part $part: move surfaces\n"};
  set item [ic_geo_get_objects curve $part ];
  if {[llength $item] > 0} {
    ic_move_geometry curve names $item translate "$disp(0) $disp(1) $disp(2)";
    mess "Part $part: move curves\n"};
  set item [ic_geo_get_objects point $part ];
  if {[llength $item] > 0} {
    ic_move_geometry point names $item translate "$disp(0) $disp(1) $disp(2)";
    mess "Part $part: move points\n"};
  set item [ic_geo_get_objects body $part ];
  if {[llength $item] > 0} {
    ic_move_geometry body names $item translate "$disp(0) $disp(1) $disp(2)";
    mess "Part $part: move bodies\n"};
}

As you can see there is the command “displacement”.
Question #2: What should I write in order to make rotation?

As a result of all actions, I should have a body that rotates. At each time step, mesh must be reconstructed automatically (remeshing). Sliding interfaces should not be considered.

Any other options to make rotation are also welcome.


Thank you!

JuPa September 2, 2017 13:55

Isn't it just the same problem, only instead of linear displacement you have circumferential displacement described in two axis by something like:

x=-sin(omega*t)
y=cos(omega*t)

Where omega is your rotational speed and t is simulation time.

Lance September 4, 2017 01:01

Quote:

Originally Posted by gera (Post 662911)
Could anyone please help me to make remeshing for rotation in ANSYS CFX through ICEMCFD. I know how to do it for linear motion [...]

What you are describing looks like ICEM Replay Resmeshing and it only works for translation and not rotation (according to the manual). I would consider going for User Defined Remeshing instead. A bit more scripting, but way more flexible. See the reference guide.

gera September 23, 2017 12:29

Dear JuPa,
thank you for your answer. I also thought in this way. However, it was necessary to change the command "displacement" or to apply it for each cell, which is a separate domain.

Dear Lance,
thank you for the answer. User Defined Remeshing looks good alternative (the only one).


All times are GMT -4. The time now is 05:10.