-
Notifications
You must be signed in to change notification settings - Fork 462
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Weather Balloon script crash #654
Comments
The program crashes at jsbsim/src/models/FGGasCell.cpp Lines 317 to 330 in 33735db
By setting a minimum value of Contents =
- max(0.0, Contents - Pressure * VolumeValved / (R * Temperature));
+ max(1E-8, Contents - Pressure * VolumeValved / (R * Temperature)); |
Setting the minimum content to 10-8 is a workaround to avoid the crash. The mere fact that this formula can empty the balloon until its interior volume is zero makes it questionable. @andgi I know you wrote a disclaimer in the code about the formula you used to compute the valved flow of a balloon, but I am surprised that the weight of the column of air In addition, I have the feeling that the sign of since |
Actually I am now certain the formula is wrong because jsbsim/src/models/FGGasCell.cpp Lines 324 to 325 in 33735db
Indeed the computation of which gives: So the air quantities |
Hi Bertrand,
It is some years since a last looked at this code (seems to be in 2008),
but I'm not sure the computation of the delta pressure at the manual
control release-valve at the top of the gas cell is wrong. The "standard"
pressure in the gas cell is computed for the bottom of the cell (and at
least as large as the air pressure). The pressure difference at the top is
the difference in gas and air pressure at the bottom plus the difference
from the height of the gas cell.
Cheers,
Anders
…On Sun, 12 Jun 2022 at 13:30, Bertrand Coconnier ***@***.***> wrote:
Actually I am now certain the formula is wrong because AirDensity should
have the same sign than AirPressure in the code below:
https://github.com/JSBSim-Team/jsbsim/blob/33735db0fb1e4fdf47f253a4215dbe3bb63a8e92/src/models/FGGasCell.cpp#L324-L325
Indeed the computation of $\Delta P$ is subtracting two $P+\rho gh$:
$$P_{air}=P^0_{air}+\rho_{air}gh$$
$$P_{gas}=P^0_{gas}+\rho_{gas}gh$$
which gives:
$$\Delta P=P_{gas}-P_{air}=P^0_{gas}+\rho_{gas}gh-P^0_{air}-\rho_{air}gh$$
$$\Delta P=(P^0_{gas}-P^0_{air})+(\rho_{gas}-\rho_{air})gh$$
So the air quantities $P^0_{air}$ and $\rho_{air}$ have the same sign
which they don't in FGGasCell.cpp as shown above. And as I wrote
previously the air column weight is pushing ambient air inside the balloon.
—
Reply to this email directly, view it on GitHub
<#654 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACDXMKRKIPLMKJFFEWBKTODVOXC2BANCNFSM5YQRCHVA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Hi Anders,
Thanks for the explanation. I think I got the idea: This makes me realize that I had assumed that the valve was located at a position below the reference pressure It remains that the physics is somehow wrongly simulated in Since the mass flow is generated by the pressure difference |
Discussed in #643
Originally posted by @dpculp June 5, 2022
When executing the script weather-balloon.xml as supplied by the repo I get a core dump "Floating point exception" after about 4980 seconds of virtual time. This is at the point in the flight around 92K feet where the balloon is deflating and beginning descent.
I changed the termination event to stop execution at 80K feet of altitude and the script ran perfectly.
It seems the transition from ascent to descent is not working presently in the weather balloon (gas cell) model. I'll investigate further.
The text was updated successfully, but these errors were encountered: