- #1
Glurth
- 59
- 0
I have a simulation I'm trying out (for fun). A self-gravitating ball of gas, in deep space. (The sim uses a fixed-time-step for each iteration.)
I'd like to use Boyles Ideal gas law, the force of gravity, and energy as internal heat. (I don't want to touch enthalpy unless I don't realize it.) This sim will ignore relativity, and gradient of internal pressure (assumes constant homogeneous pressure within the ball or gas).PV=nRT (R being the ideal gas constant)
Since I'm using a single type of matter, and I'm not really concerned with the scale of each unit, I'm simplifying this to use the total mass of the gas ball (M):
PV=mass * T
I'd like to define Temperature using internal heat (H)
T = mass * internal heat
PV= mass^2 * internal heat
p= mass^2 * internal heat/Volume
Given a ball of Radius (R) the Volume is (4/3)*pi*R^3
P= mass^2 * internal heat/((4/3)*pi*R^3)
Pressure is the Force time the surface area(S).
FS=P
Given a ball of Radius (R) the surface area(S) is 4*pi*R^2
F=P/4*pi*R^2
F= mass^2 * internal heat/((4/3)*pi*R^3 *4*pi*R^2 )
F= mass^2 * internal heat * Constant/R^5
OK, so I'm pretty confident in the above, but please point out any mistakes.
Now, how do I compute force or pressure, due to gravity?
F=GmM/r^2
Obviously, I use the mass of the gas-ball for capital M, and I suspect, the radius for r, but what do I use for lowercase m?
Goal: I'd like to be able to add the force due to the gas pressure and the force due to gravity, and use this force sum to accelerate the Radius.
I will keep track of the radius velocity(change in radius per unit time), adjusting each iteration by the acceleration of the radius.
F=ma
Fsum = m * (acceleration of radius)
But I'm not sure if I should be using the entire mass of the gas ball here for the variable "m", though I'm not sure what else would be applicable. Perhaps some fraction of the mass, related to the current radius and its velocity?
I will use the radius velocity to determine the distance traveled, over the period of the time the force is applied.
I like to extract the WORK applied (by gravity pulling in), or used (by gas pressure pushing out)
W=Fs
Work= Fsum + distance of Radius change
The work done/used can then simply be added to the internal heat.
Then we run another iteration using the new radius, radius velocity, and internal heat.
I'd like to use Boyles Ideal gas law, the force of gravity, and energy as internal heat. (I don't want to touch enthalpy unless I don't realize it.) This sim will ignore relativity, and gradient of internal pressure (assumes constant homogeneous pressure within the ball or gas).PV=nRT (R being the ideal gas constant)
Since I'm using a single type of matter, and I'm not really concerned with the scale of each unit, I'm simplifying this to use the total mass of the gas ball (M):
PV=mass * T
I'd like to define Temperature using internal heat (H)
T = mass * internal heat
PV= mass^2 * internal heat
p= mass^2 * internal heat/Volume
Given a ball of Radius (R) the Volume is (4/3)*pi*R^3
P= mass^2 * internal heat/((4/3)*pi*R^3)
Pressure is the Force time the surface area(S).
FS=P
Given a ball of Radius (R) the surface area(S) is 4*pi*R^2
F=P/4*pi*R^2
F= mass^2 * internal heat/((4/3)*pi*R^3 *4*pi*R^2 )
F= mass^2 * internal heat * Constant/R^5
OK, so I'm pretty confident in the above, but please point out any mistakes.
Now, how do I compute force or pressure, due to gravity?
F=GmM/r^2
Obviously, I use the mass of the gas-ball for capital M, and I suspect, the radius for r, but what do I use for lowercase m?
Goal: I'd like to be able to add the force due to the gas pressure and the force due to gravity, and use this force sum to accelerate the Radius.
I will keep track of the radius velocity(change in radius per unit time), adjusting each iteration by the acceleration of the radius.
F=ma
Fsum = m * (acceleration of radius)
But I'm not sure if I should be using the entire mass of the gas ball here for the variable "m", though I'm not sure what else would be applicable. Perhaps some fraction of the mass, related to the current radius and its velocity?
I will use the radius velocity to determine the distance traveled, over the period of the time the force is applied.
I like to extract the WORK applied (by gravity pulling in), or used (by gas pressure pushing out)
W=Fs
Work= Fsum + distance of Radius change
The work done/used can then simply be added to the internal heat.
Then we run another iteration using the new radius, radius velocity, and internal heat.