Showing posts with label pressure-volume. Show all posts
Showing posts with label pressure-volume. Show all posts

Wednesday, July 7, 2021

Python Library for Calculation of Balloon Properties

I have now put up a python library with numerical implementations of the fundamental relationships for pressure, volume, mass, etc. of a gravity balloon.

https://github.com/AlanCoding/gravitational-balloon-mathematics

The old work on this blog was done largely in an Excel spreadsheet with macros. In terms of the library of methods, I feel that the python version is now better and more correct. Some library methods haven't yet been converted, but the important ones will, and that should go quite fast.

Doing this allows me to put work in Juypter notebooks, which is much better for sharing my work down to the numerical implementation. For a demo, I have re-done the graphs for the PR and PV curve.


These are showing the same thing as the prior post did:

https://gravitationalballoon.blogspot.com/2013/03/gravity-balloon-pressure-volume-curve.html

That had some errors in it, and I'm now confident those are corrected.

The python library is much much easier to understand and modify, and any further improvements will become considerably faster.

Friday, July 2, 2021

A More Detailed Run-through of the Pressure-Volume Relationship

I've enabled MathJax on this blog and started repairing numerous equations, after a few years of the equations not rendering. Some parts have still not been recovered, but I've also realized that some parts are unclear.

So there will be value in running through the basic equations of the gravity balloon with fresh eyes.

Objective

The equations here will relate multiple quantities. At different times we are interested in different quantities. The most common is to seek pressure (P) and volume (V), given values for all the others. Given that a gravity balloon is to be built out of some asteroid, then available mass and density of rock is fixed.

Mass

We will temporarily introduce variables for dimensions. The big R is used for the radius of the inner volume of air - the inner surface of the rock. The little t is used for the thickness of the rock. Thus, the outer surface of the inflated gravity balloon would be (R+t). Less commonly, the original radius of the asteroid (assuming spherical) will be denoted $R_0$. Using those, we will use the general formula for volume of a sphere both before turning into a gravity balloon and after.

$$ M = \rho V = \rho \frac{4}{3} \pi R_0^3 = \rho \frac{4}{3} \pi \left( (R + t)^3 - R^3 \right) $$

Gravitational Field

Consider any homogeneous spherical planet, we have a simple $1/r^2$ formula for gravity on the surface. I'm keeping M, the mass of the planet, in there as an independent variable of the function, as this will be important.

Spherical Planet Field Surface and Beyond

$$ g_{space}(r, M) = G M \frac{1}{r^2} $$

As you consider the interior, Gauss' law dictates that we can use that same formula, if we include all the mass below the radius of consideration.

Spherical Planet Field Interior, not for Gravity Balloon

$$ g_{interior}(r) = G M_{inside} \frac{1}{r^2} = G \rho \frac{4}{3} \pi r^3 \frac{1}{r^2} = G \rho \pi \frac{4}{3} r $$

These are universal expressions for field inside and outside a solid sphere. I don't want to make them out to be anymore than that, because the important thing is how they get reused in for the gravity balloon.

Gravity Balloon Gravitational Field

The gravity balloon has 3 distinct regions:

  • livable air on the inside
  • rock walls
  • space outside

I will write the gravitational field for the gravity balloon as a piecewise function covering all 3 regions here.

$$ g_{gb}(r) = \begin{cases} 0 & r > R \\ g_{rock}(r) & R < r < R + t \\ G M \frac{1}{r^2} & r > R + t \\ \end{cases} $$

As you can imagine, the hard part is that $g_{rock}(r)$, and that is what the rest of the work here is for. The right way is to use $g_{interior}(r)$ to find the field contributions from the rock, but this isn't valid by itself. Instead, we pretend that this is a solid planet of radius $(R+t)$, and write $g_{interior}(r)$ for that, but then subtract the field you would get from the air volume if it were made of rock. This subtraction ("superposition" if you will) is valid for Newtonian field calculations.

$$ g_{rock}(r) = g_{interior}(r) - g_{space}(r, M_{\text{air as rock}}) \\ = g_{interior}(r) - g_{space}(r, \rho \pi \frac{4}{3} R^3) $$

(ASIDE: this is the critical step, and it is easy to get it wrong. I have gotten it wrong before, that, and lack of clarity in prior posts, is why I revive this now. Although I did eventually correct my actual numbers, I also had a habit of skipping a ton of steps, so I'm publicly taking it slowly here.)

With pretty good confidence in this established, let's expand it because it will be integrated.

$$ g_{rock}(r) = G \rho \pi \frac{4}{3} r  - G \rho \pi \frac{4}{3} R^3 \frac{1}{r^2}  = G \rho \pi \frac{4}{3} \left( r  - \frac{R^3}{r^2} \right) $$

This wraps up the gravitational field. The field is fully described by the expressions for $g_{gb}$ with the supporting $g_{rock}$. There are other tangents I can go on, like contributions from the gravity of the air itself, but this should not be interesting until numerical solutions come into play. I have little very interest in air gravitational contributions as a calculus problem.

Pressure

To get air pressure we integrate the gravitational field, and then multiply by density. This is justified by our intuition that pressure is $\rho g h$, which is (density)x(gravity)x(height). This is the integral form, specific to the gravity balloon.

$$ P = \rho \int_R^{R+t} g_{rock}(r) dr  = G \rho^2 \pi \frac{4}{3} \int_R^{R+t} \left( r  - \frac{R^3}{r^2} \right) dr $$

Now we perform the integral.

$$ P = G \rho^2 \pi \frac{4}{3} \left( \frac{1}{2} r^2 + \frac{R^3}{r} \right) \Big|_R^{R+t} \\ = G \rho^2 \pi \frac{4}{3} \left( \frac{1}{2} (R + t)^2 + \frac{R^3}{(R+t)} - \left( \frac{1}{2} R^2 + \frac{R^3}{R} \right) \right) $$

I feel like it is important to write everything out here so that people can follow. That will simplify a great deal, which I do here.

$$ P = G \rho^2 \pi \frac{4}{3} \left( \frac{1}{2} (R + t)^2 + \frac{R^3}{R+t} -  \frac{3}{2} R^2 \right) $$

Prepare to combine the fraction.

$$ P = G \rho^2 \pi \frac{4}{3} \left( \frac{(R + t)^3}{2 (R+t)}  + \frac{2 R^3}{2 (R+t)} -  \frac{3 R^2 (R + t)}{2 (R+t)} \right) \\ = G \rho^2 \pi \frac{4}{3} \left( \frac{(R + t)^3 + 2 R^3 - 3 R^3 - 3 R^2 t}{2 (R+t)}  \right) $$

The cubic expands into a lot of terms, but the $R^3$ power from it cancels out with other terms.

$$ P = G \rho^2 \pi \frac{4}{3} \left( \frac{ t ( 3 R^2 + t (3 R + t) ) - 3 R^2 t}{2 (R+t)}  \right) \\ = G \rho^2 \pi \frac{4}{3} \left( t \frac{  3 R^2 + t (3 R + t) - 3 R^2 }{2 (R+t)}  \right) \\ = G \rho^2 \pi \frac{2}{3} \left( t^2 \frac{ 3 R + t }{R+t}  \right) $$ 

Years ago, I know that I did this many times on paper. Now, I realize that I just don't want any of it to get lost. The pressure equation is slightly non-trivial, but it's still within the realm of basic college physics / calculus.

How you use the equations is the one other slightly non-trivial part.

Usage

The equations above should be thought about in terms of their independent variables. We have functions to give one variable in terms of other.

$$ P(R, t) \\ M(R, t) $$

Usually, we prefer to put things in terms of volume, and this can be swapped one-for-one with R in the relationships above, because the relationship between M and R is trivial and only involves those 2.

$$ V = \frac{4}{3} \pi R^3 $$

This can be done as a preprocessing step in a method numerically. So we can always freely swap V and R as independent variables. I have more commonly written:

$$ P(V, t) \\ M(V, t) $$

Referring back to their definitions, neither of these methods are trivial to invert symbolically, as they carry cubic terms. It can be done, but it's not the best for technical communication.

At this point, I stop with math.

We have 2 equations and 4 variables. That means that, somehow, a user has to specify 2 variables, and the other 2 can be calculated. The system is fully defined for any correctly-phrased question. In my younger days, I was inclined to go further into problem solving through math. Now, I am more than happy to let code solve the rest. The only challenge I have not addressed is selecting workable initial values.

 I have posted one demo method here:

https://github.com/AlanCoding/gravitational-balloon-mathematics/blob/master/gb/inflation.py

This is the rebooted form. I used Excel Visual Basic macros before. I have successfully converted those to python, which I will use to bootstrap some initial testing.

Sunday, November 17, 2013

Inflation Process of a Gravity Balloon

Let's talk about the process of turning an asteroid of a decent-size (about 60 km diameter) into a gravity balloon.  Doing so means that you have to deal with something I call the "pressure droop".  In one example, we start at a pressure of 3 Earth atmospheres (atm) and infate to the benchmark suggested by the National Space Society of 1/2 atm.

Pressure droop of a gravity balloon presents several difficulties, but it's a necessity that must be dealt with if the goal is to work with a single object and avoid moving large masses around our solar system in the construction process.  The constraint of constant habitability through construction (hereafter I'll call it "inflation") also confounds things a little bit.  Humans can survive in up to 3 atmospheres of compressed air without succumbing to Oxygen toxicity, but it would not be desirable.  It would be much more preferable to maintain relatively constant Oxygen partial pressure and fill the rest with an inert gas.

In space, the most available inert gases might be Argon or others, but for simplicity of analysis I'm sticking to Nitrogen gas.  In the most simple sense, air is a combination of Oxygen and Nitrogen gas.  Because the overall pressure of the gravity balloon is set by the pressure-volume relationship (which comes from gravity), we now have two constraints that dictate the quantity of gases that must be in the balloon at all times:
  1. Set the partial pressure of Oxygen to 0.21 atm
  2. Keep the rest filled with the inert gas
While this seems relatively simple, there are some tricks.  The above two requirements mean that to maintain constant habitability, you must insert new Oxygen and Nitrogen gas at constantly varying rates.  You can inflate at any total rate you like, but the ratios between the two are set by this requirement.  I've formulated the exact forms for the gas masses using the stipulated requirements, but I should note that they require use of functions that I've written about elsewhere on this blog.  There are some other qualifiers as well.  For instance, since the temperature is set by habitability constraints it is constant, so the density is proportional to pressure.  I use Earth sea-level as a benchmark to reference this to.  Given that, these are the equations needed.  The pressure is actually the function P_RM, and the volume is implemented as 4/3 pi r^3, which puts everything in terms of radius.

Masses of O2 and N2 for the Entire Process of Inflation
Expressions are Based on Radius and Independent Variable


Here the expressions are plotted for a particular set of parameters.


other parameters of this situation include:
Pressure at start of process is 3 atm
Density of asteroid rock is 1 g/cm^3

The rationale behind the Oxygen mass is somewhat self-obvious, but the Nitrogen gets interesting.  It's not unexpected that it drops beyond a certain point.  After all, if you were going to inflate the structure to the partial pressure of Oxygen itself, then you would have to eliminate all of the Nitrogen content in the process sooner or later.  In fact, for the situation described above, the pressure gets down to around 0.8 atm before it makes sense to actually remove Nitrogen.  But if you have to remove some of the gas, that is difficult in-and-of itself, but it's also expensive and non-ideal.

A more likely outlook is that the relatively small final droop in Nitrogen mass would be avoided altogether.  This could be done if the Oxygen partial pressure is fungible to some degree, and it is.  Instead of using the above program, you would probably bump up the Oxygen content a little bit before the Nitrogen peak, and then only level it out to the desired final concentrations.  This would be fairly workable for a goal of 0.5 atm.  But of course, as good scientists, we need to work to break the model first.

I struggled a little bit to reduce the problem to a set of unit-less parameters.  The issue being described here is mostly a geometric issue (meaning it can be reduced to dimensionless constants), but with an added pressure scale due to the demands of humans to have a constant pressure of Oxygen.  Well I figured a method out.  Here are some extra terms I need to introduce in order to communicate the dimensionless parameters:
  • R_max_N2: the radius at which the Nitrogen mass reaches an absolute maximum in the inflation process
  • R_PO2: the radius you would inflate it to if you continued until the pressure dropped down to the partial pressure of Oxygen
  • Ratio of these two: a good dimensionless metric for the problem at hand, which is generally the radius relative to the ultimate inflatable radius
  • Pressure ratio: the ratio of the initial central pressure to the partial pressure of Oxygen (note that this is not the same as the ratio for the maximum Nitrogen point)

I will be referring to this point of maximum Nitrogen as the Nitrogen Tipping Point because it is, in fact, an undesirable result for someone considering building a gravity balloon.  You would not like to have to "trash" any of the valuable gas you produce.  It follows that the more swing in N2 gas is, the more difficult the entire construction would be.  It's not hard to mentally picture this problem becoming very difficult for extremely large cases.  You need to produce lots of gas to initially "prop" it up, like a car jack for changing a tire.  The cost of doing that prop might be prohibitive, so we need to know in what cases that will happen.

If the radii ratio is close to 1, then the Nitrogen tipping point can not be a problem.  You will, after all, desire to leave some inert gas in there at the end of the process, so you will not need to remove any of it.  If the radii ratio is very low, you may have a problem.


If you had your hopes set on "reasonable" size gravity balloons, then this might be a sigh of relief to you.  There is hardly any practical scenario where a pressure droop of a factor of 10 would be tolerated.  At that point, you would be working with something which was initially uninhabitable.  There are lots of really cool ideas that see pressure ratios for the inflation process span from 1.1 to about 6 or so.  Throughout all of these, the inert gas that needs to be trashed is basically small - to the point that a mild O2 partial pressure adjustment could result in nothing being thrown away.

I should note that for any futurologists with big dreams - large gravity balloons are still viable in a sense.  I took the ratio of the PV product for the Nitrogen Tipping Point relative to the PV product for the fully inflated (only Oxygen) point, and it never surpasses a small fraction of the total.  So if you resolve to "throw away" a "prop" gas in this process, it won't be large in volume compared to the total amount of atmosphere you have to make for the habitat.

But where would all this gas come from?

I don't know.  This is a subject a bit outside of what I know well.  The logical options are:
  1. Transport volatiles from somewhere they're abundant (comets, Ceres, Mars, Jupiter)
  2. Process the asteroid rock itself to extract N2 and O2
The latter option is obviously more appealing, but it's not obviously easy.  Mineral chemical forms aren't often easy to work with.  You might have the option of just putting crushed up rock in an autoclave, heating it, and then separating what comes out.  That would be the ideal scenario.  It's also vaguely more plausible with the center material rather than the outside material.  Since you'll be drilling down there anyway that's obviously not a deal breaker.  But there's no guarantee it will be this easy.

Perhaps a better question is to set a defined limit to start out with.  Is there enough O and N to begin with?  In C-type asteroids, the answer is probably "yes", but barely.  We have some good literature on the elemental compositions of meteorites, which are vaguely representative of the asteroid materials.  The result from that is:
  • Nitrogen: 0.14%
  • Oxygen: 40%
It seems that there is no shortage of Oxygen at all.  Nitrogen is the difficult one.  If we imagine an asteroid with an initial 3 atm central pressure, inflated to 0.5 atm, then that has a Nitrogen requirement of about 2e14 kg.  Using the above ratio, we can find that the elemental Nitrogen content of the original asteroid is about 3.5e14 kg.  This means that you would need to extract all the Nitrogen out of over half of the body, and this is just not reasonable.

Even looking at common minerals, like olivine, isn't particularly helpful.  I have not seen a chemical formula with N attached to it which is predicted to be common in C-type asteroids.  However, I think this is because of my own lack of thoroughness rather than anything intrinsic.

A more promising approach is to look to predicted out-gassing of asteroids.  This paper, for instance, addresses the exact thing I'm interested in.  It even mentions N2 gas itself, although in fairly low concentrations.  There are many other compounds with Nitrogen attached to it, and probably some obvious chemical processes that could lead to extraction of it.  But that doesn't guarantee this would be helpful for a gravity balloon.  It may be that the analysis that shows common Nitrogen is only applicable to bodies much larger than needed for an effective gravity balloon.

In short, it's hard to say with my level of knowledge.  Or more briefly, I don't know.  There still seems to be no reason to rule out the gas production as a deal-breaker.  It could certainly be done without the economics blowing up.  I just don't know how.

Monday, November 4, 2013

Basic Gravity Equations for a Sphere with a Hole in it

For a solid sphere, expressions for the gravity inside and outside of this body are fairly easy to find online.  That is (4/3) G Pi rho r within it, and G M / r^2 outside of it.  Now cut out a sphere in the center of this sphere, and replace it with empty space.  The gravity in this case will not be linearly increasing, and this result took some work for me to figure out.  The most simple correct approach is to subtract gravity from the removed sphere, which is using the principle of superposition.  This is straightforward algebra, so I've put that in the following equation, and a comprehensive roundup of the gravitational field forms inside the hole, in the shell, and outside it all.
  • solid: the entire sphere without the hole cut out
  • hole: the spherical region in the center that is cut out
  • shell: the points within the solid sphere that is not in the cut out region
  • R: the radius of the inner sphere cut out
  • t: the difference between the original sphere's radius and the hole radius

Gravitational Field for Solid Sphere with Hole in Center

Since it's what I'm interested in, I derive the pressure of the center cavity due to hydrostatic force from the shell's weight.  The principle is that height time field equals gravitational potential.  Since the field is constantly changing here, we integrate that, but only do it in the shell region because it's the only area that has a non-zero density. 

Getting Pressure from the Field


This is the most important equation related to a gravity balloon, since it quantifies the pressure with respect to the other physical parameters.  However, this form isn't necessarily the most useful possible combination.  For any given body, we would like to presume that we're starting out with the mass value because there's only so much matter in that place to work with.  That makes the task a little more computationally difficult.  To do this, we introduce a mass balance equation.  This is nothing more than a geometric statement, with calculation of the volume of the shell.

Pressure and Mass Equations


These give two equations with 5 variables.  In any case, we're probably going to know the density.  That leaves 4 variables and 2 equations, for 2 degrees of freedom.  For instance, these could be satisfied by specifying what mass you start with and then how much of an inner radius you excavate.  That will then return a pressure.  Alternatively, maybe we query what radius we can get with a given asteroid, assuming that we want Earth sea level pressure.  That case can present some difficulty since there is no answer when the mass is below a certain value.

I've addressed several combinations of values.  The governing equations can be rearranged quite simply for several cases to get an explicit function.  This is done in a simple form for the pressure and mass equations individually, and then in combination between them.  Two functions are then left which can't be found except for with a cubic formula application (or worse), so these are left as implicit functions.

Function Set


All of the above about directly implimentable, except for the fact that the implicit functions need a solver in order to work.  I found Newton's method to be the ideal option for this.  The challenge is keeping the convergence in check, but that's workable since these functions are relatively simple.  Implicit solves are often somewhat of an art form.

The thickness of the shell (variable t) demonstrates a behavior where it remains in a definable range for the small and large cases.  This is useful to set a guess at the start of Newton's method, as a simple average of those two limit cases are used.  For the guess of the radius (looked up by pressure and mass), a similar type of trick is used.  A limit case of thickness is put into the equation for radius, and that gives a value.  We want to over-estimate the radius because we don't want it to ever go negative.

Guesses for Variables in the Implicit Solves

 

In my formulation, the functions don't start out as a root find, so the objective value (for instance, of pressure) is subtracted from the listed function, which doesn't affect the derivative.  The derivates can be found algebraically fairly easily, but there's a complication in the case of R_MP.  That is a root find on a function which takes the output of another function as an argument.  That requires application of the chain rule for differentiation, but the exact way it plays out is a little bit complicated.

Multivariate Chain Rule with Composite Function



That pretty well covers everything needed to get correct and efficient implimentation of lookups for a gravity balloon.  The total list of functions are:
  • dPdR_RM (R , M , rho )
  • dPdR_Rt (R , t , rho )
  • dPdt_Rt (R , t , rho )
  • dtdR_RM (R , M , rho )
  • M_RP (R , P , rho )
  • M_Rt (R , t , rho )
  • P_RM (R , M , rho )
  • P_Rt (R , t , rho )
  • R_MP (M , P , rho )
  • R_Mt (M , t , rho )
  • R_Pt (P , t , rho )
  • t_RM (R , M , rho )
  • t_RP (R , P , rho )

As a side note, you need functions for the gravitational constant, G.  Also pi.  I implimented all of this, and put the code here:

The Visual Basic (for Excel) code link on Pastebin

This post covers the basic mathematics that underpin the entire idea.  I wanted to make this one technical post in extreme detail because I had these equations wrong before, so this is a correction of some of the things posted in this blog, although not everything.  I had made the wrong assumption that gravity within the shell would be linear, and this is demonstrably false by a couple of arguments.  I have good confidence in the equations here, and the functions seem to perform rather well to the extent of my testing so far.  It's good to have this documented well, because it forms the starting point for all of the rest of the discussions.

Friday, October 25, 2013

Inclusion of Air Pressure Effects for Super Large Gravity Balloons

Although impractically huge, the math of a gravity balloon changes a great deal when they get beyond a certain size, in large part due to the pressure of the air itself.  There are quite a few related discussions that stem from this.  On Earth, for instance, we need our large gravity well to hold in air, but it's not so much because the upper atmosphere extends to escape-able distances at thermal velocities - far from it.  In terms of sheer value of density, our atmosphere is basically gone when you reach 40 km.

That altitude represents a Delta V value (the speed you would accelerate to if you fell that height in a vacuum) of 0.6 km/s, whereas the escape velocity for Earth itself is around 11 km/s.  The role our gravity-well plays is, instead, to fight against the "boiling" off our our upper atmosphere by higher energy particles from the sun and the cosmos.

To put this in different terms, if you wanted to blanket the Earth in a sheet to hold in its atmosphere, that sheet wouldn't need to be very thick.  A simple mathematical treatment of this is to say that the pressure drops off exponentially.  You need a constant to use in that equation, which is simple, and given by this reference to be 7 km.  You can very easily see that at 40 km, you're left with less than 1% of the air pressure, according to [P = P0 exp(- h/h0 )].

One might correctly notice that this has implications for a gravity balloon.  This raises the possibility of a super large type of gravity balloon, which perhaps looks more like a gas giant planet than a space station.  Formalize the problem by requiring a habitable pressure in the center.  Then that pressure decreases as you move away from the center.  There are a few possible non-ideal consequences of this, which are quite interesting from a physics standpoint.  Most obvious, the outer regions might not be entirely habitable due to a low barometric pressure.  This would only happen for extremely large sizes, and represents the ultimate upper limit.  Second, you forfeit the zero-gravity environment for a large part of the volume.  While the outer regions aren't zero gravity, they can still be very low gravity.  Going from 1 atmosphere of pressure to near-zero pressure requires a certain potential difference, but unlike Earth, that difference may be spread over a large difference for a super large gravity balloon, resulting is a very low field at any point.  It's possible that any residual gravitational field could be counteracted by wind turbines which have relatively low energy requirements.

The world I am describing comes awfully close to the conception of the Virga world.  Coincidentally, they just came out with a new comic series set in the Virga world, which I hope to write more about later.  In addition to the changing pressures, this world has convection currents (which might be physically accurate).  The author also goes on to write in a great deal of politics and dynamics to this world, which is tangential to this blog.

I have noted (as have others) that the Virga world doesn't need to have a wall of carbon nanotubes, but I haven't given very detailed consideration to how thick the walls might need to be, or even if these walls would be stable.  Wall thickness is, after all, a function of the pressure near those walls.  The technical guidance we have for Virga is that it is 5,000 miles in diameter.  I don't think we are given a pressure at any point inside this, but I will happily assume 1 Earth atmosphere in the center.

The Mathematical System

Governing equations are straightforward, but I found them deceptively subtle to get correct.  There are number of components, so I'll outline them in a list.  The goal here is to obtain a set of 2 differential equations that describe the atmosphere pressure and gravitational field within this structure as a function of the radius.  In order to get there, we have to formalize several physics equations.

Technical steps:
  1. I used the ideal gas assumption and constant temperature.  This relates pressure and density in a linear relationship.  Use the specific gas constant to write this explicitly.
  2. Mass is taken to be a function of radius, and includes all air mass below that radius.  This is then related to the field, making use of the shell theorem.
  3. Change in mass for a differential increase in radius is the sphere surface at that radius times the air density at that radius.  This is a geometrical statement.  Additionally, density is replaced with pressure from the ideal gas equation.
  4. Initial conditions are obvious.  The gravitational field is zero at the center, and this formalization specifies the pressure at the center to be the habitable goal.
  5. The differential equation for mass is then changed to be in terms of gravitational field, which comes from making a substitution from the shell theorem.  Some algebra is done, using the chain rule of calculus, and then rearranged.
  6. Pressure falls according to the density of air and the gravitational field, in the same way that Earth's atmosphere does, which I outlined in the introduction here.  This is written in a form usable as a differential equation.
For such a large volume, transport of heat out from the center to the outer regions becomes non-trivial.  This makes the assumption of constant temperature a little dubious.  We would probably expect some falling temperature with radius.  This is still pure presumption as to how this thing would actually be built, so I'll keep T constant for now.  The equations are complicated enough as they are.

This math is a little bit intimidating, and it turns out, the system can't be directly solved easily.  In the following equations, look at the last 3 lines.  Those fully specify the differential equation system.  With the constants filled in, you can put this directly into a mathematical software package.  Unfortunately, I have not yet found such a package that will give an algebraic answer, so I will have to satisfy myself noting that it can't be done without extremely exotic functions.

Governing Equations of the system
Last three constitute complete differential equations


The constants need definition.  Since this is a technical blog, I will list all of the physical constants employed here.  The gas constant is for air at sea level.  Generally, the values are sought to provide a normal Earth room temperature atmosphere, consistent with most of this blog and the idea of Virga.  It's possible to make an extension of this math to do primitive analysis of gas giants or stars.  Hopefully I can do that as another post some other time.
  • R_{specific} = 287.058  J / (kg K)
  • T = 293 K
  • G is Newton's gravitational constant = 6.67384e-11 m3/(kg s)
With this, the system is fully specified mathematically.  You have the ability to input the above equations, with the above constants, into a numerical integrator and obtain a spatial picture of the pressure and field within one of these bodies.  I have made my own code to do these calculations available on Pastebin here.

When talking about a gravity balloon, we are terminating the gas by adding a wall (in literal terms).  By the shell theorem, we should be comfortable ignoring everything beyond whatever radius we're looking at, because the gravitational field contributions all cancel out.  That is why these mathematics are relevant for large gravity balloons.

I was also interested in the effect that setting different pressures would have.  I tested two cases, where the central pressure was 1 atm and 3 atm.  A surprising result came out of this - that the pressure at large radii was lower when starting at a higher central pressure.  Actually, this makes complete sense.  This is why gases consolidate into gas giants instead of always hanging out in a large volume at low density.  This is telling the story of gravitational collapse of gases.

Pressure versus Radius graph


This has interesting consequences for gravity balloons.  You would think that containing more gas in the same space would require more container material... but that's just not the case here.  This is the strange nature of self-gravitation.  The air holds itself in (to a limited extent).  Now, there's also the valid question of whether 3 atmospheres of pressure is actually usable, and it's likely not because of Oxygen toxicity.  Because of that, it's not at all clear how the usable volumes between both of these compare.  But for sake of argument, let's take the pressure range for the "habitable" volume to be 0.8 atmospheres to 1.0.  With that specifier, I can compare the habitable volume between these two cases.  We're imagining that the center area of the 3 atm case will be treated as uninhabitable, but people could live beyond that radius.  Honestly, I think this looks closer to the sketches of Virga.

Table of Radii that certain Pressures occur at
and corresponding volumes with given range
Radiifor thePressure
(given in km)
1 atm3 atm
0.8 atm018,384
1 atm10,98718,590
Habitablevolume
caseV (km3)
1 atm5.5562E+12
3 atm8.83007E+11


Here we see that the habitable pressure would not be increased by adding more air to the system.  That's not entirely surprising, for the same reason that Jupiter doesn't have much volume at "habitable" (again, just 0.8 to 1 atm) pressures.

Properties of the Structure

There are two mass values of interest - the mass of the wall required to hold the air in, and the mass of the air itself.  For the wall requirements, the formula I have used so far for the "large case" needs to be revised.  Going back to my original question on physics stack exchange about this question, the large case has fit the equation of [ P = 2 G pi mu2 ].  That equation takes into account the self-gravitation from the wall itself, but not the gravity from the air.  So I've wrote another equation that does take it into account.  To solve this equation, it needs to be solved for the mass-thickness of the wall, and then simply multiply by the sphere surface area at that radius and that's the wall mass.


The calculation of air mass is trivial because it follows the same equation used in setting up the differential equations to begin with.  That equation is just recycled.  Now, here are the equations.  These are in terms of P(r) and g(r), which are the pressure and gravitational field throughout the air.  These are outputs of the code that I have on pastebin.

Expressions for mass of the air and wall of super large gravity balloon
(require numerical solution of previous set of equations)



We can now look at how the two independent variables (center pressure and the radius) affect the mass needed to construct the wall of this gravity balloon and fill it with air.  With my code output and these equations, I produced the following graph to illustrate this, and it gives a good picture of the general mass scales involved for different cases.

Graph of calculated masses of wall and air
given different radii of structure

Keep in mind that this graph is still using linear scales.  In terms of general observations:
  • The material requirements for the wall never reaches an absolute maximum.  This was one of the primary questions that was motivating me.  The wall mass requirements grow at a rate below even the surface area of the volume, but it continues to grow.
  • At super large radii, the gravitational field from the air itself dominates, which isn't very surprising.
  • The cross-over point is around 20,000 km (40,000 km diameter), which has an atmospheric pressure of 0.5 to 0.7 atm.  In other words, the air gravity starts to dominate while the outer regions still remain disputably habitable.

There's now a need for better reference values.  Earth's moon has a mass of 7.3 x 1022 kg.  This is a facinating reference point, because it establishes the the maximum practical size of a gravity balloon is right around the mass of the moon.  In terms of length scales, I just want to quickly note some other bodies for comparision.

radii for comparison
  • The Moon 1,738 km
  • Virga 4,023 km
  • Earth 6,378 km
  • Saturn 60,268 km
  • Jupiter 71,492 km

Compared to what's possible, Virga is somewhat small.  My expectation was that the pressure would varry significantly between different regions in it, but that expectation has proved wrong.  Virga's outer regions would only be about 4% lower pressure compared to its center.  However, I also need to volunteer the fact that if Virga was made as a gravity balloon, the walls would have more mass than all the air (and all other stuff) on the inside.

I also wanted to write a little more on the stability of such a massive construction, but I find myself at a loss on the subject.  This analysis included effects from changing pressure over the volume and gravitational effects from the air.  These will affect the stability of the walls, but I'm not entirely sure how or to what extent.  The gravity of the air is at least partially destabilizing, just how tidal forces are.  Come a little closer to center, and the gravity increases, and vice-versa.  This is characteristically unstable, but it probably isn't a game changer.  There's also the fact that the pressure increases as you go in further, and as far as I can tell, this effect will be more significant (in any case) than the tidal forces from the air.  All of this is concerning the particular deformation of one part of the wall falling in a little bit.  It seems that the dominating factor for that contingency is what it's always been - the change in the self-gravitation of the wall.  My expectation was that the wall-self gravitation would become irrelevant on large scales because the mass-thickness of the wall declines.  That happens, but probably not to the point of irrelevancy.  Even if you go so big that wall self-gravitation didn't dominate the stability discussion, the air pressure would be the dominant mechanism for these global deformations.  Of course, there's still the matter of "local" instabilities - which consist of leaks and wall Rayleigh-Taylor instabilities.

As for other observations, I want to quickly hit the escape velocity and the wall thickness.  At around 100,000 km radius, I find the wall thickness to be around 240 meters, if I assume a density of 3.5 grams per cubic centimeter.  Crowlspace was looking at about the same thing and came up with 1,345 meters at a 200,000 radius.  Of course, with larger radius the wall thickness will decrease.  This shows that Crowlspace's number is truly quite different from mine.  I believe this is because of the nature of the calculation he was trying to do, which wasn't considering any hetrogenous spatial distribution of the gas.

For the 1 atm central pressure case, I find an absolute maximum escape velocity (from the surface, including air and wall) to be 761 m/s.  This is a facinating result, because as long as you don't change the parameters like the central pressure or density, it is the maximum escape velocity that a gravity balloon can ever have.  It's also baffling because in Newtonian gravity, the gravitational potential of an infinite sheet of matter is infinite, and in large cases of this the wall starts to look a lot like an infinite sheet.  But that doesn't happen because the wall's thickness decreases with increasing radius.  Even more surprising is the magnitude of this number.  It's just not very fast, and even a bullet from a conventional gun can meet it.

Of course, the real question is where you would get all of that air from.  Wall materials for a gravity balloon can be anything, so the moon itself would literally suffice for this large limit gravity balloon's wall.  Earth's atmosphere is made out of fairly common elements, so that's not a constraint, but they would have to be processed in some sense.  I agree with the sense that such a large habitat would be in the outer edges of a solar system, but possibly they would be a complete interstellar space.  If near some clouds of gas of plentary nebula, perhaps the gases would be easier to collect.  I don't doubt that some dumb rock for the wall materials would be hard to find either.  But there's still the matter of turning whatever gas you have into molecular Nitrogen and Oxygen.  It's certainly a reasonable idea for speculation.  The scale is just so impossible for a humble human to consider.  A habitable area could literally exist accross a region 2 times the diameter of Earth.  The math tells us that is easily possible in terms of pressure alone.  But what would anyone do with all that space?

Thursday, March 14, 2013

Gravity Balloon Pressure-Volume Curve and Rotation

One complication is that the pressure of a gravity balloon habitat wouldn't be constant as you increase the inner volume by adding more air, or "blowing it up".  That's a reality that would have to be dealt with unless you could add a significant (really significant) amounts of mass to the outer surface.  This is a similar reason to why the the window of usable asteroids is limited in the first place, but it is particularly problematic if you want to start small and get bigger without huge swings in the habitat pressure.  Here, I'm going to talk about some of the basics and how rotation could be used to mitigate this swing.

Non-Rotating Pressure-Volume Relationship

(later EDIT note: early versions of this did have some wrong math, and equations have since been updated to be correct)

With spherical symmetry, even if you have the inside filled with air, the simplifications from spherical symmetry are still there.  To find the internal pressure for a gravity balloon, you would integrate the gravitational field times the density - the same relationship that causes pressure under water to increase with depth on Earth.  The relationship in simple terms is:

$$P = \int_{R}^{R+t} \rho g(r) dr $$

The least obvious part is the function $g(r)$. This is the gravity as a function of radius from the center. It is, in truth, a piecewise function - zero in the middle, non-zero inside the rock walls, and then becomes a conventional $1/r^2$ beyond the surface of the rock walls. The above integral is only concerned with the field inside the rock wall. That is written here.

$$ g(r) = g_{solid}(r) - \frac{\text{missing rock mass due to air}}{R^2} \\ g(r) = \frac{4}{3} \pi G \rho r - G \frac{\frac{4}{3} G \rho R^3 }{r^2} $$

$$ P = \frac{1}{2} \rho \frac{GM}{(R+t)^2} t $$

Where

  • R - inner radius
  • t - thickness of the shell
  • M - shell mass

To run practical scenarios, it gets more complicated than this because the mass of the asteroid is a function of the other variables, the density, inner radius, and outer radius.  Substituting that leads to the cubic that you can see in the result, with more detail here.

I implemented some functions that solve this numerically.  A fun detail is that the shape of the function is the same if you appropriately scale it to the size you're looking at.  That means I can cite the relationship for all gravity balloons (or at least the ones that don't spin) in a single graph.  To do this, I'm using a relative radius and a relative pressure.  The pressure is relative to the pressure in the center of the asteroid before any volume in the center is carved out, and the radius is relative to the outer radius at this point, and a similar reference is used for the volume.


This shows that the pressure actually drops off awfully quickly with volume since it falls (nearly) linearly with radius.  So, let's look at how rotating the asteroid can decrease the initial pressure, and particularly, decrease the ratio of initial pressure to the final pressure.

Rotating Pressure-Volume Relationship

If we imagine as asteroid before we insert any air into the middle, that internal pressure will be affected by the rotation.  This can be argued from the simple fact that rotation itself works as a pseudo gravitational field.  So the gravitational potential that "counts" is the gravitational potential plus the rotational potential.


The important thing to note is that the rotational potential has the opposite sign of gravitational.  That means that it decrease the internal pressure because it decreases the overall "force" that the upper layers can exert on the lower layers.  So, how would this affect things?  I tried to answer this using an extremely simple approximation.  The details of more sophisticated corrections are discussed here, while the complications from non-linear effects were asked about here, although no real conclusions were found.  Without considering the deformation of the shape itself, one will wind up underestimating the effects, so that does need to be kept in mind.  The level of pressure for the 3.5 hour rotation period I'm giving here is actually probably closer to a 2 hour rotation period, which I've seen quoted by NASA as generally the practical limit of what any body could rotate at.

It should also be noted that the shape deformation depends only on the density and rotational speed.  It doesn't depend on size.  This can be confirmed to one's self by noting that the divergence of the gravitational field and the rotational pseudo-field are both constants.  The former has density in it and the latter has rotational speed.  These numbers are certainly inaccurate, but the general relationship is definitely real.


Here, what I've done is to keep the angular momentum of the system constant while increasing the volume of the inner sphere.  That means what you see about is what you'll see if you start it rotating at the stated rate and start inflating the center.  The moment of inertia increases so the rate of rotation decreases, and this is what decreases the slope rate of decrease of pressure?

How would you go about rotating such a large asteroid?  Well, it's likely already rotating.  If you go through the list, you find that even fairly large asteroids tend to cluster below a 10 hour rotation.  This makes sense when you think about the fact that Earth was slowed down over billions of year by tidal forces that these bodies do not see.  So it's possible that some fast-spinning ones would have a fairly flat pressure-volume curve for inflating them without any additional action by us.  But even so, some major fractional drop in pressure looks unavoidable.

Nonetheless, people can actually tolerate a range of pressure, particularly if the gas composition can be intelligently adjusted.  Plus, if a civilization was advanced enough to inflate an asteroid to large internal volumes, they would likely not find it all that difficult to add rotation themselves - giving fine tuning control of pressure.  For modest volumes it wouldn't matter that much in the first place.