################################################################### vg = .01 tau = 100. ntheta = 4 nphi = 8 #1 is for the #number of #polarizations K_space = pa.KspaceA(1, tau, vg, 4e12, ntheta, nphi) #4e12 is the phonon #frequency. Don't #worry about it. pmacro = pext.PhononMacro("e_dubprime") #create the model pmodel = pa.PhononModelA(meshes, geomFields, K_space, pmacro) #get the options popts = pmodel.getOptions() #get the boundary map bcMap = pmodel.getBCs() T_1 = 300 T_2 = 310 #initial temperature guess popts["initialTemperature"] = 305. #set tolerances popts.absTolerance = 1e-7
print 'Specific Heat:', K_space.calcSpecificHeat(300) * eVtoJoule kn0 = float(K_space.findKnStats(initialScale)) avemfp = kn0 * initialScale scale = avemfp / Kn kn0 = float(K_space.findKnStats(scale)) for mesh in meshes: xNodes = mesh.getNodeCoordinates().asNumPyArray() xNodes[:, 0] *= scale xNodes[:, 1] *= scale xNodes[:, 2] *= scale metricsCalculator.init() pmacro = pext.PhononMacro(filename) cmodel = pa.COMETModelA(meshes, 0, geomFields, K_space, pmacro) copts = cmodel.getOptions() cBCs = cmodel.getBCs() FaceArea = cmodel.getWallAreaVector(meshes[0], 6) FaceAreaMag = math.sqrt(FaceArea[0] * FaceArea[0] + FaceArea[1] * FaceArea[1]) print 'Face Area Magnitude:', FaceAreaMag print 'Scale:', scale Tinit = (T1 + T2) / 2 BallisticRate = K_space.FindBallisticHeatRate(FaceArea, T1, T2) * eVtoJoule print "Ballistic Heat Rate: ", BallisticRate