

  head 2 "Test of different wheel/rail couplings  func wr_coupl_pe2"
  head 3 "axl_111 pure long.creep; axl_112 pure lat.creep; axl_113 pure spin"
  head 4 "Cylindric wheel profile  mu= $mu_"

##
## Analyse specific input data
##
  idebug= 1                                       # Dump memory to file
  idebug_file= out/pure_creep_pe2.out                 # File where memory dump will be written

  fresp_param= Fourier_CG1  1.e-4  fstart .2   fstop 20.  fstep -1.05
  modal_param= Schur_fact1  1.e-4
  quasi_param= Damped_Tens  1.e-4 0.1   20    2.
# tsim_param = heun_c            tstart 0.  tstop= 3.00  tstep 0.0001 tout= .001
  tsim_param = heun                tstart= 0.  tstop= 3.00  tstep= 2e-5    tout= .001

##
##  Track irregularities and designed track geometry
##
  func    intpl_r   lat_trac      -200    0.   100    0.
  func    intpl_r   spv_trac      -200 1435.   100 1435.
  func    intpl_r   vert_trac     -200    0.   100    0.
  func    intpl_r   fi_trac       -200    0.   100    0.

  func    intpl_r   krok_R  -200 0   100 0
  func    intpl_r   krok_h  -200 0   100 0
  func    intpl_r   krok_z  -200 0   100 0

##
##  Wheel-rail geometry
##
# insert file $genkpf/kona_0.000_uf.kpfr
# in_substruct kpf_kona_0.000 [ 1 ]    # Same wheel-rail geometry in all wheels vehicle #1
#
  insert file $genkpf/kpf_rkona_cp1.kpfr
  in_substruct kpf_rkona_cp1 [ 1   0.  ]    # Same wheel-rail geometry in all wheels vehicle #1
  in_substruct kpf_rkona_cp1 [ 114 0.1 ]    # Pure conical profile wheelset 114

##
##  Define constants for the wheel-rail-coupling substructure wr_coupl
##
  func  const_block
   Vo     = 10.     # Speed of the vehicles
   mu_    = 0.5     # Friction coefficient, all wheels in the train
   ro_    = 0.45    # Wheel radius, all wheels in the train
   bo_    = 0.75    # Semi distance between the wheel profile origins, all wheels in the train
   ma_    =   1887  # Mass of wheelset
   ma_114 = 5*1887  # Mass of wheelset 114
   Jka_   =    100  # Moment of inertia in pitch, wheelset
   Jka_114=  5*100  # Moment of inertia in pitch, wheelset 114

   YMtrac= 1e-3         # From mm to m;   Scale factor 1.00; Lateral irregularities
   ZMtrac= 1e-3         # From mm to m;   Scale factor 1.00; Vertical irregularities
   GMtrac= 1e-3         # From mm to m;   Scale factor 1.00; Gauge irregularities
   CMtrac= 1e-3/(2*bo_) # From mm to rad; Scale factor 1.00; Cant irregularities

   gauge_average= 1435.    # Average gauge of the track
   gauge_dev_   = 0.000    # Deviation in gauge
  end_block

##
##  Create the wheelsets.
##  ---------------------
  lsys   e_abs_bendrf  esys  Vo  0.  krok_R krok_h krok_z
                                     4 4    4 4    4 4
  substruct create_axles [                                                              
   lsys  l_local      lsa_$1  esys      0. 0. 0.                                        
   mass  m_rigid_6    axl_$1  lsa_$1    0. 0. -ro_$1  ma_$1 ma_$1 ma_$1  720 Jka_$1 720 
   mass  m_rigid_6    trc_$1  lsa_$1    0. 0. 0.      1.e3 1.e3 1.e3  1.e3 1.e3 1.e3    
   mass  fixpoint_6   grd_$1  lsa_$1    0. 0. 0.                                        
#  body  w_set_lsys   axl_$1  lsa_$1    ro_$1 bo_                                       
   body  whe_set_mass axl_$1            ro_$1 bo_                                       
   body  figure_lsys  trc_$1  lsa_$1    1 5        .5  1 0   .5 -1 0                    
                                                  -.5 -1 0  -.5  1 0  .5 1 0            
#
   constr fix_rigid_1  axl_$1  x   0.                                                   
   constr fix_rigid_1  axl_$1  y   0.                                                   
   constr fix_rigid_1  axl_$1  f   0.                                                   
   constr fix_rigid_1  axl_$1  p   0.                                                   
#                                                                                       
   constr fix_rigid_1  trc_$1  x   0.   constr fix_rigid_1  trc_$1  f   0.              
   constr fix_rigid_1  trc_$1  y   0.   constr fix_rigid_1  trc_$1  k   0.              
   constr fix_rigid_1  trc_$1  z   0.   constr fix_rigid_1  trc_$1  p   0.              
#                                                                                       
   force rel_mass1 vload_$1  axl_$1  0. 0. -ro_$1  0. 0. 200e3-ma_$1*9.81  0. 0. 0.     
#                                                                                       
   coupl c czag$1l  axl_$1 0. -bo_ -ro_$1  grd_$1 0. -bo_ -ro_$1  .7*600e6/pi/4 esys z  
   coupl c czag$1r  axl_$1 0.  bo_ -ro_$1  grd_$1 0.  bo_ -ro_$1  .7*600e6/pi/4 esys z  
  ]
#
  in_substruct create_axles [ 111 ]
  in_substruct create_axles [ 112 ]
  in_substruct create_axles [ 113 ]
  in_substruct create_axles [ 114 ]
#
  s_var force_on axl_114 z
  mass  fixpoint_6   car_1    lsa_111   0. 0. 0.

##
##  Define pure creepage on the three different axles
##  -------------------------------------------------
  constr fix_rigid_1 axl_111 k=  0.
  no_warning func operp axl_111.vk= time * 0.25

  constr fix_free_1 axl_112.k =   0.
  no_warning func operp axl_112.p= time * -.1

  constr fix_rigid_1 axl_113 k=   0.
  no_warning func operp axl_113.vp=  16 * time
  no_warning func operp axl_113.vx=  12 * time

##
##        Calculation of creep and creepforces between wheels and rails
##        ================================================================
#
   func const knwr.F0_= 100e3 # all wheels
#
   func  intpl_r knwr_      # Stiffness Tread-Rail all wheels
   -1.57     600e6
    0.       600e6
    1.57     600e6
   func  intpl_r knfr_      # Stiffness Flange-Rail all wheels
   -1.57     600e6
    0.       600e6
    1.57     600e6
   func const_block
    pknwr   = 1             # Linjär styvhet i kontaktpunkten
    kyrt_   =  42e6*100.
    kzrt_   = 180e6*100.
    kzrt.F0_= knwr.F0_
    cyrt_   = 205e3*10#31.6
    czrt_   = 250e3*10#31.6
   end_block


  substruct wr_coupl [    # $1=car #, $2=axle #
  func wr_coupl_pe2
#
       $2                                       # Name/number of the wheelset
       $1                                       # Name/number of the vehicle
#
#      lat_trac  vert_trac  spv_trac  fi_trac   # Track irregularities memory fields
#      YMtrac    ZMtrac     GMtrac    CMtrac    # Multiplication factors for track irregularities
#      gauge_average                            # Average gauge of spv_trac
#      gauge_dev_$1                             # Modify average gauge for a different conicity
#      1                                        # Type of contact normal to the contact surface
#
#      axl_$1                                   # Body wheel right side
#      axl_$1                                   # Body wheel left side
#      trc_$1                                   # Body track right side
#      trc_$1                                   # Body track left side
#      ro_$1r                                   # Nominal wheel radius right wheel
#      17e6                      # kyrt_$1r     # Lateral stiffness rail - track
#      kzrt_$1r                  # kzcr_$1r     # Vertical stiffness rail - track
#      kzrtF0_$1r                # kzcrF0_$1r   # Vertical prestress force rail - track
#       10e3                     # cyrt_$1r     # Lateral damping rail - track
#       50e3                     # czrt_$1r     # Vertical damping rail - track
#      bo_$1r                                   # Lateral semi-distance to nominal running circle, right side
#      ro_$1l                                   # Nominal wheel radius left wheel
#      17e6                      # kyrt_$1l     # Lateral stiffness rail - track
#      kzrt_$1l                  # kzcr_$1l     # Vertical stiffness rail - track
#      kzrtF0_$1l                # kzcrF0_$1l   # Vertical prestress force rail - track
#       10e3                     # cyrt_$1r     # Lateral damping rail - track
#       50e3                     # czrt_$1r     # Vertical damping rail - track
#     -bo_$1l                                   # Lateral semi-distance to nominal running circle, left side
#
       cpt_$2r                                          # Name of contact point #1 right side
       trc_$2  cpt_$2r.ksi cpt_$2r.bo  0.               # Contact on track
       axl_$2   0.         cpt_$2r.bo  0.               # Contact on wheel/wheelset
       0.                  fzwrnr$2                     # Normal force
       cpt_$2r.gam cpt_$2r.nux  cpt_$2r.nuy  cpt_$2r.spin # Contact angle and creepages
       cpt_$2r.irx cpt_$2r.iry                          # Long. and lat. curvatures in contact point
       mu_$2r1                                          # Coefficient of friction
#      mu_$2r1/.6   mu_$2r1/.6   mu_$2r1/.6             # Creepage reduction due to contaminated rail surface
       1            1            1                      # Creepage reduction due to contaminated rail surface
       2.05e11 .3   z                                   # Modulus of elasticity and Poisson's ratio
#
       cpt_$2l
       trc_$2  cpt_$2l.ksi cpt_$2l.bo  0.               # Contact on track
       axl_$2   0.         cpt_$2l.bo  0.               # Contact on wheel/wheelset
       0.          fzwrnl$2                                     # Normal force
       cpt_$2l.gam cpt_$2l.nux  cpt_$2l.nuy  cpt_$2l.spin       # Contact angle and creepages
       cpt_$2l.irx cpt_$2l.iry                                  # Long. and lat. curvatures in contact point
       mu_$2l1                                          # Coefficient of friction
#      mu_$2l1/.6   mu_$2l1/.6   mu_$2l1/.6             # Creepage reduction due to contaminated rail surface
       1            1            1                      # Creepage reduction due to contaminated rail surface
       2.05e11 .3   z                                   # Modulus of elasticity and Poisson's ratio
#
#
       cpf_$2r
       trc_$2  cpf_$2r.ksi cpf_$2r.bo  0.               # Contact on track
       axl_$2   0.         cpf_$2r.bo  0.               # Contact on wheel/wheelset
       0.          fzfrnr$2                                     # Normal force
       cpf_$2r.gam cpf_$2r.nux  cpf_$2r.nuy  cpf_$2r.spin       # Contact angle and creepages
       cpf_$2r.irx cpf_$2r.iry                                  # Long. and lat. curvatures in contact point
       mu_$2r2                                          # Coefficient of friction
#      mu_$2r2/.6   mu_$2r2/.6   mu_$2r2/.6             # Creepage reduction due to contaminated rail surface
       1            1            1                      # Creepage reduction due to contaminated rail surface
       2.05e11 .3   z                                   # Modulus of elasticity and Poisson's ratio
#
       cpf_$2l
       trc_$2  cpf_$2l.ksi cpf_$2l.bo  0.               # Contact on track
       axl_$2   0.         cpf_$2l.bo  0.               # Contact on wheel/wheelset
       0.          fzfrnl$2                                     # Normal force
       cpf_$2l.gam cpf_$2l.nux  cpf_$2l.nuy  cpf_$2l.spin       # Contact angle and creepages
       cpf_$2l.irx cpf_$2l.iry                                  # Long. and lat. curvatures in contact point
       mu_$2l2                                          # Coefficient of friction
#      mu_$2l2/.6   mu_$2l2/.6   mu_$2l2/.6             # Creepage reduction due to contaminated rail surface
       1            1            1                      # Creepage reduction due to contaminated rail surface
       2.05e11 .3   z                                   # Modulus of elasticity and Poisson's ratio
 ]
# insert file $gensys/calc/insert_files/wr_coupl_pe1.ins
  in_substruct wr_coupl [ 1 111 ]
  in_substruct wr_coupl [ 1 112 ]
  in_substruct wr_coupl [ 1 113 ]

##
##  Store variables for postprocessing
##  ----------------------------------
#
  func print06_init  cpt_111r.a_b  # Print the initial value of a variable to standard output
#
  s_var scalar_0 mu_
#
  s_var sngl ro_
  s_var sngl bo_
  s_var sngl Vo
#
  s_var var_0 esys.x
  s_var var_0 esys.y
  s_var var_0 esys.z
  s_var var_0 esys.f
  s_var var_0 esys.k
  s_var var_0 esys.p
#
  s_var var_0 esys.vx
  s_var var_0 esys.vy
  s_var var_0 esys.vz
  s_var var_0 esys.vf
  s_var var_0 esys.vk
  s_var var_0 esys.vp
#
  s_var var_0 esys.ax
  s_var var_0 esys.ay
  s_var var_0 esys.az
  s_var var_0 esys.af
  s_var var_0 esys.ak
  s_var var_0 esys.ap
#
  substruct store_axle [
   s_var var_0 axl_$1.x
   s_var var_0 axl_$1.y
   s_var var_0 axl_$1.z
   s_var var_0 axl_$1.f
   s_var var_0 axl_$1.k
   s_var var_0 axl_$1.p
#
   s_var var_0 axl_$1.vx
   s_var var_0 axl_$1.vy
   s_var var_0 axl_$1.vz
   s_var var_0 axl_$1.vf
   s_var var_0 axl_$1.vk
   s_var var_0 axl_$1.vp
#
   s_var var_0 axl_$1.Fx
   s_var var_0 axl_$1.Fy
   s_var var_0 axl_$1.Fz
   s_var var_0 axl_$1.Mf
   s_var var_0 axl_$1.Mk
   s_var var_0 axl_$1.Mp
#
   s_var var_0 axl_$1.Ax
   s_var var_0 axl_$1.Ay
   s_var var_0 axl_$1.Az
   s_var var_0 axl_$1.Af
   s_var var_0 axl_$1.Ak
   s_var var_0 axl_$1.Ap
#
  s_var var_0 trc_$1.x     s_var var_0 trc_$1.y     s_var var_0 trc_$1.z
  s_var var_0 trc_$1.f     s_var var_0 trc_$1.k     s_var var_0 trc_$1.p
  s_var var_0 trc_$1.vx    s_var var_0 trc_$1.vy    s_var var_0 trc_$1.vz
  s_var var_0 trc_$1.vf    s_var var_0 trc_$1.vk    s_var var_0 trc_$1.vp
  ]
#
  substruct store_wheel [
   s_var var_0 ral_$1.y
   s_var var_0 ral_$1.z
   s_var var_0 ral_$1.vy
   s_var var_0 ral_$1.vz
#
   s_var var_0 cp_$1.eta
#
   s_var var_0 tral$1.y
   s_var var_0 tral$1.z
   s_var var_0 tral$1.vy
   s_var var_0 tral$1.vz

   s_var var_0 cpt_$1.z
   s_var var_0 cpt_$1.dr
   s_var var_0 cpt_$1.gam
   s_var var_0 cpt_$1.c
   s_var var_0 cpt_$1.a_b
   s_var var_0 cpt_$1.posw
   s_var var_0 cpt_$1.bo_
#
   s_var var_0 cpt_$1.nux
   s_var var_0 cpt_$1.nuy
   s_var var_0 cpt_$1.spin
#
   s_var var_0 cpt_$1.vux
   s_var var_0 cpt_$1.vuy
   s_var var_0 cpt_$1.vuz
   s_var var_0 cpt_$1.Vref
#
   s_var var_0 cpt_$1.Fn
   s_var var_0 cpt_$1.Fny
   s_var var_0 cpt_$1.Fx
   s_var var_0 cpt_$1.Fy
   s_var var_0 cpt_$1.Fz
   s_var var_0 cpt_$1.F1x
   s_var var_0 cpt_$1.F1y
   s_var var_0 cpt_$1.F1z
   s_var var_0 cpt_$1.F2x
   s_var var_0 cpt_$1.F2y
   s_var var_0 cpt_$1.F2z
   s_var var_0 cpt_$1.M1f
   s_var var_0 cpt_$1.M1k
   s_var var_0 cpt_$1.M1p
   s_var var_0 cpt_$1.M2f
   s_var var_0 cpt_$1.M2k
   s_var var_0 cpt_$1.M2p
#
   s_var var_0 cpt_$1.fwk
   s_var var_0 cpt_$1.wArchH
   s_var var_0 cpt_$1.wArchS
  ]
  in_substruct store_axle  [ 111  ]
  in_substruct store_axle  [ 112  ]
  in_substruct store_axle  [ 113  ]
  in_substruct store_wheel [ 111r ]
  in_substruct store_wheel [ 112r ]
  in_substruct store_wheel [ 113r ]
  in_substruct store_wheel [ 111l ]
  in_substruct store_wheel [ 112l ]
  in_substruct store_wheel [ 113l ]
#
# in_substruct store [ 111l ]
# in_substruct store [ 112l ]
# in_substruct store [ 113l ]
#
 eof
