unit fusionsreactor;
interface
type TFReactor =
class(TObject)
private
temperature: extended;
pressure: extended;
dbstoff: integer;
firing: boolean;
public
procedure Create;
function Energyproduction(temp, pres: extended; bs: integer): extended;
function DeterminePressure(temp: extended; bs: integer): extended;
function DetermineTemperature(bs: integer; triggerenergy: extended): extended;
function Lawson(temp, pres: extended): extended;
end;
implementation
procedure TFReactor.Create;
begin
temperature := 0.0;
pressure := 0.0;
bstoff := 0;
firing := false;
end;
function TFReactor.energyproduction(temp, pres: extended; bs: integer): extended;
var lawsoncrit: extended;
begin
lawsoncrit:= 1E+20;
if pres*temp>lawsoncrit
then begin
result:= (1E+17)*deut;
firing:=true;
end else
result:= 0.0;
end;
function TFReactor.DeterminePressure(temp: extended; bs: integer): extended;
var molarvolume, gasconstant: extended;
begin
gasconstant:=8.314472;
//J/(mol*K)
molarvolume:= 0.00403*deut/(113.09724);
result:= gasconstant*temp/gasconstant;
end;
function TFReactor.DetermineTemperature(bs: integer; triggerenergy: extended): extended;
var boltzmann: extended;
begin
boltzmann:= 1.3806504E-23;
result:= 2.0*triggerenergy*boltzmann/3.0;
end;
function TFReactor.Lawson(temp,pres: extended): extended;
begin
result:= temp*pres;
end;
end.