def _create_polynomial_model(symbol, degree): newmod = PolynomialModelT.create(h2o_dataset, symbol, degree) newmod.plot(h2o_dataset, _path('temp.pdf'), False) newmod.write(_path('data/h2o-%s.json' % symbol.lower()))
path = modules[__name__].__file__ path = realpath(path) path = dirname(path) return join(path, relative_path) def _create_polynomial_model(symbol, degree): newmod = PolynomialModelT.create(h2o_dataset, symbol, degree) newmod.plot(h2o_dataset, _path('temp.pdf'), False) newmod.write(_path('data/h2o-%s.json' % symbol.lower())) h2o_dataset = DataSet(_path('data/dataset-h2o-lienhard2015.csv')) # _create_polynomial_model('beta', 11) # _create_polynomial_model('Cp', 10) # _create_polynomial_model('k', 8) # _create_polynomial_model('mu', 11) # _create_polynomial_model('nu', 11) # _create_polynomial_model('rho', 7) h2o_dict = {} h2o_dict['beta'] = PolynomialModelT.read(_path('data/h2o-beta.json')) h2o_dict['Cp'] = PolynomialModelT.read(_path('data/h2o-cp.json')) h2o_dict['k'] = PolynomialModelT.read(_path('data/h2o-k.json')) h2o_dict['mu'] = PolynomialModelT.read(_path('data/h2o-mu.json')) h2o_dict['nu'] = PolynomialModelT.read(_path('data/h2o-nu.json')) h2o_dict['rho'] = PolynomialModelT.read(_path('data/h2o-rho.json')) h2o = Material('Water', StateOfMatter.liquid, h2o_dict)
path = realpath(path) path = dirname(path) return join(path, relative_path) def _create_polynomial_model(symbol, degree): newmod = PolynomialModelT.create(h2o_dataset, symbol, degree) newmod.plot(h2o_dataset, _path('temp.pdf'), False) newmod.write(_path('data/h2o-%s.json' % symbol.lower())) h2o_dataset = DataSet(_path('data/dataset-h2o-lienhard2015.csv')) # _create_polynomial_model('beta', 11) # _create_polynomial_model('Cp', 10) # _create_polynomial_model('k', 8) # _create_polynomial_model('mu', 11) # _create_polynomial_model('nu', 11) # _create_polynomial_model('rho', 7) h2o_dict = { 'beta': PolynomialModelT.read(_path('data/h2o-beta.json')), 'Cp': PolynomialModelT.read(_path('data/h2o-cp.json')), 'k': PolynomialModelT.read(_path('data/h2o-k.json')), 'mu': PolynomialModelT.read(_path('data/h2o-mu.json')), 'nu': PolynomialModelT.read(_path('data/h2o-nu.json')), 'rho': PolynomialModelT.read(_path('data/h2o-rho.json')) } h2o = Material('Water', StateOfMatter.liquid, h2o_dict)
def _create_polynomial_model(symbol, degree): newmod = PolynomialModelT.create(h2o_dataset, symbol, degree) newmod.plot(h2o_dataset, _path('temp.pdf'), False) newmod.write(_path('data/h2o-%s.json' % symbol.lower()))
def _path(relative_path): path = modules[__name__].__file__ path = realpath(path) path = dirname(path) return join(path, relative_path) def _create_polynomial_model(symbol, degree): newmod = PolynomialModelT.create(air_dataset, symbol, degree) newmod.plot(air_dataset, _path('temp.pdf'), False) newmod.write(_path('data/air-%s.json' % symbol.lower())) air_dataset = DataSet(_path('data/dataset-air-lienhard2015.csv')) # _create_polynomial_model('Cp', 14) # _create_polynomial_model('k', 8) # _create_polynomial_model('mu', 8) # _create_polynomial_model('rho', 14) air_dict = {} air_dict['rho'] = IgRhoT(28.9645, 101325.0) air_dict['Cp'] = PolynomialModelT.read(_path(r'data/air-cp.json')) air_dict['mu'] = PolynomialModelT.read(_path(r'data/air-mu.json')) air_dict['k'] = PolynomialModelT.read(_path(r'data/air-k.json')) air_dict['beta'] = IgBetaT() air = Material("Air", StateOfMatter.gas, air_dict)