[overture] Re: shock and colliding bodies

Hi Yongliang,
Here is an example with collisions that works for me.

Your basic problem was that you had incorrectly
specified the centre of mass for both annulii to be in the same place and the
detection algorithm got confused. If you don't specify the centre of mass, the
code will figure it out, assuming a uniform density of the solid.

Note that currently collisions only work for an annulus (and sphere?).

I cleaned up your grid a bit so the grid spacings match better. There is also
an option to specify the distance between bodies when a collision
is deemed to occur. For overlapping grids one needs to allow a couple of
grid spaces.

Regards,

Bill



On 07/19/2012 09:03 PM, 马永亮 wrote:
> Hi Bill
>  Thank you for your  timely response.
>  Now, I want to know whether this feature “detect collisions” is
> available in a compressible fluid.
>  If yes,What's my problem about those errors?
>  Could give me a simple example like "Shock hitting some rigid bodies"?
>
> Regards,
> Ma Yongliang
>
>
>
> ------------------ Original ------------------
> From:  "henshaw"<henshaw@xxxxxxxx>;
> Date:  Fri, Jul 20, 2012 11:30 AM
> To:  "overture"<overture@xxxxxxxxxxxxx>;
> Subject:  [overture] Re: shock sample scripts
>
> Hi Yongliang
>    What you tried to should work. I will need to rerun some cases
> to see if they still work for me.
>    What will not work is some of the newer FSI capabilities, i.e.
> running cgmp, since these will not appear until the next version.
>
> ...Bill
>
>
> On 07/19/2012 04:30 PM, 永亮 wrote:
> Hi Bill,
> Why those examples are not going to work with the v24 version? Could
> you tell me which version is workable for them?
> I try to write a  similar sample base on the example
> cg.v24/cns/cmd/cicShockMove.cmd,just add an annulus.However,when the
> two annuluses collide (has turn on detect collisions ), the program
> prompts that:
> lastChanceInterpolation:ERROR: unable to get proper interpolation for
> pt on grid=1 (transform[grid=1]), (i1,i2,i3)=(0,1,0)
> lastChanceInterpolation:ERROR: unable to get proper interpolation for
> pt on grid=1 (transform[grid=1]), (i1,i2,i3)=(1,1,0)
> lastChanceInterpolation:ERROR: unable to get proper interpolation for
> pt on grid=1 (transform[grid=1]), (i1,i2,i3)=(58,1,0)
> lastChanceInterpolation:ERROR: unable to get proper interpolation for
> pt on grid=2 (transform[grid=2]), (i1,i2,i3)=(38,1,0)
> lastChanceInterpolation:ERROR: unable to get proper interpolation for
> pt on grid=2 (transform[grid=2]), (i1,i2,i3)=(39,1,0)
> lastChanceInterpolation:ERROR: unable to get proper interpolation for
> pt on grid=2 (transform[grid=2]), (i1,i2,i3)=(40,1,0)
> lastChanceInterpolation:ERROR: unable to get proper interpolation for
> pt on grid=2 (transform[grid=2]), (i1,i2,i3)=(41,1,0)
> lastChanceInterp: grid=2 (transform[grid=2]) pt (38,2,0) reduced
> interp width to 1 from grid2=1 (transform[grid=1])
> lastChanceInterp: grid=2 (transform[grid=2]) pt (41,2,0) reduced
> interp width to 1 from grid2=1 (transform[grid=1])
> ====================================================================================
>  The overlap algorithm failed. numberOfErrors=7 Check the file
> ogen.log for more info
>    There were 7 `orphan points' that could not be interpolated
> ====================================================================================
> I have try to increase the number of grid points,but the problem still
> exists. Why the "detect collisions" don't work? Can you give me some
> suggestions?
>
> Regards,
> Ma Yongliang
>
>
>
> ------------------ Original ------------------
> From:  "henshaw"<henshaw@xxxxxxxx>;
> Date:  Sat, Jul 14, 2012 07:34 AM
> To:  "overture"<overture@xxxxxxxxxxxxx>;
> Subject:  [overture] Re: shock sample scripts
>
> Hi Yongliang,
>   Those examples in cse11.pdf (now found our JCP paper) are not going to work
> with the v24 version. There is a simpler example that may work in
> cg/mp/cmd/shockCyl.cmd,
> using Overture/sampleGrids/diskDeform.cmd to generate the grid.
>
> Regards,
>   Bill
>
>
> On 07/13/2012 12:54 AM, 永亮 wrote:
> Hello All,
> The two samples "Shock hitting some rigid bodies" and "Mach 2 shock in
> a gas hitting two elastic cylinders"  in the  file of "cse11.pdf" are
> very impressive for me. But I can't find the scripts in the software
> package.. Anyone can send them to me or tell me where to download
> them?
>
> Regards,
> Ma Yongliang
>

#==============================================================
# cgcns example: shock hitting a moving cylinder (with AMR)
#
# Examples:
#     cgcns cicShockMove -g=cice2.order2
#     cgcns cicShockMove -g=cice2.order2 -amr=1
#    
# Parallel:
#   mpirun -np 1 $cgcnsp cicShockMove -g=cic2e -fullGridGenFreq=1
#   mpirun -np 1 $cgcnsp cicShockMove -g=cice1.order2 -fullGridGenFreq=1
#   mpirun -np 1 $cgcnsp cicShockMove -g=cice2.order2 -fullGridGenFreq=1
#   totalview srun -a -N1 -n1 -ppdebug $cgcnsp cicShockMove -g=cice2.order2 
-fullGridGenFreq=1
#   srun -N1 -n2 -ppdebug $cgcnsp cicShockMove -g=cice2.order2 
-fullGridGenFreq=1
#   srun -N1 -n4 -ppdebug $cgcnsp cicShockMove -g=cice4.order2 
-fullGridGenFreq=1 
#=============================================================
#
# --- set default values for parameters ---
# 
$cnsVariation="godunov"; $ts="pc"; $show=" ";
$grid="cic2a.hdf"; $backGround="backGround"; $bcn="slipWall"; $uInflow=.1; 
$mg="square"; $mt="shift"; $vg0=0.; $vg1=0.; $vg2=0.; $fullGridGenFreq=10;
$tFinal=120.5; $tPlot=.05; $cfl=.9; $mu=.0; $Prandtl=.72; 
$thermalExpansivity=.1; 
$noplot=""; $debug = 0;  
$tz = "none"; $degreex=2; $degreet=2; $fx=1.; $fy=1.; $fz=1.; $ft=1.; 
$dtMax=.5; 
$order = 2; $fullSystem=0; $go="halt"; 
$ad2=0; $ad22=2.; 
$amr=0;
# 
#
# ----------------------------- get command line arguments 
---------------------------------------
GetOptions( "g=s"=>\$grid,"tf=f"=>\$tFinal,"degreex=i"=>\$degreex, 
"degreet=i"=>\$degreet, "cnsVariation=s"=>\$cnsVariation,\
 "tp=f"=>\$tPlot, "tz=s"=>\$tz, 
"show=s"=>\$show,"order=i"=>\$order,"debug=i"=>\$debug, \
 "nu=f"=>\$nu,"cfl=f"=>\$cfl, "bg=s"=>\$backGround, 
"go=s"=>\$go,"fullGridGenFreq=i"=>\$fullGridGenFreq,\
 
"noplot=s"=>\$noplot,"dtMax=f"=>\$dtMax,"bcn=s"=>\$bcn,"vg0=f"=>\$vg0,"vg1=f"=>\$vg1,"vg2=f"=>\$vg2,\
 
"dtMax=f"=>\$dtMax,"bc=s"=>\$bc,"mg=s"=>\$mg,"mt=s"=>\$mt,"ts=s"=>\$ts,"amr=i"=>\$amr
 );
# 
-------------------------------------------------------------------------------------------------
$kThermal=$mu/$Prandtl;   # check this 
if( $amr eq 1 ){ $amr="turn on adaptive grids"; }else{ $amr="turn off adaptive 
grids"; }
if( $solver eq "best" ){ $solver="choose best iterative solver"; }
if( $tz eq "none" ){ $tz="turn off twilight zone"; }
if( $tz eq "poly" ){ $tz="turn on twilight zone\n turn on polynomial"; $cdv=0.; 
}
if( $tz eq "trig" ){ $tz="turn on twilight zone\n turn on trigonometric"; 
$cdv=0.; }
if( $order eq "2" ){ $order = "second order accurate"; }else{ $order = "fourth 
order accurate"; }
if( $cnsVariation eq "godunov" ){ $cnsVariation="compressible Navier Stokes 
(Godunov)"; $ts="fe"; }
if( $cnsVariation eq "jameson" ){ $cnsVariation="compressible Navier Stokes 
(Jameson)"; }  
if( $cnsVariation eq "nonconservative" ){ $cnsVariation="compressible Navier 
Stokes (non-conservative)"; } 
if( $ts eq "fe" ){ $ts="forward Euler"; }
if( $ts eq "be" ){ $ts="backward Euler"; }
if( $ts eq "im" ){ $ts="implicit"; }
if( $ts eq "pc" ){ $ts="adams PC"; }
# 
if( $go eq "halt" ){ $go = "break"; }
if( $go eq "og" ){ $go = "open graphics"; }
if( $go eq "run" || $go eq "go" ){ $go = "movie mode\n finish"; }
#
# specify the overlapping grid to use:
$grid
  $cnsVariation
  done
# -- time stepping method:
  $ts
# 
  turn off twilight
*
*  do not use iterative implicit interpolation
*
  final time $tFinal
  times to plot $tPlot
*
  show file options
    compressed
    open
      $show
    frequency to flush
      1
    exit
  * no plotting
****
* turn on user defined output
*****************************
* ---
 frequency for full grid gen update $fullGridGenFreq
# 
* There can be trouble if the grid moves too fast
  turn on moving grids
  detect collisions 1
  # wdh: 
  # specify minimum separation (grid lines) before collisions are detected: 
  minimum separation for collisions 3.
  #
  specify grids to move
      rigid body
        mass
          .5 .25  .05    50
        moments of inertia
          1.
        # initial centre of mass
        #    0. 0.
        done
        annulus1
       done
           rigid body
        mass
          1.  .25  .05    50
        moments of inertia
          1.
        # initial centre of mass
        #    0. 0.
        done
        annulus2
       done
  done
***************************
  reduce interpolation width
    2
*****
  $amr
  order of AMR interpolation
      2
  error threshold
      .0005
  regrid frequency
     8 4  8
  change error estimator parameters
    set scale factors
      1 10000 10000 10000 10000
    done
    weight for first difference
    0.
    weight for second difference
    .03
    exit
    truncation error coefficient
    1.
    show amr error function
  change adaptive grid parameters
    refinement ratio
      2 4 2 4
    default number of refinement levels
      2 3 2
    number of buffer zones
      2
    grid efficiency
      .7
  exit
*****
  boundary conditions
    all=slipWall
    square(0,0)=superSonicInflow uniform(r=2.6069,T=.943011,u=0.694444,v=0.)
    done
*
  pde parameters
    mu
     0.0
    kThermal
     0.0
    heat release
      0.
    rate constant
      0.
   reciprocal activation energy
     1.
  done
***************
*  cfl
*   .5 
*    .95
*   OBPDE:exact Riemann solver
* OBPDE:Roe Riemann solver
* OBPDE:HLL Riemann solver
*   OBPDE:Godunov order of accuracy 2
******************
*  debug
*    1
*
  initial conditions
    step function
    x=-1.
    T=.943011, u=.694444, v=0., r=2.6069
    T=.714286, u=0., v=0., r=1.4
  continue
continue
*

movie mode
finish
*
* circle in a channel
*
$orderOfAccuracy = "second order"; $ng=2; $interpType = "explicit for all 
grids";
create mappings
*
rectangle
  set corners
    -1.5 1.5 -1. 1.
  lines
   #  141 141 
    91 71 
  boundary conditions
    1 1 1 1
  mappingName
  square
exit
*
annulus
 inner and outer radii
   0.2 0.4
 lines
#   60 12
   60 9 
 centre for annulus
   -0.6 .0
 boundary conditions
 -1 -1 1 0
 mappingName
 annulus1
 exit
*
 annulus
 inner and outer radii
    .25 0.5 
 lines
   # 80 16
   80 11
 centre for annulus
   0. .0
 boundary conditions
   -1 -1 1 0
 mappingName
 annulus2
 exit
*
exit
generate an overlapping grid
    square
    annulus1
    annulus2
  done
* 
  change parameters
 # choose implicit or explicit interpolation
    interpolation type
      $interpType
    order of accuracy 
      $orderOfAccuracy
    ghost points
      all
      $ngp = $ng+1;
      $ng $ng $ng $ngp $ng $ng
  exit
*   display intermediate results
  compute overlap
 display computed geometry
  exit
*
* save an overlapping grid
save a grid (compressed)
cic2a.hdf
cic2a
exit

Other related posts: