

  head 2 "Test of different wheel/rail couplings  func wr_coupl_pe0"
  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_pe0_stop.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 .0001 .1e-3  tstart 0.  tstop  3.00  tstep 0.0001 tout .005
# tsim_param = heun                tstart 0.  tstop  2.50  tstep .1e-5  tout .0001
  tsim_param = heun_c .00001 .1e-3  tstart 0.  tstop  2.50  tstep .1e-5  tout .001
  tstop= 0.750


##
##  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     =  .1      # 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_fix         esys  0. 0. 0.
  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 ]
#
  mass  fixpoint_6   car_1    lsa_111   0. 0. 0.

##
##  Apply a pitch torque moment
##  -------------------------------------------------
  func intpl_l       pitch_mom= time  0 0  1 5*100  9 5*100

  force rel_mass1 chi_torque   axl_111  0 0 -ro_111   0. 0.  0. 0.  2e2 0.
# force rel_mass1 chi_torque   axl_111  0 0 -ro_111   0. 0.  0. 0.  20 0.
 initval set_var       axl_111.vk= -Vo/ro_111
  s_var force_on  axl_111 x      # Store all forces acting on specified mass
  s_var force_on  axl_111 k      # Store all forces acting on specified mass
  s_var pos       664


##
##        Calculation of creep and creepforces between wheels and rails
##        ================================================================
#
  substruct wr_coupl [    # $1=axle #
   func wr_coupl_pe0
#
       $1                                       # Name/number of the wheelset
       lsa_$1                                   # Name of the linear local coordinate system
#
       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
#
#                                               # Right wheel:
       ro_$1r                                   # Nominal radius
       17e6                     # kyrt_$1r      # Lateral stiffness rail - track
       230e6                    # kzrt_$1r      # Vertical stiffness rail - track
       100e3                    # kzrtF0_$1r    # Vertical prestress force rail - track
        10e3                    # cyrt_$1r      # Lateral damping rail - track
        1e6     # 50e3          # czrt_$1r      # Vertical damping rail - track
       bo_$1r                                   # Lateral semi-distance to nominal running circle, right side
#
#                                               # Left wheel:
       ro_$1l                                   # Nominal radius
       17e6                     # kyrt_$1l      # Lateral stiffness rail - track
       230e6                    # kzrt_$1l      # Vertical stiffness rail - track
       100e3                    # kzrtF0_$1l    # Vertical prestress force rail - track
        10e3                    # cyrt_$1l      # Lateral damping rail - track
        1e6     # 50e3          # czrt_$1l      # Vertical damping rail - track
      -bo_$1l                                   # Lateral semi-distance to nominal running circle, left side
#
       cp1_$1r                                  # Name of contact point #1 right side
       trc_$1  cp1_$1r.ksi cp1_$1r.bo  0.       # Contact on track
       axl_$1   0.         cp1_$1r.bo  0.       # Contact on wheel/wheelset
       mu_$1r1                                  # Coefficient of friction
       2.05e11 .25                              # Modulus of elasticity and Poisson's ratio
       1 1 1                                    # Creepage reduction due to contaminated rail surface
       100e3                      600e6         # Prestress force and stiffness normal to the surface
#
       cp1_$1l
       trc_$1  cp1_$1l.ksi cp1_$1l.bo  0.       # Contact on track
       axl_$1   0.         cp1_$1l.bo  0.       # Contact on wheel/wheelset
       mu_$1l1                                  # Coefficient of friction
       2.05e11 .25                              # Modulus of elasticity and Poisson's ratio
       1 1 1                                    # Creepage reduction due to contaminated rail surface
       100e3                      600e6         # Prestress force and stiffness normal to the surface
#
#
       cp2_$1r
       trc_$1  cp2_$1r.ksi cp2_$1r.bo  0.       # Contact on track
       axl_$1   0.         cp2_$1r.bo  0.       # Contact on wheel/wheelset
       mu_$1r2                                  # Coefficient of friction
       2.05e11 .25                              # Modulus of elasticity and Poisson's ratio
       1 1 1                                    # Creepage reduction due to contaminated rail surface
       0.                         600e6         # Prestress force and stiffness normal to the surface
#
       cp2_$1l
       trc_$1  cp2_$1l.ksi cp2_$1l.bo  0.       # Contact on track
       axl_$1   0.         cp2_$1l.bo  0.       # Contact on wheel/wheelset
       mu_$1l2                                  # Coefficient of friction
       2.05e11 .25                              # Modulus of elasticity and Poisson's ratio
       1 1 1                                    # Creepage reduction due to contaminated rail surface
       0.                         600e6         # Prestress force and stiffness normal to the surface
#
#
       cp3_$1r
       trc_$1  cp3_$1r.ksi cp3_$1r.bo  0.       # Contact on track
       axl_$1   0.         cp3_$1r.bo  0.       # Contact on wheel/wheelset
       mu_$1r3                                  # Coefficient of friction
       2.05e11 .25                              # Modulus of elasticity and Poisson's ratio
       1 1 1                                    # Creepage reduction due to contaminated rail surface
       0.                         600e6         # Prestress force and stiffness normal to the surface
#
       cp3_$1l                                                                                          
       trc_$1  cp3_$1l.ksi cp3_$1l.bo  0.       # Contact on track                                      
       axl_$1   0.         cp3_$1l.bo  0.       # Contact on wheel/wheelset                             
       mu_$1l3                                  # Coefficient of friction                               
       2.05e11 .25                              # Modulus of elasticity and Poisson's ratio             
       1 1 1                                    # Creepage reduction due to contaminated rail surface   
       0.                         600e6         # Prestress force and stiffness normal to the surface   
#
#      No need for setting constrains to the rails.
#      Because in wr_coupl_pe0 the rails have no degrees of freedom
#
  s_var sngl cp1_$1r.Vref                       
 ]
  in_substruct wr_coupl [ 111 ]

  func fl_wear_w 111r  mu_111r1 mu_111r2 mu_111r3   

##
##  Modal parameters of the wheelsets.
##  ----------------------------------
# mass  m_flex_1 axl_111  70   0.10               ## Torsionsform
# coupl m_flex_1 cp1_111r end_2  0.0636396 0. 0.  # 0. 0.14142 0.
# coupl m_flex_1 cp1_111l end_2  -.0636396 0. 0.  # 0. 0.14142 0.
# s_var sngl axl_111.c1
# s_var sngl axl_111.v1

##
##  Store variables for postprocessing
##  ----------------------------------
  s_var gpdat_r1                   # Write the motions of all masses to the GPdat-file
#
  func print06_init  cp1_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 cp1_$1.z         
   s_var var_0 cp1_$1.dr        
   s_var var_0 cp1_$1.gam       
   s_var var_0 cp1_$1.c         
   s_var var_0 cp1_$1.a_b       
   s_var var_0 cp1_$1.posw      
   s_var var_0 cp1_$1.bo_       
#
   s_var var_0 cp1_$1.nux       
   s_var var_0 cp1_$1.nuy       
   s_var var_0 cp1_$1.spin      
   s_var var_0 cp1_$1.uny       
   s_var var_0 cp1_$1.usp       
#
   s_var var_0 cp1_$1.vux       
   s_var var_0 cp1_$1.vuy       
   s_var var_0 cp1_$1.vuz       
   s_var var_0 cp1_$1.Vref      
#
   s_var var_0 cp1_$1.Fn        
   s_var var_0 cp1_$1.Fny       
#
   s_var var_0 cp1_$1.Fx        
   s_var var_0 cp1_$1.Fy        
   s_var var_0 cp1_$1.Fz        
   s_var var_0 cp1_$1.Mf        
   s_var var_0 cp1_$1.Mk        
   s_var var_0 cp1_$1.Mp        
#
   s_var var_0 cp1_$1.F1x       
   s_var var_0 cp1_$1.F1y       
   s_var var_0 cp1_$1.F1z       
   s_var var_0 cp1_$1.M1f       
   s_var var_0 cp1_$1.M1k       
   s_var var_0 cp1_$1.M1p       
#
   s_var var_0 cp1_$1.F2x       
   s_var var_0 cp1_$1.F2y       
   s_var var_0 cp1_$1.F2z       
   s_var var_0 cp1_$1.M2f       
   s_var var_0 cp1_$1.M2k       
   s_var var_0 cp1_$1.M2p       
#
   s_var var_0 cp1_$1.fwk       # Generated by rollen                           
#
   s_var var_0 cp1_$1.wArchH    # Archard with Hertz pressure distribution      
   s_var var_0 cp1_$1.wArchS                            
#
   s_var var_0 cp1_$1.Mspin                                             
   s_var var_0 cp1_$1.Fnu       # func fl_wear_w  Tgamma                
   s_var var_0 cp1_$1.FMnu      # func fl_wear_w  Energy dissipation    
#
   func div cp1_$1.mux= cp1_$1.Fx cp1_$1.Fn                             
   s_var var_0 cp1_$1.mux                                               
  ]
  in_substruct store_axle  [ 111  ]
  in_substruct store_wheel [ 111r ]
  in_substruct store_wheel [ 111l ]
#
# in_substruct store [ 111l ]
# in_substruct store [ 112l ]
# in_substruct store [ 113l ]
#
 eof
