Exemplo n.º 1
0
casedir = casesdir +'/%s/%s/%s' % (exptitle,casetitle,casesubtitle)

if newcase==True:
    if not os.path.isdir(casedir):
        os.makedirs(casedir)
else:
    if not os.path.isdir(casedir):
        print 'Case does not exist'


#-----------------------------------------------------------------
#                     5 Generate case files
#-----------------------------------------------------------------

if newcase==True:
    h = dlsin.height(kmax, zsize) 

    def readinpfiles(case,subcase,username='******'):
        path = '/home/%s/Les/Cases/%s/%s/' % (username, case, subcase)
        lscaleinp = np.loadtxt(path + 'lscale.inp',skiprows=2)
        return {'lscale.inp': lscaleinp}

#-----------------------------------------------------------------
#                          5.1 prof.inp
#-----------------------------------------------------------------

    headerprof = ['height', 'thl', 'qt', 'u', 'v', 'tke']

    profinp = np.zeros((kmax,6))

    profinpin = dlsin.readprofinp(case=sourcecasetitle,subcase=sourcecasesubtitle)['prof.inp'] 
Exemplo n.º 2
0
]
with open("%s/windfarmdata.inp.%s" % (expdir, expnr), "w") as x:
    for item in headerfarm:
        x.write("{0:>15}".format(item))
    x.write("\n")
    for i in range(0, ntur):
        for item in windfarmdata[i, :]:
            x.write("{:>15.3f}".format(item))
        x.write("\n")

# -----------------------------------------------------------------
#                     3 Generate case files
# -----------------------------------------------------------------

if newcase == True:
    h = dlsin.height(kmax, zmax, dz)  # make height vector

    # -----------------------------------------------------------------
    #                          3.1 prof.inp
    # -----------------------------------------------------------------
    def readinpfiles(case, subcase, username="******"):
        path = "/home/%s/%s/%s/" % (username, case, subcase)
        profinp = loadtxt(path + "prof.inp.046", skiprows=2)
        lscaleinp = loadtxt(path + "lscale.inp.046", skiprows=2)
        return {"prof.inp": profinp, "lscale.inp": lscaleinp}

    headerprof = ["height", "thl", "qt", "u", "v", "tke"]

    profinp = zeros((kmax, 6))

    if gabls: