-- Main parameters
parameters =
{
size = 46, -- mean radius
co = {x=0,y=1.1721,z=34.436}, -- cockpit camera offset
mass = 11000, -- empty mass
pmi = {x=15.5,y=22.1,z=7.7}, -- principal moments of inertia
cs = {x=53,y=186.9,z=25.9}, -- cross sections
rd = {x=0.25,y=0.3,z=0.1}, -- rotation drag coefficients
fuel = 13000 -- fuel mass
}
-- Touchdown points
gears =
{
{pos = {x=0,y=-5.5,z=8.2728}, stiffness = 0.3e7, damping = 0.3e6, mu = 1.6, mu_lng = 0.1}, -- front
{pos = {x=-3.5,y=-5.5,z=-1}, stiffness = 0.3e7, damping = 0.3e6, mu = 3.0, mu_lng = 0.2}, -- left
{pos = {x=3.5,y=-5.5,z=-1}, stiffness = 0.3e7, damping = 0.3e6, mu = 3.0, mu_lng = 0.2} -- right
}
-- Main thruster parameters
main_thruster_left =
{
pos = {x=-1,y=0,z=-7.7}, -- thrust attack point
dir = {x=0,y=0,z=1}, -- thrust direction
maxth0 = 1e5, -- max. vacuum thrust
isp0 = 4e4 -- vacuum ISP (fuel-specific impulse)
}
main_thruster_right =
{
pos = {x=1,y=0,z=-7.7}, -- thrust attack point
dir = {x=0,y=0,z=1}, -- thrust direction
maxth0 = 1e5, -- max. vacuum thrust
isp0 = 4e4 -- vacuum ISP (fuel-specific impulse)
}
-- Retro thruster parameters
retro_thruster_left =
{
pos = {x=-3,y=0,z=5.6}, -- thrust attack point
dir = {x=0,y=0,z=-1}, -- thrust direction
maxth0 = 2e4, -- max. vacuum thrust
isp0 = 4e4 -- vacuum ISP (fuel-specific impulse)
}
retro_thruster_right =
{
pos = {x=3,y=0,z=5.6}, -- thrust attack point
dir = {x=0,y=0,z=-1}, -- thrust direction
maxth0 = 2e4, -- max. vacuum thrust
isp0 = 4e4 -- vacuum ISP (fuel-specific impulse)
}
-- Vertical airfoil function
function VerticalLift(hVessel,aoa,M,Re)
local quantity = 9
local AOA = {-180*RAD,-60*RAD,-30*RAD,-2*RAD,15*RAD,20*RAD,25*RAD,60*RAD,180*RAD}
local CL = { 0, 0, -0.4, 0, 0.7, 1, 0.8, 0, 0}
local CM = { 0, 0, 0.014,0.0039,-0.006,-0.008,-0.010, 0, 0}
local i = 1
while AOA[i+1] < aoa and i < quantity do
i = i + 1
end
local cl, cm, cd
if i < quantity then
local step = (aoa - AOA[i]) / (AOA[i + 1] - AOA[i])
cl = CL[i] + (CL[i + 1] - CL[i]) * step
cm = CM[i] + (CM[i + 1] - CM[i]) * step
else
cl = CL[quantity]
cm = CM[quantity]
end
local saoa = math.sin(aoa)
local pd = 0.015 + 0.4*saoa*saoa
cd = pd + oapi.get_induceddrag (cl, 1.5, 0.7) + oapi.get_wavedrag (M, 0.75, 1.0, 1.1, 0.04)
return cl, cm, cd
end
-- Horizontal airfoil function
function HorizontalLift(hVessel,beta,M,Re)
local quantity = 8
local BETA = {-180*RAD,-135*RAD,-90*RAD,-45*RAD,45*RAD,90*RAD,135*RAD,180*RAD}
local CL = { 0, 0.3, 0, -0.3, 0.3, 0, -0.3, 0}
local i = 1
while BETA[i+1] < beta and i < quantity do
i = i + 1
end
local cl, cd
if i < quantity then
cl = CL[i] + (CL[i + 1] - CL[i]) * (beta - BETA[i]) / (BETA[i + 1] - BETA[i])
else
cl = CL[quantity]
end
cd = 0.015 + oapi.get_induceddrag (cl, 1.5, 0.6) + oapi.get_wavedrag (M, 0.75, 1.0, 1.1, 0.04);
return cl, 0, cd
end
-- Airfoils
vi:create_airfoil(LIFT.VERTICAL,{x=0,y=0,z=-0.3},'VerticalLift',5,90,1.5)
vi:create_airfoil(LIFT.HORIZONTAL,{x=0,y=0,z=-4},'HorizontalLift',5,15,1.5)
-- Control surface animations
vi:create_controlsurface(AIRCTRL.AILERON, 0.3, 1.7, {x=-7.5,y=0,z=-7.2}, AIRCTRL_AXIS.XNEG, 1, LeftAileronAnimation)
vi:create_controlsurface(AIRCTRL.AILERON, 0.3, 1.7, {x=7.5,y=0,z=-7.2}, AIRCTRL_AXIS.XPOS, 1, RightAileronAnimation)
vi:create_controlsurface(AIRCTRL.ELEVATOR, 1.4, 1.7, {x=0,y=0,z=-7.2}, AIRCTRL_AXIS.XPOS, 1, ElevatorAnimation)
vi:create_controlsurface(AIRCTRL.RUDDER, 0.8, 1.7, {x=0,y=0,z=-7.2}, AIRCTRL_AXIS.YPOS, 1, RudderAnimation)
vi:create_controlsurface(AIRCTRL.ELEVATORTRIM, 0.3, 1.7, {x=0,y=0,z=-7.2}, AIRCTRL_AXIS.XPOS, 1)