Jump to content

[WIP] Concept magnetohydrodynamic solar sails


C.A.Sizemore

Recommended Posts

So I want to build an add on that models magnetohydrodynamic solar sail. This is a field of plasma that catches the solar wind and uses that pressure to provide a vessel with thrust. These sails are like the solar sails that have been talk about before but they have an advantage over a standard solar sail, being a plasma field they are not restricted to the mass you can lift into orbit. A field can be kilometers across without having to lift that mass into orbit.

The hard part I see is that thrust is still very small, in the real world you would open the sails and leave them open for weeks to move a vehicle from Earth to the Mars. That does not really work in KSP you can not (without more mods that allow for independent actions) set the sails on a ship to Jool and then leave. You have to stay with the vessel while under thrust.

To work within the game limitations I think that the engine would work more like a thruster, It would have to have a significant Thrust but consume no fuel. To balance this engine against the rest of the game I would set up a couple of limitations; First it could not be activated inside the SOI of any planet or moon (this is a real world limitation as you would not want to drag a multi-kilometer electromagnet through the magnetosphere of a planet), Second limitation would be based on the solar panel model (the more sunlight your sail gets the more thrust you get).

As for a model I do not have one yet what I would like is an aurora borealis effect over an area around the ship. My thought on an easy early mock up would be using a stock fuel tank and 3 or 4 of the Giant solar panels. The tank would stand in for the field generator and the solar panels for the field.

Please tell me what you think.

Link to comment
Share on other sites

You can also add a capacitor-part for balance. It was possible in KSP Interstellar to charge up part with custom resource during timewarp, so while you can't sit through week-long burn, you can wrap for week-long recharge (also only in sun SOI), deploy magnetic field and then have thrust based on distance to Sun for time based on stored energy capacity. Maybe not realistic in process, but more bearable gameplay-wise and for the state of bodies the result will be almost the same.

Link to comment
Share on other sites

The Alcubierre drives are far to fast, any drive that can instantly push you to a significant percentage of lightspeed is just way over powered. In reality those drives will require the same amount of power generation as a medium sized star. I want something that is less Star Trek than a warp drive. I was thinking of something with a power out put more like that of Skipper or maybe a Mainsail. I do like the effect rover dude uses though that is what I was looking for. I could not find anyone using the interstellar solar sails so I will have to down load them and check them out. although the sail they are talking about is a physical sail not a field.

Link to comment
Share on other sites

I Just built my Mark 0.1 of the Solar Sail, I used the FL-R1 RCS Fuel Tank with the Yellow Tanks recolored to blue, (I have no modeling skills). I placed it in the Specialized Electrics for now I think maybe it should be its own tech node eventually. I launched it in a Sandbox and used the Infinite fuel cheat to boost the unit into space. Once I got the unit into space it worked perfectly until I turned off Infinite Fuel then no thrust. The unit had full electrical charge and even with the solar panels retracted it was not using any charge.

My process;

Copied and edited the Mainsails config,

Used the FL-R1 RCS Fuel Tank's mesh, node definitions and attachment rules.

Copied over and edited the images for FL-R1 RCS Fuel Tank.

To do:

Need to figure out why the sail does not work, I will post the config file in another post.

Need to add sensing of sunlight pressure, for realism.

Need to add SOI sensing.

Need to get better visual effect for sails.

Need to find a better sound files I just used the stock sound effects for the Mainsail.

https://s-media-cache-ak0.pinimg.com/originals/e6/c0/36/e6c03645b9da411dbcf222306719c9fd.jpg

https://s-media-cache-ak0.pinimg.com/originals/75/c6/9b/75c69b3776348bee43007961a3203078.jpg

- - - Updated - - -

Spoiler alert this is the config file.

PART{

// Solar Clipper

// Clipper Sail

//

// --- general parameters ---

name = Clipper Sail

module = Part

author = C.A.Sizemore

// --- asset parameters ---

mesh = model.mu

scale = 1

rescaleFactor = 1

// --- node definitions ---

node_stack_top = 0.0, 0.5, 0.0, 0.0, 1.0, 0.0, 2

node_stack_bottom = 0.0, -0.5, 0.0, 0.0, 1.0, 0.0, 2

// --- FX definitions ---

// --- Sound FX definition ---

sound_vent_medium = engage

sound_rocket_hard = running

sound_vent_soft = disengage

sound_explosion_low = flameout

// --- editor parameters ---

TechRequired = SpecializedElectrics

entryCost = 24000

cost = 6000

category = Engine

subcategory = 0

title = Solar Clipper Solar Sail

manufacturer = Kerchester Shipworks

description = An engine that drives your ship on nothing but Kerbols solar wind.

// attachment rules: stack, srfAttach, allowStack, allowSrfAttach, allowCollision

attachRules = 1,0,1,1,0

// --- standard part parameters ---

mass = 6

dragModelType = default

maximum_drag = 0.2

minimum_drag = 0.2

angularDrag = 2

crashTolerance = 7

breakingForce = 200

breakingTorque = 200

maxTemp = 3600

MODULE

{

name = ModuleEngines

thrustVectorTransformName = thrustTransform

exhaustDamage = False

ignitionThreshold = 0.1

minThrust = 0

maxThrust = 1500

heatProduction = 0

fxOffset = 0, 0, 0.02

PROPELLANT

{

name = ElectricCharge

ratio = 1.8

DrawGauge = True

}

atmosphereCurve

{

key = 0 4200

}

MODULE

{

name = ModuleGimbal

gimbalTransformName = thrustTransform

gimbalRange = 1

}

MODULE

{

EFFECTS

{

Thrust

{

AUDIO

{

clip = Squad/Sounds/sound_rocket_mini

volume = 0.0 0.0

volume = 1.0 1.0

pitch = 0.0 0.8

pitch = 1.0 1.0

loop = true

}

}

}

Link to comment
Share on other sites

You can also add a capacitor-part for balance. It was possible in KSP Interstellar to charge up part with custom resource during timewarp, so while you can't sit through week-long burn, you can wrap for week-long recharge (also only in sun SOI), deploy magnetic field and then have thrust based on distance to Sun for time based on stored energy capacity. Maybe not realistic in process, but more bearable gameplay-wise and for the state of bodies the result will be almost the same.

I find KSPI Solar Sails Ideal for low solar orbits, where the precise orbit, did not matter much. Going anywhere else takes too long or too difficult

Link to comment
Share on other sites

Okay my solar sails need solar wind, So I will need to add a resource, Solar Wind and the Solar Sails will have to collect and use that resource. I am going to have to write my own plugin? Yikes more work but fun.

So where would I learn to write a plugin and I guess if I make it so that the solar wind is only available in Kerbols SOI and not any Planet or Moons that would give it the realism I would want.

Edited by C.A.Sizemore
Link to comment
Share on other sites

I would strongly advice not to use any resources as they do not behave well with high time warp.

If I were you, I would simply extend Interstellar Solar Sails. The code is stand alone enough to turn it into a separate Mod

First try to understand the code


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;

namespace FNPlugin {
class ModuleSolarSail : PartModule {
// Persistent True
[KSPField(isPersistant = true)]
public bool IsEnabled = false;

// Persistent False
[KSPField]
public float reflectedPhotonRatio = 1f;
[KSPField]
public float surfaceArea; // Surface area of the panel.
[KSPField]
public string animName;

// GUI
[KSPField(guiActive = true, guiName = "Force")]
protected string forceAcquired = "";
[KSPField(guiActive = true, guiName = "Acceleration")]
protected string solarAcc = "";

protected Transform surfaceTransform = null;
protected Animation solarSailAnim = null;

const double kerbin_distance = 13599840256;
const double thrust_coeff = 9.08e-6;

protected double solar_force_d = 0;
protected double solar_acc_d = 0;
protected long count = 0;

[KSPEvent(guiActive = true, guiName = "Deploy Sail", active = true)]
public void DeploySail() {
if (animName != null && solarSailAnim != null) {
solarSailAnim[animName].speed = 1f;
solarSailAnim[animName].normalizedTime = 0f;
solarSailAnim.Blend(animName, 2f);
}
IsEnabled = true;
}

[KSPEvent(guiActive = true, guiName = "Retract Sail", active = false)]
public void RetractSail() {
if (animName != null && solarSailAnim != null) {
solarSailAnim[animName].speed = -1f;
solarSailAnim[animName].normalizedTime = 1f;
solarSailAnim.Blend(animName, 2f);
}
IsEnabled = false;
}

public override void OnStart(StartState state) {
if (state != StartState.None && state != StartState.Editor) {
//surfaceTransform = part.FindModelTransform(surfaceTransformName);
//solarSailAnim = (ModuleAnimateGeneric)part.Modules["ModuleAnimateGeneric"];
if (animName != null) {
solarSailAnim = part.FindModelAnimators(animName).FirstOrDefault();
}
if (IsEnabled) {
solarSailAnim[animName].speed = 1f;
solarSailAnim[animName].normalizedTime = 0f;
solarSailAnim.Blend(animName, 0.1f);
}

this.part.force_activate();
}
}

public override void OnUpdate() {
Events["DeploySail"].active = !IsEnabled;
Events["RetractSail"].active = IsEnabled;
Fields["solarAcc"].guiActive = IsEnabled;
Fields["forceAcquired"].guiActive = IsEnabled;
forceAcquired = solar_force_d.ToString("E") + " N";
solarAcc = solar_acc_d.ToString("E") + " m/s";
}

public override void OnFixedUpdate() {
if (FlightGlobals.fetch != null) {
solar_force_d = 0;
if (!IsEnabled) { return; }
double sunlightFactor = 1.0;
Vector3 sunVector = FlightGlobals.fetch.bodies[0].position - part.orgPos;

if (!PluginHelper.lineOfSightToSun(vessel)) {
sunlightFactor = 0.0f;
}

//Debug.Log("Detecting sunlight: " + sunlightFactor.ToString());
Vector3d solarForce = CalculateSolarForce() * sunlightFactor;
//print(surfaceArea);

Vector3d solar_accel = solarForce / vessel.GetTotalMass() / 1000.0 * TimeWarp.fixedDeltaTime;
if (!this.vessel.packed) {
vessel.ChangeWorldVelocity(solar_accel);
} else {
if (sunlightFactor > 0) {
double temp1 = solar_accel.y;
solar_accel.y = solar_accel.z;
solar_accel.z = temp1;
Vector3d position = vessel.orbit.getRelativePositionAtUT(Planetarium.GetUniversalTime());
Orbit orbit2 = new Orbit(vessel.orbit.inclination, vessel.orbit.eccentricity, vessel.orbit.semiMajorAxis, vessel.orbit.LAN, vessel.orbit.argumentOfPeriapsis, vessel.orbit.meanAnomalyAtEpoch, vessel.orbit.epoch, vessel.orbit.referenceBody);
orbit2.UpdateFromStateVectors(position, vessel.orbit.vel + solar_accel, vessel.orbit.referenceBody, Planetarium.GetUniversalTime());
//print(orbit2.timeToAp);
if (!double.IsNaN(orbit2.inclination) && !double.IsNaN(orbit2.eccentricity) && !double.IsNaN(orbit2.semiMajorAxis) && orbit2.timeToAp > TimeWarp.fixedDeltaTime) {
vessel.orbit.inclination = orbit2.inclination;
vessel.orbit.eccentricity = orbit2.eccentricity;
vessel.orbit.semiMajorAxis = orbit2.semiMajorAxis;
vessel.orbit.LAN = orbit2.LAN;
vessel.orbit.argumentOfPeriapsis = orbit2.argumentOfPeriapsis;
vessel.orbit.meanAnomalyAtEpoch = orbit2.meanAnomalyAtEpoch;
vessel.orbit.epoch = orbit2.epoch;
vessel.orbit.referenceBody = orbit2.referenceBody;
vessel.orbit.Init();

//vessel.orbit.UpdateFromOrbitAtUT(orbit2, Planetarium.GetUniversalTime(), orbit2.referenceBody);
vessel.orbit.UpdateFromUT(Planetarium.GetUniversalTime());
}

}
}
solar_force_d = solarForce.magnitude;
solar_acc_d = solar_accel.magnitude / TimeWarp.fixedDeltaTime;
//print(solarForce.x.ToString() + ", " + solarForce.y.ToString() + ", " + solarForce.z.ToString());
}
count++;
}

private Vector3d CalculateSolarForce() {
if (this.part != null) {
Vector3d sunPosition = FlightGlobals.fetch.bodies[0].position;
Vector3d ownPosition = this.part.transform.position;
Vector3d normal = this.part.transform.up;
if (surfaceTransform != null) {
normal = surfaceTransform.forward;
}
Vector3d force = normal * Vector3d.Dot((ownPosition - sunPosition).normalized, normal);
return force * surfaceArea * reflectedPhotonRatio * solarForceAtDistance();
} else {
return Vector3d.zero;
}
}

private double solarForceAtDistance() {
double distance_from_sun = Vector3.Distance(FlightGlobals.Bodies[PluginHelper.REF_BODY_KERBOL].transform.position, vessel.transform.position);
double force_to_return = thrust_coeff * kerbin_distance * kerbin_distance / distance_from_sun / distance_from_sun;
return force_to_return;
}

}
}

and the part file:


PART
{

// --- general parameters ---
name = SM-Solar-Sail
module = Part
author = SasquatchMarmalade

// --- asset parameters ---
mesh = model.mu
scale = 1
rescaleFactor = 1.25


// --- node definitions ---
node_stack_top = 0.0, 1.001, 0.0, 0.0, 1.0, 0.0
node_stack_bottom = 0.0, -1.001, 0.0, 0.0, 1.0, 0.0


// --- FX definitions ---

//fx_exhaustFlame_blue = 0.0, -10.3, 0.0, 0.0, 1.0, 0.0, running
//fx_gasJet_white = 0.0, -10.3, 0.0, 0.0, 1.0, 0.0, running

// --- Sound FX definition ---

//sound_vent_medium = engage
//sound_rocket_hard = running
//sound_vent_soft = disengage
//sound_explosion_low = flameout

// --- editor parameters ---
TechRequired = metaMaterials
entryCost = 2500
cost = 10000
category = Engine
subcategory = 0
title = Solar Sail
manufacturer = SM Aeronautics
description = Solar sails (also called light sails or photon sails) are a form of spacecraft propulsion using the radiation pressure (also called solar pressure) from stars to push large ultra-thin mirrors to high speeds.
// attachment rules: stack, srfAttach, allowStack, allowSrfAttach, allowCollision
attachRules = 1,0,1,0,0

// --- standard part parameters ---
mass = 1
dragModelType = default
maximum_drag = 0.2
minimum_drag = 0.2
angularDrag = 2
crashTolerance = 7
maxTemp = 2500
breakingForce = 200
breakingTorque = 200


MODULE
{
name = ModuleSolarSail
surfaceArea = 144400
animName = Default Take
}

}

Edited by FreeThinker
Link to comment
Share on other sites

FreeThinker your saying I should copy the module from the Interstellar, which works and is stable and use my own part for the magnetohydrodynamic solar sail.

I am not a programer and I get lost easily in the code.

I am okay with learning to code, my problem with the interstellar solar sail is its mechanic. A magnetohydrodynamic solar sail would not need to be at a 45 degree angle to the sun neither would a true solar sail. You would tack like a sail boat either with wind to go faster or against the wind to slow. A solar sail with the solar wind directly astern would be gaining a lot of deltaV.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...