Exemplo n.º 1
0
f.init()
f.showSolution()

f.solve(loglevel, refine_grid)

f.setRefineCriteria(ratio=200.0, slope=0.0502, curve=0.1)
f.set(energy='on')
f.solve(loglevel, refine_grid)

f.save('flame1.xml')
f.showSolution()

# write the velocity, temperature, and mole fractions to a CSV file
z = f.flame.grid()
T = f.T()
u = f.u()
V = f.V()
fcsv = open('flame1.csv', 'w')
writeCSV(fcsv, ['z (m)', 'u (m/s)', 'V (1/s)', 'T (K)', 'rho (kg/m3)'] +
         list(gas.speciesNames()))
for n in range(f.flame.nPoints()):
    f.setGasState(n)
    writeCSV(fcsv,
             [z[n], u[n], V[n], T[n], gas.density()] +
             list(gas.moleFractions()))
fcsv.close()

print 'solution saved to flame1.csv'

# Disabled, because timings cause text differences
# f.showStats()
Exemplo n.º 2
0
f.showSolution()

f.solve(loglevel, refine_grid)

f.setRefineCriteria(ratio = 200.0, slope = 0.0502, curve = 0.1)
f.set(energy = 'on')
f.solve(loglevel,refine_grid)

f.save('flame1.xml')
f.showSolution()


# write the velocity, temperature, and mole fractions to a CSV file
z = f.flame.grid()
T = f.T()
u = f.u()
V = f.V()
fcsv = open('flame1.csv','w')
writeCSV(fcsv, ['z (m)', 'u (m/s)', 'V (1/s)', 'T (K)', 'rho (kg/m3)']
         + list(gas.speciesNames()))
for n in range(f.flame.nPoints()):
    f.setGasState(n)
    writeCSV(fcsv, [z[n], u[n], V[n], T[n], gas.density()]
             +list(gas.moleFractions()))
fcsv.close()

print 'solution saved to flame1.csv'

# Disabled, because timings cause text differences
# f.showStats()