parameters: (self, locs=[0.0, 0.3, 0.5, 1.0], data=None, group=None)
docstring: Set the initial guess for the solution. By default, the adiabatic flame
          temperature and equilibrium composition are computed for the inlet gas
          composition. Alternatively, a previously calculated result can be
          supplied as an initial guess via 'data' and 'key' inputs (see
          `FlameBase.set_initial_guess`).
  
          :param locs:
              A list of four locations to define the temperature and mass fraction
              profiles. Profiles rise linearly between the second and third
              location. Locations are given as a fraction of the entire domain
docstring_summary: Set the initial guess for the solution. By default, the adiabatic flame
          temperature and equilibrium composition are computed for the inlet gas
          composition. Alternatively, a previously calculated result can be
          supplied as an initial guess via 'data' and 'key' inputs (see
          `FlameBase.set_initial_guess`).
docstring_tokens: Set the initial guess for the solution . By default the adiabatic flame temperature and equilibrium composition are computed for the inlet gas composition . Alternatively a previously calculated result can be supplied as an initial guess via data and key inputs ( see FlameBase . set_initial_guess ) .
function: def set_initial_guess(self, locs=[0.0, 0.3, 0.5, 1.0], data=None, group=None):
          """
          Set the initial guess for the solution. By default, the adiabatic flame
          temperature and equilibrium composition are computed for the inlet gas
          composition. Alternatively, a previously calculated result can be
          supplied as an initial guess via 'data' and 'key' inputs (see
          `FlameBase.set_initial_guess`).
  
          :param locs:
              A list of four locations to define the temperature and mass fraction
              profiles. Profiles rise linearly between the second and third
              location. Locations are given as a fraction of the entire domain
          """
          super().set_initial_guess(data=data, group=group)
          if data:
              # set fixed temperature
              Tmid = .75 * self.T[0] + .25 * self.T[-1]
              i = np.flatnonzero(data.T < Tmid)[-1]
              self.fixed_temperature = data.T[i]
  
              return
  
          self.gas.TPY = self.inlet.T, self.P, self.inlet.Y
  
          if not self.inlet.mdot:
              # nonzero initial guess increases likelihood of convergence
              self.inlet.mdot = 1.0 * self.gas.density
  
          Y0 = self.inlet.Y
          u0 = self.inlet.mdot / self.gas.density
          T0 = self.inlet.T
  
          # get adiabatic flame temperature and composition
          self.gas.equilibrate('HP')
          Teq = self.gas.T
          Yeq = self.gas.Y
          u1 = self.inlet.mdot / self.gas.density
  
          self.set_profile('velocity', locs, [u0, u0, u1, u1])
          self.set_profile('T', locs, [T0, T0, Teq, Teq])
  
          # Pick the location of the fixed temperature point, using an existing
          # point if a reasonable choice exists
          T = self.T
          Tmid = 0.75 * T0 + 0.25 * Teq
          i = np.flatnonzero(T < Tmid)[-1] # last point less than Tmid
          if Tmid - T[i] < 0.2 * (Tmid - T0):
              self.fixed_temperature = T[i]
          elif T[i+1] - Tmid < 0.2 * (Teq - Tmid):
              self.fixed_temperature = T[i+1]
          else:
              self.fixed_temperature = Tmid
  
          for n in range(self.gas.n_species):
              self.set_profile(self.gas.species_name(n),
                               locs, [Y0[n], Y0[n], Yeq[n], Yeq[n]])
function_tokens: def set_initial_guess ( self , locs = [ 0.0 , 0.3 , 0.5 , 1.0 ] , data = None , group = None ) : super ( ) . set_initial_guess ( data = data , group = group ) if data : # set fixed temperature Tmid = .75 * self . T [ 0 ] + .25 * self . T [ - 1 ] i = np . flatnonzero ( data . T < Tmid ) [ - 1 ] self . fixed_temperature = data . T [ i ] return self . gas . TPY = self . inlet . T , self . P , self . inlet . Y if not self . inlet . mdot : # nonzero initial guess increases likelihood of convergence self . inlet . mdot = 1.0 * self . gas . density Y0 = self . inlet . Y u0 = self . inlet . mdot / self . gas . density T0 = self . inlet . T # get adiabatic flame temperature and composition self . gas . equilibrate ( 'HP' ) Teq = self . gas . T Yeq = self . gas . Y u1 = self . inlet . mdot / self . gas . density self . set_profile ( 'velocity' , locs , [ u0 , u0 , u1 , u1 ] ) self . set_profile ( 'T' , locs , [ T0 , T0 , Teq , Teq ] ) # Pick the location of the fixed temperature point, using an existing # point if a reasonable choice exists T = self . T Tmid = 0.75 * T0 + 0.25 * Teq i = np . flatnonzero ( T < Tmid ) [ - 1 ] # last point less than Tmid if Tmid - T [ i ] < 0.2 * ( Tmid - T0 ) : self . fixed_temperature = T [ i ] elif T [ i + 1 ] - Tmid < 0.2 * ( Teq - Tmid ) : self . fixed_temperature = T [ i + 1 ] else : self . fixed_temperature = Tmid for n in range ( self . gas . n_species ) : self . set_profile ( self . gas . species_name ( n ) , locs , [ Y0 [ n ] , Y0 [ n ] , Yeq [ n ] , Yeq [ n ] ] )