cuspaceflight / bamboo

Cooling system modelling for liquid rocket engines.
GNU Affero General Public License v3.0
16 stars 4 forks source link

Coolant velocity varying in straight vertical channels #23

Closed dug20 closed 3 years ago

dug20 commented 3 years ago

In this example, the vertical coolant channels are straight, so their area shouldn't be changing, but it seems the static pressure calculations might be thinking the channels are following the inner contour (i.e. the inside wall of graphite in this case).

image image

hf360F commented 3 years ago

Yeah I first noticed this before the ablative got added and was wondering how the channels would be built with varying width. Spiral + ablative engines will also be affected, but in a less obvious way - the length returned by channel_geometry will be too short, because the spiral radius will be wrong.

I think the has_ablative flag is a good way to fix this, but it seems to me like the ablator can be added after the regen jacket, so the CoolingJacket object can't necessarily inherit that information from the engine.

What I've done is add two checks - One is in add_cooling_jacket - if an ablator has already been added, then this is passed into the CoolingJacket configuration. The second is in add_ablative - if a CoolingJacket has already been added, then the has_ablator attribute that's been added to CoolingJacket is set to True. (at the moment an exception is raised if there is no cooling jacket but I put it in an if statement in case ablative only is added)

This should handle all types of engine and both ways of creating an engine with regen and an ablator.

CoolingJacket now inherits the engine geometry in order to have access to the maximum engine radius, so it can ignore the y values used for the nozzle contours. Then, in CoolingJacket.A(), if has_ablator (for the CoolingJacket) is true then the radius is always the chamber radius, the y value is disregarded. In Engine.channel_geometry(), has_ablator (for the Engine) is true, then the spiral radius is similarly always the chamber radius.

New result with vertical channels in regen_ablative_example: image

And for spiral channels, much more subtle: image

hf360F commented 3 years ago

There was a bug in how the spiral channel length was worked out, the spiral length should be longer, not shorter, with the fix in place because the radius never decreases below chamber_radius, so it didn't make sense that the "fixed" pressure drop is lower. This bug is now also fixed.