Skip to content
This repository was archived by the owner on Jun 13, 2023. It is now read-only.

Mary branch#61

Open
Maryy1235 wants to merge 5 commits intomainfrom
MaryBranch
Open

Mary branch#61
Maryy1235 wants to merge 5 commits intomainfrom
MaryBranch

Conversation

@Maryy1235
Copy link
Copy Markdown
Contributor

@Maryy1235 Maryy1235 commented Mar 21, 2023

Summary

This PR addresses Jira ticket CISLUNAR-446

Testing

Notes

Comments

  • Add an x between the brackets if you commented your code well!

Chuqi Yuan and others added 2 commits March 25, 2023 16:07
… of hydrogen gas production, and rate of oxygen gas production
…minimum spin requirement and minimum water height), also changed some parameters and state variables to account for non-constant electrolyzing rate
@Maryy1235 Maryy1235 requested a review from tmf97 April 22, 2023 18:43
Copy link
Copy Markdown
Member

@tmf97 tmf97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solid start. Let's make sure that the model we're implementing is representative of the propulsion system architecture.

# log the critical chamber temperature
if (chamber_temp <= np.array(self._parameters.temperature_min) or
chamber_temp >= np.array(self._parameters.temperature_max)):
log.critical("Chamber temp is out of range")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For all these log.critical calls, we should set the electrolysis rate to 0 (instead of just logging) to tell the sim that we can't electrolyze.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe implementing that functionality is for another time, though. Leave a comment with a jira ticket number to track this TODO

# fuel tank
self.tank_volume = 1
self.electolyzer_rate = 10.0 * (1/1000)
self.tank_length = 1 # m
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A 1x1x1 meter cube of water is 1000 liters. The 12U design is big, but not that big. Ask prop team what the current best approximate dimensions/geometry of the prop tanks are and update these values.

self.min_ang_vel = 0.0
self.min_height = 0.0

self.temperature_min = 5
Copy link
Copy Markdown
Member

@tmf97 tmf97 Apr 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's edit this variable name to specify that this is specifically the electrolyzer temp min/max

force_propulsion_thrusters: float = 0.0
fuel_mass: float = 0.0
chamber_temp: float = 0.0
fuel_mass: float = 0.0 # mass of water
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if the prop architecture has changed since I graduated, but from what I remember there are three states that we need to keep track of in the sim:

  • mass of liquid water in the propellant tank
  • mass of gaseous H2/O2 in the propellant tank
  • Mass of gaseous H2/O2 in the combustion chamber

I hope there's some better documentation than a review comment by a graduated student, but the flow of propellant through the propulsion systems goes like so:

Inside the propellant tank:

  • liquid water gets electrolyzed into gaseous h2/o2.
  • the gaseous h2/o2 bubbles up through the water into an open space above the surface of the water, but still in the propellant tank (called the "ullage")

Between propellant tank and combustion chamber:

  • the gas in the propellant tank flows through a one-way check valve into the combustion chamber until the pressure in the propellant tank equals the pressure in the combustion chamber.

Inside the combustion chamber:

  • gas accumulates until we stop electrolyzing
  • once we fire the thruster, the mass of gas in the combustion chamber gets expelled into space (i.e. goes to 0 from the spacecraft's perspective). The mass of the liquid and gaseous water in the propellant tank remains unchanged through this event.

Sorry if this is way too ramble-y. Double check with prop team first to make sure that the model you're writing is representative of the prop system.

Comment on lines +79 to +80
"Electrolyzer rate (kg/s)": self._electrolyzer_rate, "H2 Production Rate (Moles/s)": h2Rate,
"O2 Production Rate (moles/s)": o2Rate, "Time it was on": onTime
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do the keys of this dictionary need to match the variable names of the corresponding state in state.py?

Comment on lines -57 to +60
D_T = 0.1 # timestep in seconds
D_T = 250 # timestep in seconds
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is definitely beyond the scope of this PR, but I'm not a fan of setting the integrator's delta-T in the constants.py file, we should probably feed it in as part of a given sim's parameters JSON. Please make a jira ticket to track this change.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants