#K-space vector. Because of this, to discretize k-space, you # #simply specify ntheta (number of discretizations in the theta # #direction) and nphi (number of discretizations in the phi # #direction). For more explanation, see Chai, Lee, and Patankar # #JTHT. # ################################################################### 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
def usage(): print "Usage: %s filebase [outfilename]" % sys.argv[0] print "Where filebase.cas is a Fluent case file." print "Output will be in filebase-prism.dat if it is not specified." sys.exit(1) reader = FluentCase(fileBase + filename + extension) reader.read() meshes = reader.getMeshList() geomFields = fvm.models.GeomFields('geom') metricsCalculator = fvm.models.MeshMetricsCalculatorA(geomFields, meshes) metricsCalculator.init() SiKspace = pa.KspaceA(fileBase + SiBZfile + BZdisc + ".txt", dimension, 1) GeKspace = pa.KspaceA(fileBase + GeBZfile + BZdisc + ".txt", dimension, 1) #SiKspaceFine=pa.KspaceA(fileBase+SiBZfile+BZfine+".txt",dimension,1) #GeKspaceFine=pa.KspaceA(fileBase+GeBZfile+BZfine+".txt",dimension,1) SikArray = (SiKspace.getHollandConductivity((T1 + T2) / 2)).asNumPyArray() SikArray = SikArray * eVtoJoule print "Silicon Thermal Conductivity Tensor:" print SikArray[0], ' ', SikArray[1], ' ', SikArray[2] print SikArray[3], ' ', SikArray[4], ' ', SikArray[5] print SikArray[6], ' ', SikArray[7], ' ', SikArray[8] print 'Silicon Specific Heat:', SiKspace.calcSpecificHeat(300) * eVtoJoule kn0 = float(SiKspace.findKnStats(initialScale)) avemfp = kn0 * initialScale #print "Silicon Average mean free path", avemfp
sys.exit(1) reader = FluentCase(fileBase + filename + extension) reader.read() meshes = reader.getMeshList() geomFields = fvm.models.GeomFields('geom') metricsCalculator = fvm.models.MeshMetricsCalculatorA(geomFields, meshes) metricsCalculator.init() ntheta = 10 nphi = 20 tau = 1e-2 vg = 1000 K_space = pa.KspaceA(fileBase + BZfile + BZdisc + ".txt", dimension, 1) #K_space=pa.KspaceA(1,tau,vg,4e14,ntheta,nphi) kArray = (K_space.getHollandConductivity((T1 + T2) / 2)).asNumPyArray() kArray = kArray * eVtoJoule print "Thermal Conductivity Tensor:" print kArray[0], ' ', kArray[1], ' ', kArray[2] print kArray[3], ' ', kArray[4], ' ', kArray[5] print kArray[6], ' ', kArray[7], ' ', kArray[8] 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:
ntheta = 1 nphi = 4 tau = 3.753e-12 vg = 8433 omega = 5.1e13 Cp = 1623801.53768 / eVtoJoule #There are two way to construct the Brillioun zone. To make a gray approximation, use constructor 1. # You specify the lattice constant (to get the radius of the Brillioun zone), the relaxation time, the group velocity, # the frequency (rad/s), the number of theta discretizations, and the number of phi discretizations. In the grayKspace, it # automatically assumes a 2D physical space and therefore it only creates the upper hemisphere of the Brillioun zone. #Constructor 2 is how you get a non gray Brillioun zone. The first argument is the absolute path to the output file created from # the matlab script "MakeSiKspace.m". The second argument should always be 3, and the last argument should always be 1. K_space = pa.KspaceA(A, tau, vg, omega, ntheta, nphi, False) #constructor 1 K_space.setCp(Cp) #K_space=pa.KspaceA(fileBase+BZfile+BZdisc+".txt",dimension,1) # constructor 2 #this method calculates the diffuse thermal conductivity of the material with the given # wave vector space discretization. It just evaluates the integral given by Holland. Since we # are dealing with non-constant Cp, you need to specify a temperature. Also, inside MEMOSA, # ALL UNITS OF ENERGY ARE IN ELECTRON VOLTS kArray = (K_space.getHollandConductivity((T1 + T2) / 2)).asNumPyArray() kArray = kArray * eVtoJoule print "Thermal Conductivity Tensor:" print kArray[0], ' ', kArray[1], ' ', kArray[2] print kArray[3], ' ', kArray[4], ' ', kArray[5] print kArray[6], ' ', kArray[7], ' ', kArray[8] print 'Specific Heat:', K_space.calcSpecificHeat(300) * eVtoJoule