Jump to content

[1.8x - 1.11x] Kerbal Weather Project (KWP) v1.0.0


cmet24

Recommended Posts

Spectacular job on this.

I did some reading and noted that the U.S. Standard Atmosphere assumes a CO2 concentration of 317 PPM. Do you have the ability and interest in re-running the simulation at the current 410 PPM? I'd love to see some graphs of the difference. Perhaps over a timespan of 30 years instead of 5?

Link to comment
Share on other sites

On 2/3/2021 at 6:05 PM, FleshJeb said:

Spectacular job on this.

I did some reading and noted that the U.S. Standard Atmosphere assumes a CO2 concentration of 317 PPM. Do you have the ability and interest in re-running the simulation at the current 410 PPM? I'd love to see some graphs of the difference. Perhaps over a timespan of 30 years instead of 5?

@FleshJeb Thanks! That's an excellent point you make regarding CO2 concentrations. Looking through the MPAS code it appears that the shortwave and longwave radiation schemes use CO2 concentration values from  2005, citing the 2007 IPCC report.  In the code the COconcentration is set to 379 ppm.

mpas-code.png

Unlike CO2, Ozone (O3 ) is provided from the GFS initialization data, which was retrieved for the year 2017.  Since the O3 concentrations in the MPAS Kerbin simulation are derived from Earth data there is actually a minimum in ozone concentration over the southern polar region of Kerbin. This actually results in lower stratospheric temperatures, on Kerbin, being cooler over the south pole than the north pole. 

Edited by cmet24
Add hyperlinks
Link to comment
Share on other sites

Wow, this is  pretty cool project. I was wondering if you could comment on the feasibility of doing something like this outside of the context of KSP, on any arbitrary terrain--basically, if I wanted to simulate climate on my own fantasy planet, would this be a sensible approach?. How difficult was the process of getting the model set up and including novel terrain? I also see that you made your own server to run the program--do you think it would possible to do something similar, if much much slower, on a typical home computer?

Link to comment
Share on other sites

On 2/14/2021 at 4:59 AM, loki130 said:

Wow, this is  pretty cool project. I was wondering if you could comment on the feasibility of doing something like this outside of the context of KSP, on any arbitrary terrain--basically, if I wanted to simulate climate on my own fantasy planet, would this be a sensible approach?. How difficult was the process of getting the model set up and including novel terrain? I also see that you made your own server to run the program--do you think it would possible to do something similar, if much much slower, on a typical home computer?

Well, not saying anything about the possibility, but a while back I did a quick back-of-the-envelope calculation earlier based on what was posted in that website, and found that it would take aproximately two months to run on my laptop if it did indeed work. So, at the very least, you'll need to be able to have your computer on for several weeks straight, while probably also not using it at all.

Link to comment
Share on other sites

after... the most recent, or the 2nd most recent patch, the climatology doesn't seem to work; if I open the window in flight and click WIND and X-WIND, I see valid values for X-WIND, but WIND shows 0 knots at 180 deg, *always*.  It worked before, not sure exactly when it stopped... if I change it from climatology to the static wind model, the wind speed and direction once again shows up.

Link to comment
Share on other sites

On 2/16/2021 at 8:01 PM, ss8913 said:

after... the most recent, or the 2nd most recent patch, the climatology doesn't seem to work; if I open the window in flight and click WIND and X-WIND, I see valid values for X-WIND, but WIND shows 0 knots at 180 deg, *always*.  It worked before, not sure exactly when it stopped... if I change it from climatology to the static wind model, the wind speed and direction once again shows up.

@ss8913 Thanks for posting. I caught this issue myself last weekend and just now had time to fix it. This problem with the wind GUI has been resolved in the latest update for KWP (version 1.0.4)

Edited by cmet24
Link to comment
Share on other sites

On 2/14/2021 at 4:59 AM, loki130 said:

Wow, this is  pretty cool project. I was wondering if you could comment on the feasibility of doing something like this outside of the context of KSP, on any arbitrary terrain--basically, if I wanted to simulate climate on my own fantasy planet, would this be a sensible approach?. How difficult was the process of getting the model set up and including novel terrain? I also see that you made your own server to run the program--do you think it would possible to do something similar, if much much slower, on a typical home computer?

@loki130 So you can run a numerical weather model on your laptop. I've run the Weather Research and Forecasting (WRF) model from my own laptop in the past. However, doing so comes with significant limitations.  The main constraint is memory. Memory constraints severely constrain your domain size and model resolution. Swapping out terrain is challenging because it involves not just changing the terrain but a slew of other variables such as land use, vegetation type, green fraction, etc. 

Alternatively, its feasible to run simpler models on a laptop. For example, a simple two-layer quasi-geostrophic (QG) model or barotropic model (see here). Unfortunately, these simple models don't typically consider the effects of terrain. 

Edited by cmet24
Link to comment
Share on other sites

22 hours ago, ItsJustLuci said:

does this mod add precipitation?

 

@ItsJustLuci So precipitation information is included with the mod, and is available to fellow modders via the API. In space, KWP provides information on precipitation rate. That said, there are no visual effects added by this mod. Rain, snow, etc. won't affect your launches. Precipitation, cloud cover, and visibility are provided via the KWP API mainly so that other modders could utilize the data to design visual effects or incorporate it into their mods.

Edited by cmet24
Link to comment
Share on other sites

On 2/28/2021 at 3:25 PM, cmet24 said:

@ItsJustLuci So precipitation information is included with the mod, and is available to fellow modders via the API. In space, KWP provides information on precipitation rate. That said, there are no visual effects added by this mod. Rain, snow, etc. won't affect your launches. Precipitation, cloud cover, and visibility are provided via the KWP API mainly so that other modders could utilize the data to design visual effects or incorporate it into their mods.

dyk if anyone has made rain? I am interested in doing so for RSS

 

Link to comment
Share on other sites

  • 3 weeks later...

This is insane and one of the things I've been waiting for this game besides clouds!!!

Speaking of clouds, it is just the only thing missing, weather effects, even if purely visual just to go along with the mod information would be awesome!

:D

Link to comment
Share on other sites

  • 2 weeks later...
  • 3 weeks later...
On 2/1/2021 at 11:12 AM, Cochise said:

I updated to 1.0.3 ...still having the same problems. Vessel loads on runway, frozen in place. If I hit Toggle KWP, the vessel drops a foot or two and then it is moveable/flyable. But KWP window shows no wind or weather whatsoever. If I hit Toggle KWP again, my vessel starts floating and spinning counter clockwise... and while the control surfaces respond to keystrokes, the craft doesn't respond at all, and is just stuck in the air spinning around slowly. If I try pushing Weather, nothing happens. If I try pushing Climatology, nothing happens. Then if I try pushing Toggle Weather at KSC while stationary on the ground, all of the sudden it's pitch black, you can see through my craft, through Kerbin, and into space, so my plane looks like it's a window to the other side of the planet. If I push the same button while moving or in air, it goes pitch black, and either crashes the game right away or my plane explodes and if I'm lucky I can hit escape and revert to SPH.

I have tried it several times now and can't figure it out. It doesn't help that there's no way to tell if the mod is enabled or not... the window doesn't tell me, and since there is no weather/wind showing up no matter what I push, I can't tell that way either. 

My modded install takes too long to load to have my game keep crashing or for me to keep trying different buttons/sequences like this. Idk what to tell you man. I can post my log again but all I did was update to the new version. Im going to be uninstalling for now. Lmk if you get it working. Hope this was helpful, thats why I'm posting it. 

 

I too am having this issue of being stuck on the launch pad but with my rocket.  Toggling the weather sent my rocket tumbling like crazy.  I have uninstalled the mod for now.

Link to comment
Share on other sites

On 4/22/2021 at 5:29 PM, SpeacX said:

Does this work with normal scale RSS earth?

@SpeacXPersonally, I haven't tried it with RSS.  I would give it a try and see what happens!

One issue you may run into is that the atmospheric boundary in RSS is higher than in stock KSP.  The MPAS data KWP uses is valid up to 70 km ASL. So, if your altitude is above 70-km ASL (and your in the atmosphere) KWP will retrieve weather/climate data from the highest model level (i.e. 70-km). That is there would be no vertical changes in weather/climate data above 70-km. 

Oddly enough KWP's atmosphere is more similar to Earth's than stock KSP since the scale height in MPAS simulations matches that of Earth (8.5 km) not Kerbin (5.6 km). 

On 4/18/2021 at 7:39 PM, traisjames said:

I too am having this issue of being stuck on the launch pad but with my rocket.  Toggling the weather sent my rocket tumbling like crazy.  I have uninstalled the mod for now.

@traisjames Thanks for sharing your issues. I've yet to re-create this issue myself but when I do hopefully I'll find a fix for it! 

On 3/30/2021 at 12:33 PM, Dman979 said:

I have to ask- how did the presentation go?

@Dman979 Pretty well! My university seminar was great. I got a lot of good questions and had a fruitful discussion about global circulation and heat-transport! 

By the way, I've shared my presentations (poster and seminar slides) on the KWP website where they're available to download. 

Edited by cmet24
Link to comment
Share on other sites

  • 1 month later...
On 3/2/2021 at 8:03 PM, ItsJustLuci said:

dyk if anyone has made rain? I am interested in doing so for RSS

 

Did you end up making rain? This mod is so awesome, just needs the visual feedback

Link to comment
Share on other sites

  • 1 month later...

32d23e_ce5daa01b563436897c02419631b8954~mv2.pngThe top post makes it clear that the wind simulation creates abnormal physics, with the parachute of a free falling body tilted off from vertical, but I though I'd try a sailboat anyway.

 

I set up a 20-knot wind from the east, so Jeb is on starboard tack with wind coming from his right.  As soon as the boat starts to drift downwind, the weather vane swings as if to indicate that the wind is coming from the west.  The boat settles in to moving backwards.

S0v8RIX.jpg01ihgq9.jpg

Similar strangeness is seen flying and airplane in a crosswind, again coming out of the east. We would expect to point our nose a few degrees east of North, in order to have a north-bound ground-track, with level wings.  But the only steady configuration I could find has me banking toward the east, which strangely does not result in the aircraft turning.

It looks like some kind of vector addition is done to figure the airspeed, but then the direction of the relative airflow is determined by looking at our velocity over the ground --- for lifting surfaces at least; parachutes seem to follow a different rule.  So sailboats, would work very differently in this world's physics.

Link to comment
Share on other sites

  • 4 weeks later...

I'm having an Issue where KWP prevents fairings from occluding drag (for all parts inside the fairing).  In other words, KWP stops stock fairings from working.

I am running KWP (from CKAN) in KSP 1.12.2 rather than 1.11, which is why I haven't included more detail, but when this Mod is finally updated, please look into fixing this issue.

Thanks:)

Edited by Infinite_Maelstrom
clarity
Link to comment
Share on other sites

On 8/19/2021 at 1:57 PM, OHara said:

It looks like some kind of vector addition is done to figure the airspeed, but then the direction of the relative airflow is determined by looking at our velocity over the ground --- for lifting surfaces at least; parachutes seem to follow a different rule.  So sailboats, would work very differently in this world's physics.

@OHara So the way the wind simulation works, is that it performs vector addition twice. First the total velocity of the vehicle in the absence of wind is calculated (this is the stock velocity). Next the wind velocity vector is subtracted from the stock velocity vector to get an estimate of the true velocity of the vehicle. Now,  this calculation alone does nothing. To actually make wind have an impact in the game, forces are applied to the vehicle.  In-game forces (e.g. lift and drag) are calculated using the stock velocity estimate and then again using the true velocity estimate. Forces are calculated twice since lift/drag depends upon the velocity of the vehicle. Finally, the difference in the calculated forces, between the stock velocity and true velocity, is computed. This difference in magnitude, representing the force of the wind, is then applied to each part. Note that forces are calculated separately for individual parts. The code for this is available here and is present between lines 190 - 300. Even if you're not familiar with C# I've commented the lines to specify what they do. :)

The ground speed is calculated by the stock game. KWP calculates the true airspeed by subtracting the wind speed from the ground speed. In this convention a negative windspeed  (i.e., a headwind) results in a higher airspeed. Relative winds are calculated using vector projection. The code for this is fairly straightforward and is available here (between lines: 387-396)

Edited by cmet24
Link to comment
Share on other sites

2 hours ago, cmet24 said:

Forces are calculated twice since lift/drag depends upon the velocity of the vehicle.

This is the key of what surprised me.  Aerodynamic forces really depend only on the velocity of the craft relative to the air.

(Now, pilots tend to believe that speed relative to the ground matters, and that wind is a separate force, due I think to intuition gained from experience on the ground.  Part of pilot training is to recognize the error of "the myth of the downwind turn" which claims that an airplane taking off upwind will loose airspeed due to wind upon turning downwind; in fact, pilots see the ground and in such a turn the pilots often subconsciously reduce their airspeed.)

I realise that the point of the mod is the weather simulation, not adjusting KSP's craft-physics.  But I can read C# and having your description of the intent maybe I will be able to suggest a realism-boosting simplification on the github.

Edited by OHara
grammar
Link to comment
Share on other sites

@OHara Sounds good to me! Feel free to fork the repo on GitHub. In designing the mod my original goal was simply to make weather have an influence on flight and reentry. I acknowledge that the implementation of wind in the game is far from perfect (especially on the ground). The game physics are a little finicky, which is part of the reason why I think there are so few wind mods in existence! That said, If you have any ideas on how to improve realism I'm all ears! :)

KWP has been updated to version 1.0.5 

Update for KSP 1.12

  • Fixed issue that prevented fairings from occluding drag.
  • Updated DLL references.

Thanks to @Infinite_Maelstrom for pointing out the fairing occlusion bug.

Edited by cmet24
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...