Monday, February 25, 2019

Shortened Water from Air code

T1 is the temperature of the surrounding air in deg C, RH1 is the relative humidity in percent, P1 is the atmospheric pressure in kPa (at sea level it is about 101.325 kPa), T2 is the temperature to which the air will be cooled, V1 is the volume of air you are going to cool in cubic metres. Code below:

label 1;
var
EnthV1MWh,EnthV1kWh,EnthV1,NokgdaV1,Enthd,Psatw1,Psatw2,Tk1,Tk2,Mvpa1,Enth1,Enth2,Ma1,Mv1,HR1,HR2,
Pv1,PV2,T1,RH1,P1,P2,T2,V1,kgDryAir,EdpkgDA,EnthDV,HR1mHR2,HR1mHR2V,kgpkWh,Td,RH,Psat,Pv,Tdew:extended;
errors1:boolean;
calcstr2,calcstr1,calcstr3,calcstr4,calcstr5,calcstr6,calcstr7,
calcstr8,calcstr9,calcstr10,calcstr11,calcstr12,calcstr13,calcstr14,
calcstr15,calcstr16,calcstr17,calcstr18:string[30];
begin
errors1:=false;
form3.hide;
form3.show;
try
T1:=strtofloat(form3.edit1.Text);
RH1:=strtofloat(form3.edit2.Text);
P1:=strtofloat(form3.edit3.Text);
T2:=strtofloat(form3.edit4.Text);
V1:=strtofloat(form3.edit5.Text);
except
errors1:=true;
end;
if (errors1=true) or
(T1<1) or (T1>60) or (RH1<=0) or (RH1>100) or (P1<20) or (P1>120) or (T2<1) or
(T2>60) or (V1<0)
then begin
form3.canvas.textout(0,100,'CHECK ENTRIES.');
goto 1
end;
Tk1:=T1+273.15;
Tk2:=T2+273.15;

Td:=T1;
RH:=RH1;
Psat:=0.61121*exp((18.678-Td/234.5)*Td/(257.14+Td));
Pv:=(RH/100)*Psat;
Tdew:=Td;
repeat
Tdew:=Tdew-0.001;
Psat:=0.61121*exp((18.678-Tdew/234.5)*Tdew/(257.14+Tdew));
until (Psat<=Pv);
str(Tdew:12:2,calcstr18);


Psatw1:=0.61121*exp((18.678-T1/234.5)*T1/(257.14+T1));
Pv1:=Psatw1*RH1/100;
HR1:=0.622*Pv1/(P1-Pv1);
Ma1:=(P1-Pv1)/(0.287*Tk1);
Enth1:=(1.005*T1)+HR1*(2501.3+1.82*T1);
Psatw2:=0.61121*exp((18.678-T2/234.5)*T2/(257.14+T2));
HR2:=Hr1;
P2:=P1;
if (Psatw2<PV1) then begin
Pv2:=Psatw2;
HR2:=0.622*Pv2/(P2-Pv2);
form3.canvas.textout(0,120,'Water condenses out. Dew point is:'+calcstr18+' deg C');
end;
Enth2:=(1.005*T2)+HR2*(2501.3+1.82*T2);
kgDryAir:=V1*Ma1;
EdpkgDA:=(Enth2-Enth1);
EnthDV:=kgDryAir*EdpkgDA;
HR1mHR2:=HR1-HR2;
HR1mHR2V:=kgDryAir*HR1mHR2;
kgpkWh:=(-1)*HR1mHR2V/(EnthDV/3600);
str((EnthDV/3600),calcstr7);
str(HR1mHR2V,calcstr10);
str(kgpkWh:13:4,calcstr17);
form3.canvas.textout(0,150,'Total mass of water condensing out of the air is: '+calcstr10+' kg.');
form3.canvas.textout(0,180,'Total heat added to the air is: '+calcstr7+' kWh.');
form3.canvas.textout(0,210,'Number of kg of water produced per kWh of heat removed from air: '+calcstr17+' kg/kWh.');
form3.canvas.textout(0,240,'Dew point temperature is: '+calcstr18+' deg C.');
1: end;

Thursday, February 21, 2019

Water from pipe from sea to land

Sometimes, in dry areas, the sea nearby is warmer than the land at night. If one has a pipe with inlet over the sea and outlet over the land it is possible the warmer less dense sea air will rise in the pipe and water will condense out on the land side. At the same temperature moist air has a lower density than dry air. Here is computer code that will help one determine whether water will condense out (RH becomes greater than 100% - if that were possible).
T is in deg C, P is in kPa, RH is a percentage.
The inputs are initial temperature Ti above sea surface, initial relative humidity (RH) above sea surface, initial atmospheric pressure just above the sea surface (P1) and final temperature Tf (above land of desert), and P2 (at altitude of land of desert). Delphi computer code below:

label 1;
var
Tdewi,Tdewf,Pvf,LCL1,LCL2,Pvi,Psatwi,Psatwf,RHf,HR,RH,p1,p2,Ti,Tf,Hinc,q,lnx,x,
Psat,h,p:extended;
errors1:boolean;
calcstr6,calcstr5,calcstr4,calcstr2,calcstr1,calcstr3:string[30];
begin
errors1:=false;
form47.hide;
form47.show;
try
Ti:=strtofloat(form47.edit1.Text);
RH:=strtofloat(form47.edit2.Text);
P1:=strtofloat(form47.edit3.Text);
Tf:=strtofloat(form47.edit4.Text);
P2:=strtofloat(form47.edit5.Text);
except
errors1:=true;
end;
if (errors1=true) or (Ti<0) or (Ti>100) or (RH>100) or (RH<0) or (P1<2) or (P1>500) or (Tf<0)
or (Tf>100) or (P2<2) or (P2>500)
then begin
form47.canvas.textout(0,100,'CHECK ENTRIES.');
goto 1
end;
Psatwi:=0.61121*exp((18.678-Ti/234.5)*Ti/(257.14+Ti));
Pvi:=Psatwi*(RH/100);
HR:=0.622*Pvi/(P1-Pvi);
Psatwf:=0.61121*exp((18.678-Tf/234.5)*Tf/(257.14+Tf));
RHf:=(HR*P2)/((0.622+HR)*Psatwf);
Pvf:=RHf*Psatwf;

Tdewi:=Ti;
repeat
Tdewi:=Tdewi-0.001;
Psat:=0.61121*exp((18.678-Tdewi/234.5)*Tdewi/(257.14+Tdewi));
until (Psat<=Pvi);
str(Tdewi:12:2,calcstr3);

Tdewf:=Tf;
repeat
Tdewf:=Tdewf-0.001;
Psat:=0.61121*exp((18.678-Tdewf/234.5)*Tdewf/(257.14+Tdewf));
until (Psat<=Pvf);
str(Tdewf:12:2,calcstr4);

LCL1:=125*(Ti-Tdewi);
LCL2:=125*(Tf-Tdewf);
str(LCL1:15:2,calcstr5);
str(LCL2:15:2,calcstr6);

str((100*RHf):15:2,calcstr1);
str(HR:15:5,calcstr2);
If(RHf<1) then form47.canvas.textout(0,120,'Relative humidity (RH) AFTER PARCEL HAS MOVED is: '+calcstr1+'%.');
If (RHf<1) then form47.canvas.textout(0,150,'Humidity ratio (HR) remains the same as the air parcel moves: '+calcstr2+' kg/kg.');
If(RHf>1) then form47.canvas.textout(0,120,'Air has become SATURATED and FICTITIOUS relative humidity (RH) AFTER PARCEL HAS MOVED is: '+calcstr1+'%.');
form47.canvas.textout(0,190,'Dew point for initial Ti and P1 situation is: '+calcstr3+' deg C.');
if (RHf<1) then form47.canvas.textout(0,220,'Dew point for final Tf and P2 situation is '+calcstr4+' deg C.');
form47.canvas.textout(0,260,'LCL1 for initial Ti and P1 situation is: '+calcstr5+' m.');
if (RHf<1) then form47.canvas.textout(0,290,'LCL2 for final Tf and P2 situation is '+calcstr6+' m.');

1: end;

Monday, February 18, 2019

To get some plants to cover dry ground and reduce dust one could use a dew drip system and grow rows of plants, say with 20 m between rows. Some plants could absorb toxic matter. 
When cold or warmth needs to be transported a long way secondary refrigerants are used. Water is often used as a secondary refrigerant as it holds a lot of heat per kg. So why not cool water using the usual sort of refrigerant and run the cold water through long pipes with spikes on pointing downwards? Dew will form and run down the spikes giving drip irrigation. One could also use bends in the pipe to allow dew to drip down. To prevent frost run hot water through the pipes. The system could be powered by a wind turbine.
To get an idea of how much water one could get from the air you can use my Delphi computer code at 

https://www.facebook.com/groups/WaterFromAir/  or from
 https://airartist.blogspot.com/2019/02/i-have-finished-delphi-computer-program.html

Saturday, February 9, 2019

Delphi code for water from air.

I have finished a Delphi computer program that will tell people if water will condense out of the air when the air is cooled. One could use wind power. Anyone or any institution may use it in any legal context. It also tells how much water will condense out and it tells one how much heat (in kJ and kWh) must be extracted from the air and so one can get an idea of the power requirements.
One could use an air conditioning unit to cool the air to the best temperature and there are do-it-yourself (DIY) sites that tell one how to do this -see https://www.instructables.com/id/DIY-Atmospheric-Water-Generator/
 Inputs are T1 (temperature of atmospheric air in deg C before cooling), RH1 (relative humidity in % of atmospheric air before cooling), P1 (atmospheric pressure in kPa which is assumed to remain the same during cooling), T2 (temperature in deg C to which air will be cooled), V1 (the volume in cubic metres  of air at T1 and RH1 and P1 that is to be cooled).
Note: It is a convention to say "enthalpy per kg of dry air," meaning the enthalpy related to the kg of dry air and the water vapour associated with that kg of dry air.
See code below:


label 1;
var
EnthV1MWh,EnthV1kWh,EnthV1,NokgdaV1,Enthd,Psatw1,Psatw2,Tk1,Tk2,Mvpa1,Enth1,Enth2,Ma1,Mv1,HR1,HR2,
Pv1,PV2,T1,RH1,P1,P2,T2,V1,kgDryAir,EdpkgDA,EnthDV,HR1mHR2,HR1mHR2V,kgpkWh,Td,RH,Psat,Pv,Tdew:extended;
errors1:boolean;
calcstr2,calcstr1,calcstr3,calcstr4,calcstr5,calcstr6,calcstr7,
calcstr8,calcstr9,calcstr10,calcstr11,calcstr12,calcstr13,calcstr14,
calcstr15,calcstr16,calcstr17,calcstr18:string[30];
begin
errors1:=false;
form2.hide;
form2.show;
try
T1:=strtofloat(form2.edit1.Text);
RH1:=strtofloat(form2.edit2.Text);
P1:=strtofloat(form2.edit3.Text);
T2:=strtofloat(form2.edit4.Text);
V1:=strtofloat(form2.edit5.Text);
except
errors1:=true;
end;
if (errors1=true) or
(T1<0.1) or (T1>100) or (RH1<0.1) or (RH1>99) or (P1<50) or (P1>150) or (T2<0.1) or
(T2>100) or (V1<0) or (T2>=T1)
then begin
form2.canvas.textout(0,100,'CHECK ENTRIES.');
goto 1
end;
Tk1:=T1+273.15;
Tk2:=T2+273.15;

Td:=T1;
RH:=RH1;
Psat:=0.61121*exp((18.678-Td/234.5)*Td/(257.14+Td));
Pv:=(RH/100)*Psat;
Tdew:=Td;
repeat
Tdew:=Tdew-0.001;
Psat:=0.61121*exp((18.678-Tdew/234.5)*Tdew/(257.14+Tdew));
until (Psat<=Pv);
str(Tdew:12:2,calcstr18);


Psatw1:=0.61121*exp((18.678-T1/234.5)*T1/(257.14+T1));
Pv1:=Psatw1*RH1/100;
HR1:=0.622*Pv1/(P1-Pv1);
Ma1:=(P1-Pv1)/(0.287*Tk1);
Enth1:=(1.005*T1)+HR1*(2501.3+1.88*T1);
Psatw2:=0.61121*exp((18.678-T2/234.5)*T2/(257.14+T2));
HR2:=Hr1;
P2:=P1;
if (Psatw2<PV1) then begin
Pv2:=Psatw2;
HR2:=0.622*Pv2/(P2-Pv2);
form2.canvas.textout(0,90,'Water condenses out. Dew point is:'+calcstr18+' deg C');
end;
Enth2:=(1.005*T2)+HR2*(2501.3+1.88*T2);
kgDryAir:=V1*Ma1;
EdpkgDA:=(Enth2-Enth1);
EnthDV:=kgDryAir*EdpkgDA;
HR1mHR2:=HR1-HR2;
HR1mHR2V:=kgDryAir*HR1mHR2;
kgpkWh:=(-1)*HR1mHR2V/(EnthDV/3600);
str(Enth1:13:4,calcstr1);
str(Enth2:13:4,calcstr2);
str(EdpkgDA:13:6,calcstr3);
str(Ma1:13:4,calcstr4);
str(kgDryAir,calcstr5);
str(EnthDV,calcstr6);
str((EnthDV/3600),calcstr7);
str((EnthDV/3600000),calcstr8);
str((HR1mHR2*1000):13:4,calcstr9);
str(HR1mHR2V,calcstr10);
str((HR1*1000):13:4,calcstr11);
str((HR2*1000):13:4,calcstr12);
str(EnthV1MWh,calcstr16);
str(kgpkWh:13:4,calcstr17);
form2.canvas.textout(0,120,'Enthalpy1 per kg dry air is: '+calcstr1+' kJ/kg dry air.');
form2.canvas.textout(0,150,'Enthalpy2 per kg dry air is: '+calcstr2+' kJ/kg dry air.');
form2.canvas.textout(0,180,'Enthalpy difference per kg dry air is: '+calcstr3+' kJ/kg dry air.');
form2.canvas.textout(0,210,'Mass of DRY air in one cubic metre of original air is: '+calcstr4+' kg.');
form2.canvas.textout(0,240,'Number of kg of dry air in V1 is: '+calcstr5+' kg.');
form2.canvas.textout(0,270,'FOR VOLUME V1: Heat added to volume V1 of air (Enthalpy difference for volume V1) is: '+calcstr6+' kJ.');
form2.canvas.textout(0,300,'FOR VOLUME V1: Heat added to volume V1 of air is: '+calcstr7+' kWh.');
form2.canvas.textout(0,330,'FOR VOLUME V1: Heat added to volume V1 of air is: '+calcstr8+' MWh.');
form2.canvas.textout(0,370,'HR1 - HR2 g/kg is: '+calcstr9+' grams of water vapour per kg dry air (CONDENSES OUT).');
form2.canvas.textout(0,400,'(HR1 - HR2 kg/kg)x(number of kg dry air in volume V1) is: '+calcstr10+' kg of water (CONDENSES OUT).');
form2.canvas.textout(0,440,'HR1 is: '+calcstr11+' g/kg.');
form2.canvas.textout(0,470,'HR2 is: '+calcstr12+' g/kg.');
form2.canvas.textout(0,520,'SUMMARY. Total mass of water condensing out of the air is: '+calcstr10+' kg.');
form2.canvas.textout(0,550,'SUMMARY: Total heat added to the air is: '+calcstr7+' kWh.');
form2.canvas.textout(0,580,'SUMMARY: kg of water produced per kWh of heat removed from air: '+calcstr17+' kg/kWh.');
form2.canvas.textout(0,610,'SUMMARY: Dew point temperature is: '+calcstr18+' deg C.');
1: end;