def forwardSolve(self, plasmaField=part.plasmaField()): """ given a plasma field, solve the particle """ self.PS.p.inject(plasmaField) if self.hasRun: self.PS.reset() self.PS.solve() self.hasRun = True
#start = time.time() PS = particleSolver( part.particle(diameter=array([.1e-6, 35e-6]), T=300, thermalTimestep=1e-5, kinematicTimestep=1e-5, x0=array([0.006, .008, 0.]), v0=array([0., -30., 0.]), nNodes=50, nStep=maxSteps)) #create the plasmaField try: PF.density(array([0, 0, 0])) except NameError: PF = part.plasmaField(fastOn=True, temperatureScaling=1.35) # pf = part.plasmaField(fastOn = True, temperatureScaling = 1.35) # PF = part.lavaField('sharpTemp_600_38.pkl', # fastOn = True, gasPickle = None, temperatureScaling = 1.) # #PS.p.inject(PF,x0 = array([0.001,.004,0.]), v0 = array([0.,-10.,0.])) PS.p.inject(PF) #//////////////// Timestepping options ////////////////////////// PS.p.adaptiveTimestepping = True PS.p.splitScales = True d0 = PS.p.diameter() PS.reset() start = time.time() print 'solving...'
figName_ + '.png', format='png', transparent=True) fig = lambda: figure(figsize=(20, 22)) start = time.time() p = part.particle(diameter=d, T=300, thermalTimestep=4e-5, kinematicTimestep=2e-5, nNodes=nNodes) #create the plasmaField sim = "cur-700_flo-50_gas-argon68helium32_make-SG100" try: PF.density(array([0, 0, 0])) except NameError: PF = part.plasmaField(simName=sim, fastOn=True) # PF = part.plasmaField(simName = sim, # fastOn = True) p.inject(PF, array([.0001, .0035, 0]), array([0, -v0[0], 0])) PS = ps.particleSolver(p) T = zeros((v0.shape[0], nNodes)) r = zeros_like(T) h = zeros(v0.shape[0]) t = zeros_like(h) v = zeros_like(h) X = [] print 'init time: ' + str(time.time() - start) for i in range(v0.shape[0]): PS.p = p PS.reset(v0=array([0, -v0[i], 0]))
start = time.time() #mesh initial velocity and diameter v0 = 7 nD = 5 d = linspace(10e-6, 100e-6, nD) nNodes = 50 #create the plasmaField sim = "cur-700_flo-50_gas-argon68helium32_make-SG100" try: PF.density(array([0, 0, 0])) except NameError: PF = part.plasmaField(simName=sim, fastOn=True, temperatureScaling=1.20) # PF = part.plasmaField(simName = sim, # fastOn = True, temperatureScaling = 1.20) P = [] g = gm.gasMixture('zirconiaGauss') injectionPosition = array([.0001, .0035, 0]) for i in range(d.shape[0]): p = part.particle(diameter=d[i], T=300, thermalTimestep=4e-5, kinematicTimestep=2e-5, nNodes=nNodes, material=g) p.inject(PF, injectionPosition, array([0, -v0, 0]))