пятница, 16 ноября 2012 г.

Настраиваемые компоненты в Thermodroid



В Thermodroid может быть добавлены настраиваемые компоненты. В качестве примера приведен способ добавления сероводорода H2S, используя базы данных AspenTech:
1)    Открываем Thermodroid

2)    Жмем кнопку с плюсом (+). Появится диалог:

3)    Вводим имя нового компонента H2S в поле name

4)    Открываем Aspen HYSYS и создаем новое Решение (Case). Добавляем новый список компонентов, и в список добавляем сероводород H2S:

5)    Дважды щелкаем на сероводород в списке. Получаем:

Перемещаясь по вкладкам ID. Critical, Point,… получаем значения необходимых нам параметров и переносим их в Thermodroid

Свойства вводятся согласно:
Свойство в Thermodroid
Свойство в Aspen HYSYS Databank
Вкладка - Название
Описание
Единицы измерения в СИ для Thermodroid
Для сероводорода
Tc
Critical – Temperature[K]
Критическая температура
К
373,600006103516
Pc
Critical – Presure[kPa]
Критическое давление
Па
9007790,03906250
vc
Critical – Volume[m3/kgmole]
Критический удельный объем
м3/моль
9,79999005794525e-005
acic
Critical – Acentricity
Фактор ацентричности

8,10000002384186e-002
molarw
Critical – Molecular weight
Молярный вес
г/моль
34,0760002136230
Hoffset
TDep – Vapour Enthalpy
Параметры для расчета энтальпии и энтропии идеального газа. См. приложение 1
-30139,0
idealHa
-1,435
idealHb
0,9985
idealHc
-1,843e-004
idealHd
5,57076e-007
idealHe
-3,17706e-010
idealHf
6,36625e-014
idealsG
нет
-0,226511105
Ttp
нет
Температура тройной точки
К

Ptp
нет
Давление тройной точки
Па

ispolar
нет
Полярность
0 –неполярный
1 – полярный

1


6)    Опционально скорость расчетов для компонента может быть увеличена за счет использования расчета кривой фазового перехода по аппроксимации Антоина. Для этого: Добавляем новый Расчетный пакет/Fluid package, который называется Antoine и переходим во вкладку Parametres:

7)    Копируем все коэффициенты Coeff ACoeff F в Thermodroid:

Здесь: antA = Coeff A; antB = Coeff B; antC= Coeff C; …. antF = Coeff F.
8)    Для расчета теплофизических свойств – теплопроводности и вязкости используются коэффициенты lam1, lam2,…lam6; visA, visB, visC, visD. Эти коэффициенты следует определять самостоятельно, пользуясь правилами вычислений, приведенными в Приложении.
9)    Дополнительные коэффициенты для сероводорода приведены в таблице:
Коэффициент
Значение
antA
78,6762
antB
-3839,89
antC
0,0
antD
-11,199
antE
1,8848e-002
antF
1,0
lam1
1.08511278410554
lam2
1.22471488903391
lam3
0,305967294130304
lam4
-0,000579181478641212
lam5
7,45369872043592e-007
lam6
-2,65632257802664e-009
visA
16,003618845898
visB
-0,14170508765288
visC
0,000641182544271312
visD
-9,34586266389785e-007

10) Теперь Thermodroid выглядит так:

11) Нажимаем ОК. Это сохранит новый элемент в базу данных.

 
12) Теперь можно пользоваться новым элементом – сероводородом

понедельник, 22 октября 2012 г.

JavaScript support for Thermodroid and Thermomixer

Thermodroid macro language description


Now you can use JavaScript to write macros in Thermodroid and Thermomixer.
You can access to the fluid operations from the methods of the internal object tdI. You shouldn't always write all methods throw accessing to that object. The parser automatically write two with statements: 
with (tdI) { with (Math) { //automatic text. shouldn't write this
  //your code here
  //...
}} //automatic text. you don't see this. shouldn't write this

All the methods and operations with the fluids are the same like in the internal macro language.

Fluid operations

to initialize the new fluid

tdI.newfluid(#,fluid)
# - number of the fluid in the internal array [0..9]
fluid - the fluid name. for example - methane, ethane, nitrogen and so on.

to calculate the fluid at pressure P [Pa] and temperature T [K]
tdI.ptflash(#,P,T)
# - number of the fluid

to calculate the fluid at pressure P [Pa] and vapour fraction V
tdI.pvflash(#,P,V)
# - number of the fluid

to calculate the fluid at temperature T [K] and vapour fraction V
tdI.tvflash(#,T,V)
# - number of the fluid

to calculate the fluid at pressure P [Pa] and molar enthalpy H [kJ/kmole]
tdI.phflash(#P,H)
# - number of the fluid

to get fluid properies use functions
tdI.massenthalpy(#) - get the mass enthalpy value of calculated fluid [kJ/kg]
tdI.molarenthalpy(#) - get the molar enthalpy [kJ/kmole]
tdI.massentropy(#) - get the mass entropy [kJ/kg/K]
tdI.molarentropy(#) - get the molar entropy [kJ/kmole/K]
tdI.massdensity(#) - get the mass density [kg/m3]
tdI.molardensity(#) - get the molar density [kmole/m3]
tdI.massheatofvap(#) - get the heat of evaporation in mass basis [kJ/kg]
tdI.molarheatofvap(#) - get the heat of evaporation in molar basis [kJ/kmole]
tdI.molarweight(#) - get the molar weight [kg/kmole]
tdI.T(#) - get the temperature [K]
tdI.P(#) - get the pressure [Pa]
tdI.V(#) - get the vapour fraction
tdI.viscosity(#)- get the viscosity [cP]
tdI.thermalconduct(#)- get the thermal conductivity [W/m/K]
tdI.Cp(#)- get the thermal capacity [kJ/kg/K]


To receive results to Thermodroid/Thermomixer you should call method

tdI.Var(String aname, Number avalue)
aname - the name of the variable that holds the result;
avalue - the value of the result

To receive results from Thermodroid/Thermomixer you should call method

tdI.getVar(String aname)
aname - the name of the variable you want to access.


Example #1
Calculate the simple exchanger. First fluid - H2O, pressure 1 bar, inlet temperature 50 C, outlet temperature 10 C. Second fluid - methane, pressure 3 bar, inlet state - saturated liquid, outlet state - saturated valve, mass flow 0.2 kg/s. Need to calculate the mass flow for water.
JavaScript Internal Macro language
var p1=100000;
var p2=300000;
var t1=273.15+50;
var t2=273.15+10;
var gm=0.2;
newfluid(0,'h2o');
ptflash(0, p1,t1);
var hw1=massenthalpy(0);
ptflash(0, p1,t2);
var hw2=massenthalpy(0);
var qw=hw1-hw2;
newfluid(1,'methane');
pvflash(1,p2,0);
var hm1=massenthalpy(1);
pvflash(1, p2,1);
var hm2=massenthalpy(1);
var qm=hm2-hm1;
Var('qm',qm);
Var('gm',qm*gm/qw);

p1=100000
p2=300000
t1=273.15+50
t2=273.15+10
gm=0.2
newfluid(0,h2o)
fluid0.ptflash(p1,t1)
hw1=fluid0.massenthalpy()
fluid0.ptflash(p1,t2)
hw2=fluid0.massenthalpy()
qw=hw1-hw2
newfluid(1,methane)
fluid1.pvflash(p2,0)
hm1=fluid1.massenthalpy()
fluid1.pvflash(p2,1)
hm2=fluid1.massenthalpy()
qm=hm2-hm1
gw=qm*gm/qw
Example #2
Calculate the average isobaric thermal capacity for nitrogen at 1 MPa in the temperature interval of [200..300] K with step of 1 K.
JavaScript Internal Macro language
var p=1000000;
var t1=200;
var t2=300;
var tstep = 1;
var t = t1;
var cpav = 0;
newfluid(0,'nitrogen');
while (t <= t2) {
 ptflash(0, p, t);
 cpav += Cp(0);
 t += tstep;
}
cpav /= (t2 - t1)/tstep;

Var('cpav',cpav);

p=1000000
t1=200
t2=300
tstep=1 
t=t1
cpav=0 
newfluid(0,nitrogen)
%%while1
fluid0.ptflash(p, t)
cpav=cpav+fluid0.cp()
t=t+tstep
%if t <= t2 while1 next 
cpav=cpav/((t2 - t1)/tstep)


понедельник, 24 сентября 2012 г.

How to select a shadow color (problems with the black stripes)

How to select a shadow color (problems with the black stripes)
Как выбрать цвет теней (проблемы с черными линиями)

 



среда, 29 августа 2012 г.

Custom 3d flag - live wallpaper for android


3D Live Wallpaper. Customize your own 3d flag that waving by the wind. You can use colored default pictures or load your own picture from SD-card for background and flag texture or you can just use a color or a gradient like background. The program for creative people.











3D Live Wallpaper. Настрой свой собственный 3D флаг, который развевается на ветру. Вы можете использовать цветные картинки по умолчанию или загрузить собственную фотографию с SD-карты для фона и текстуры флага или вы можете просто использовать цвет или градиент как фон. Программа для творческих людей.

Download at Android Play