Jump to content

[WIP] Nert's Dev Thread - Current: various updates


Nertea

Recommended Posts

Yeah, that's pretty much the gist of my abhorrent wall of text on the previous page. :P The amount of heat sent into the radiators throttles itself down to maintain norminal temperature, and power output depends on temperature alone. You can get full output with whatever radiator is able to hold steady state at 5% reactor control setting.

Edited by Streetwind
Link to comment
Share on other sites

Agree with Streetwind. Ec production should scale with heat flow, not temperature.

Currently it seems that heat that does not go through radiators, just radiates directly to space. And when that direct radiation flow exceeds some limit, core starts overheating.

Link to comment
Share on other sites

I see that some values of ModuleCoreHeat are close or equal to that of stock RTG, which is designed to radiate by itself.

I'll see what would happen if I set HeatRadiantMultiplier = 0 on reactor...

Nothing seems to be different.

Edited by Psycho_zs
Link to comment
Share on other sites

LOL!

A good chunk of sleep time is definitely required.

 

Does anyone know where to find the latest docs on stock modules?

While it seems impossible to tie energy production to heat flow using stock modules, There may be a way to find a balance between ModuleCoreHeat/CoreTempGoal at which the heat starts being pulled, and ModuleResourceConverter/ThermalEfficiency,TemperatureModifier curves. So the peak of energy production would be at the point where radiators need to actively pump heat. The upper cap would be DefaultShutoffTemp value.

Edited by Psycho_zs
Link to comment
Share on other sites

37 minutes ago, Streetwind said:

- fuel usage must scale with the reactor control slider, if it is really meant to signify the reaction rate. That you burn more fuel with a higher reaction rate only makes sense, yes? :P
 

I think it makes more sense to assume there's a smart reactor controller involved, and have the exposed interface be a targeted maximum throttle; while nuclear fuel consumption should depend on the actual amount of heat generated and discarded.   If you don't have enough radiator capacity, the controller will just slow down the reaction (and extend the core life) to avoid meltdowns.   I'm sure that will disappoint the explody segment of the user community though...

Link to comment
Share on other sites

...I'm onto something, stay tuned.

OK, now I'm frustrated and tired too. The core leaks heat somewhere, it states RadUsage: 249, despite all radiators are retracted and insulation is 100% for testing.

How is the core's mass defined?

And where the heck does VAB stats "insulation" thingy come from? It stays at 1% no matter what HeatTransferMultiplier and CoolantTransferMultiplier values are.

Edited by Psycho_zs
Link to comment
Share on other sites

1 hour ago, billkerbinsky said:

I think it makes more sense to assume there's a smart reactor controller involved, and have the exposed interface be a targeted maximum throttle; while nuclear fuel consumption should depend on the actual amount of heat generated and discarded.   If you don't have enough radiator capacity, the controller will just slow down the reaction (and extend the core life) to avoid meltdowns.   I'm sure that will disappoint the explody segment of the user community though...

With parts that cost this much, they can find something else to blow up (its not like they even explode that spectacularly).

Link to comment
Share on other sites

I'm in desperate need of better descriptions of core and converter parameters.

What I've deduced so far is that core operates on energy amounts, rather than temperature, and CoreEnergyMultiplier is a way to set thermal mass of the core.

By the way, given that we have core heat, thermalMassModifier for reactors can be set to 1.

Edited by Psycho_zs
Link to comment
Share on other sites

This is my test cfg for MX-4 reactor. Convertor config is partially based on Roverdude's 1.25m reactor.

The idea I want to implement here is this: rapid increase in energy production near CoreTempGoal, where radiators come to play. Heat output actually scales with ThermalEfficiency (:huh:) so I had to tune TemperatureModifier curve to counteract. But thermal engine freaks out at the point of transition. So this idea is busted.

Spoiler

// Near Future Electrical 0.6.0
// Fission Reactor - 1.25m
PART
{
	// --- general parameters ---
	name = reactor-125
	module = Part
	author = ChrisAdderley

	// --- asset parameters ---
	mesh = reactor-125.mu
	rescaleFactor = 1

	TechRequired = nuclearPropulsion
	entryCost = 275000
	
	// --- node definitions ---
	// definition format is Position X, Position Y, Position Z, Up X, Up Y, Up Z
	node_stack_top = 0.0, 1.585, 0, 0.0, 1.0, 0.0, 1
	node_stack_bottom = 0.0, -0.70, 0, 0.0, -1.0, 0.0, 1
	

	// --- editor parameters ---
	cost = 136000
	category = Utility
	subcategory = 0
	title = MX-4 'GARNET' Fission Reactor
	manufacturer = Kerb Kastria Inc.
	description = The MX-4 is a compact fission reactor that produces up to 400 kW of electric power. Be sure to attach enough heat radiation capacity to run it!
	// attachment rules: stack, srfAttach, allowStack, allowSrfAttach, allowCollision
	attachRules = 1,0,1,1,1

	// --- standard part parameters ---
	mass = 1.22
	dragModelType = default
	maximum_drag = 0.2
	minimum_drag = 0.2
	angularDrag = 1
	crashTolerance = 8
	bulkheadProfiles = size1
	
	// heat parameters
	emissiveConstant = 0.15
	heatConductivity = 0.005
	maxTemp = 1600
	thermalMassModifier = 1

	breakingForce = 200
	breakingTorque = 200
	MODULE
	{
		name = ModuleResourceConverter
		ConverterName = Reactor
		StartActionName = Start Reactor
		StopActionName = Stop Reactor
		INPUT_RESOURCE
		{
			ResourceName = EnrichedUranium
			Ratio = 0.00000160
		}
		OUTPUT_RESOURCE
		{
			ResourceName = DepletedFuel
			Ratio = 0.00000150
			DumpExcess = false
			FlowMode = NO_FLOW
		}
		OUTPUT_RESOURCE
		{
			ResourceName = ElectricCharge
			Ratio = 400
			DumpExcess = true		
		}
		AutoShutdown = true
		TemperatureModifier
		{
			key = 0 200000000
			key = 799 5000000
			key = 800 50000
			key = 1500 40000
		}				
		GeneratesHeat = true
		DefaultShutoffTemp = 1
		ThermalEfficiency 
		{
			key = 0 0 0 0
			key = 799 0.01 0 0
			key = 800 1.0 0 0
			key = 1500 0.75 0 0
			key = 3000 0 0 0 
		}
	}	
	MODULE
	{
		name = ModuleCoreHeat
		CoreTempGoal = 800					//Internal temp goal - we don't transfer till we hit this point
		CoreToPartRatio = 0.1				//Scale back cooling if the part is this % of core temp
		CoreTempGoalAdjustment = 0			//Dynamic goal adjustment
		CoreEnergyMultiplier = 0.2			//What percentage of our core energy do we transfer to the part
		HeatRadiantMultiplier = 0		//If the core is hotter, how much heat radiates?
		CoolingRadiantMultiplier = 0		//If the core is colder, how much radiates?
		HeatTransferMultiplier = 0.0			//If the part is hotter, how much heat transfers in?
		CoolantTransferMultiplier = 0.0		//If the part is colder, how much of our energy can we transfer?
		radiatorCoolingFactor = 1			//How much energy we pull from core with an active radiator?  >= 1
		radiatorHeatingFactor = 0.01		//How much energy we push to the active radiator
		MaxCalculationWarp = 1000			//Based on how dramatic the changes are, this is the max rate of change
		CoreShutdownTemp = 1500				//At what core temperature do we shut down all generators on this part?
		MaxCoolant = 1000					//Maximum amount of radiator capacity we can consume - 50 = 1 small
	}
	MODULE
	{
		name = ModuleOverheatDisplay
	}
	RESOURCE
	{
		 name = ElectricCharge
		 amount = 400
		 maxAmount = 400
	}
	RESOURCE
	{
		 name = DepletedFuel
		 amount = 0
		 maxAmount = 100

	}
	RESOURCE
	{
		 name = EnrichedUranium
		 amount = 100
		 maxAmount = 100

	}
	MODULE
	{
		name = RadioactiveStorageContainer
		DangerousFuel = DepletedFuel
		SafeFuel = EnrichedUranium
		// What enginer level is needed to transfer the safe fuel
		EngineerLevelForSafe = 1
		// What enginer level is needed to transfer the dangerous fuel
		EngineerLevelForDangerous = 3
		// Max temp for transferring fuel into or out of the part
		MaxTempForTransfer = 400
		// kW of heat per unit of waste
		HeatFluxPerWasteUnit = 5
	}
	MODULE
	{
		name = NodeTriggeredMesh
		MeshName =Structure
		NodeName = top
	
	}
}

 

 

Will try to remove the peak and compensation.

For the record: 'Required Cooling' seems to be calculated from TemperatureModifier curve at the point that matches CoreTempGoal.

 

Link to comment
Share on other sites

I do not get it. At all.

Using this config, no sharp turns on curves this time.

Spoiler

// Near Future Electrical 0.6.0
// Fission Reactor - 1.25m
PART
{
	// --- general parameters ---
	name = reactor-125
	module = Part
	author = ChrisAdderley

	// --- asset parameters ---
	mesh = reactor-125.mu
	rescaleFactor = 1

	TechRequired = nuclearPropulsion
	entryCost = 275000
	
	// --- node definitions ---
	// definition format is Position X, Position Y, Position Z, Up X, Up Y, Up Z
	node_stack_top = 0.0, 1.585, 0, 0.0, 1.0, 0.0, 1
	node_stack_bottom = 0.0, -0.70, 0, 0.0, -1.0, 0.0, 1
	

	// --- editor parameters ---
	cost = 136000
	category = Utility
	subcategory = 0
	title = MX-4 'GARNET' Fission Reactor
	manufacturer = Kerb Kastria Inc.
	description = The MX-4 is a compact fission reactor that produces up to 400 kW of electric power. Be sure to attach enough heat radiation capacity to run it!
	// attachment rules: stack, srfAttach, allowStack, allowSrfAttach, allowCollision
	attachRules = 1,0,1,1,1

	// --- standard part parameters ---
	mass = 1.22
	dragModelType = default
	maximum_drag = 0.2
	minimum_drag = 0.2
	angularDrag = 1
	crashTolerance = 8
	bulkheadProfiles = size1
	
	// heat parameters
	emissiveConstant = 0.15
	heatConductivity = 0.005
	maxTemp = 1600
	thermalMassModifier = 1

	breakingForce = 200
	breakingTorque = 200
	MODULE
	{
		name = ModuleResourceConverter
		ConverterName = Reactor
		StartActionName = Start Reactor
		StopActionName = Stop Reactor
		INPUT_RESOURCE
		{
			ResourceName = EnrichedUranium
			Ratio = 0.00000160
		}
		OUTPUT_RESOURCE
		{
			ResourceName = DepletedFuel
			Ratio = 0.00000150
			DumpExcess = false
			FlowMode = NO_FLOW
		}
		OUTPUT_RESOURCE
		{
			ResourceName = ElectricCharge
			Ratio = 400
			DumpExcess = true		
		}
		AutoShutdown = true
		TemperatureModifier
		{
			key = 0 2000000
			key = 400 2000000
			key = 800 50000
			key = 1500 50000
		}				
		GeneratesHeat = true
		DefaultShutoffTemp = 1
		ThermalEfficiency 
		{
			key = 0 0 0 0
			key = 400 0 0 0
			key = 800 1.0 0 0
			key = 1500 0.75 0 0
			key = 3000 0 0 0 
		}
	}	
	MODULE
	{
		name = ModuleCoreHeat
		CoreTempGoal = 800					//Internal temp goal - we don't transfer till we hit this point
		CoreToPartRatio = 0.1				//Scale back cooling if the part is this % of core temp
		CoreTempGoalAdjustment = 0			//Dynamic goal adjustment
		CoreEnergyMultiplier = 0.2			//What percentage of our core energy do we transfer to the part
		HeatRadiantMultiplier = 0		//If the core is hotter, how much heat radiates?
		CoolingRadiantMultiplier = 0		//If the core is colder, how much radiates?
		HeatTransferMultiplier = 0.001			//If the part is hotter, how much heat transfers in?
		CoolantTransferMultiplier = 0.001		//If the part is colder, how much of our energy can we transfer?
		radiatorCoolingFactor = 1			//How much energy we pull from core with an active radiator?  >= 1
		radiatorHeatingFactor = 0.01		//How much energy we push to the active radiator
		MaxCalculationWarp = 1000			//Based on how dramatic the changes are, this is the max rate of change
		CoreShutdownTemp = 1500				//At what core temperature do we shut down all generators on this part?
		MaxCoolant = 1000					//Maximum amount of radiator capacity we can consume - 50 = 1 small
	}
	MODULE
	{
		name = ModuleOverheatDisplay
	}
	RESOURCE
	{
		 name = ElectricCharge
		 amount = 400
		 maxAmount = 400
	}
	RESOURCE
	{
		 name = DepletedFuel
		 amount = 0
		 maxAmount = 100

	}
	RESOURCE
	{
		 name = EnrichedUranium
		 amount = 100
		 maxAmount = 100

	}
	MODULE
	{
		name = RadioactiveStorageContainer
		DangerousFuel = DepletedFuel
		SafeFuel = EnrichedUranium
		// What enginer level is needed to transfer the safe fuel
		EngineerLevelForSafe = 1
		// What enginer level is needed to transfer the dangerous fuel
		EngineerLevelForDangerous = 3
		// Max temp for transferring fuel into or out of the part
		MaxTempForTransfer = 400
		// kW of heat per unit of waste
		HeatFluxPerWasteUnit = 5
	}
	MODULE
	{
		name = NodeTriggeredMesh
		MeshName =Structure
		NodeName = top
	
	}
}

 

Reactor tuned to use 4 med radiators at 800K.  With all 4 extended it balances perfectly at 800K. If all 4 are retracted, it reaches 847 and just sits there. What the heck is happening?

https://imgur.com/a/ee2Wd

Where does the heat go? It should overheat and shut down at 1500.

Edited by Psycho_zs
Link to comment
Share on other sites

9 hours ago, Nertea said:

Sigh. This is so frustrating. I'm really tired. Just do this. It's good enough.


Pull yourself together, pilot! We can do this :)

 

7 hours ago, Psycho_zs said:

I'm in desperate need of better descriptions of core and converter parameters.


Then you probably need @RoverDude or maybe even @NathanKell to help out.

 

5 hours ago, Psycho_zs said:

Where does the heat go? It should overheat and shut down at 1500.


I will gladly help you test, but I went to sleep after my last post 10 hours ago, and won't be back home from work until another 8 have elapsed. I'll get back to you tonight.
 

Edited by Streetwind
Link to comment
Share on other sites

New one: this should do more what I want. The generator component now consumes thermal power correctly at a rate that should depend on radiator capacity, and radiators should cool the core down. The main issue here is that the number is unstable sometimes and probably need me to smooth is over a couple of frames. But... uh, in my limited testing (2.5 and 1.25m reactors) it seems to get the job done?

Oh, and I fixed the thermal masses and 1.2m reactor attach nodes.

https://www.dropbox.com/s/s7s4tc9lb467cdv/NearFutureElectrical0_6_T2.zip?dl=0

Link to comment
Share on other sites

There is a catch here somewhere...

Testing MX-4 with 4 medium radiators. At full power it outputs 333Ec/s without timewarp and 400Ec/s with timewarp.

When around GoalEnergy (400K), Ec production flips back and forth. IMHO, smoothing Ec production over a couple of dozens of frames and making it somewhat retrospective would be fine.

Overall, with cooling capacity 1000kW, if core heat generation is at 999kW, the temp sinks down to GoalEnergy. If 1001kW, it steadily overheats. (acually, the closest thing i've managed to test is 1008kW). I wonder if Core>Part flux of imperfect insulation could in theory pass through puny 8kW of heat. With current rig it does not.

Edited by Psycho_zs
Link to comment
Share on other sites

Heya!  As noted, chatted with Nertea over IRC hopefully have the bits sorted.  If you have any specific questions on how the modules work, let me know.  There are a LOT of levers and you can do interesting (or horrible) things.

One bit to note is that you will see several bits in the stock ISRU/drills that are set to zero - these mostly deal with internal->corebleedoff.  Generally I kept things that were variable based on internal temp at zero since they can be the most unpredictable with high loads in analytic mode (it's why we have core heat in the first place!)

 

Link to comment
Share on other sites

@RoverDude, does ThermalEfficiency of the converter actually also affect heat production? That would be a bit counterintuitive, because efficiency parameter would suggest producing the same amount of heat, but lower amount of output resources, but what I've found in my experiments, is that converter just works more slowly at all fronts including heat production at inefficient state.

Could you tell why my last test rig would stop heating at 847K despite still working with no radiators extended? Where would the heat go?

Also, any plans on releasing doc on the levers?

Edited by Psycho_zs
Link to comment
Share on other sites

Thermal Efficiency affects production - it reflects that you produce less as you overheat or while you are warming up.  And less heat production is what causes it to eventually reach an equilibrium state.  

At work now so I can't look at your test rig, my recommendation is starting with a stock set of parameters and carefully expanding from there.  But it's absolutely possible to work with no radiators (see above RE equilibrium).

 

Link to comment
Share on other sites

Testing, testing...

Ec generation now seems to depend on the currently available core heat transfer, and core lifetime on the power setting slider. Looking very nice!

Though, is there any way to periodically force-update the amount of power produced? Because right now it only seems to update whenever the power setting slider is changed. And this updating only results in the proper value if you take your time moving the bar slowly to where you want it. But if the bar is for example at 100%, and I simply do a quick single click to set it to 0%, then the resulting Ec output is rarely ever 0. In fact, what you get seems almost random, and you can usually get a very high number within a few tries. That way I was able to easily achieve over 40 Ec/s out of a theoretical 50, even with the reactor throttle set to zero and no fuel consumption happening. Example screenshot.

It's even easier to do if you let the reactor gain some heat, and then zero out the throttle. Then the reactor remains at full output until it has consumed all the remaining heat... but it never updates its power production, and remains forever at full output.

It basically works exactly like it needs to, it just doesn't update its own power production state enough. Sorry for breaking every iteration you put out! :P

 

Of course, as it is built right now, core temperature will basically always be at its minimum, and not anywhere near nominal temperature, because full heat transfer speed is available at any given time. Though ultimately, a system where transfer scales up with core temperature until nominal is reached is more or less luxury at this point, I guess. And may or may not even be possible to implement. The reactors do their work without it, in any case.

Edited by Streetwind
Link to comment
Share on other sites

The behaviour you see is essentially expected, as the power depends on heat removed. If you zero out the throttle, the radiators will still try to consume as much heat from the core as possible until there's none left, so the transfer will be 100% until it is zero. I planned initially to make generator efficiency depend on core temperature, this would have the effect of decreasing the power output as the radiators cool down the core, but did not implement it for this version to simplify things (core damage effects are also turned off in this version). An alternate way to implement this would be to scale the maximum radiator transfer by the core temperature ratio, so that it goes to maximum at nominal and a somewhat lower number near "room temperature". 

If you're reasonably sure this actually works and makes sense, I will go ahead and complexify it.

 

Link to comment
Share on other sites

Yeah, go right ahead, it works well enough. It just doesn't notice when it runs out of heat to turn into Ec, as mentioned.

Meanwhile, I'm going to toss some random thoughts on NF propulsion into this post...

 

- VASIMR xenon mode is still called "hydrogen" mode internally and displays as such in the rightclick menu when toggling modes.

- VASIMR interstage fairing really applies a lot of force to the ship when staged. I looked at the config and it says jettisonForce = 0.01, but it really jostles my whole upper stage around every time. Or maybe it's the stage decoupler transferring its force unevenly through the various pieces. Whatever it is, perhaps a stock style engine fairing that doesn't eject its parts and just stays with the lower stage would be worth considering?

- VASIMR, at least the 1.25m one I tested with, doesn't really seem to produce any engine light. The exhaust animation shows as always, but the spacecraft remains fully dark. I tested some other engines, like the Gyro-Quad, and it works fine there.

- Most of the smaller electric engines don't have any engine fairings at all, which doesn't look good in a stack, and now with the new aerodynamics, might ause drag issues. This affects all sizes, but especially those large enough to be frequently mounted outside of fairings.

 

EDIT: Oh, I think I should add: I haven't yet experienced any reactors remaining stuck in the "questionmark state" during the first powerup. So whatever you changed, it seems to have solved it too :)

Edited by Streetwind
Link to comment
Share on other sites

Thanks for the notes.

New version of NFE which I'll deploy a bit later has the improved code, including frame smoothing out output and temperature scaling of power flux. Also core damage returns and many minor bugfixes. New version of NFP has a fix to that mode, 1.25m Li tanks, new FX for Xe mode VASIMRs, new FX for MPDTs. Adding proper engine light kinda has to wait for more plugin work - the multi modes and therefore multiple colours of light. You may have historically noticed that there was never any real engine emissive on those parts.

Link to comment
Share on other sites

I think of a slightly different approach:

use CoreTempGoal as nominal temp. Below that, no active cooling is being done, so no electricity is produced. When the core reaches nominal temp, radiators start pumping the heat away, but they do that in chunks. So, take something like 60 frames, average the heat transfer to radiators, produce electricity accordingly.

If I uderstand correctly, this both kinda close to being physically correct and should scale with reactor throttle. When reactor starts outputting more heat than radiators can handle, core will start overheating. Imperfect core/part insulation may come to play here as both 'a thing to avoid' and a way to stop overheat in some range of values by bleeding core heat off to the part (core should still overheat if going at full power with insufficient cooling). This heat loss can also add to reactor inefficiency.

Link to comment
Share on other sites

Some notes I'd like to quickly make.

I find reactor throttle mostly unnecessary. It serves to give me a new way to screw up while not being all that useful. A simple on/off switch would be just fine (maybe a hibernate/idle mode but technically unnecessary), at least IMHO. Also I think Psycho is onto something. The simpler the function as well as the code behind it, the better for everyone. Until the KSPedia is a thing I think this mod is nontransparent enough. :P (Hell, you've thoroughly confused the crap out of me about how the reactors work now and I'm a vet of these mods.)

Lithium makes MPDTs OP AF. You can get so much more dV for so much less volume now its insane. They've just become the end-all/be-all of late game propulsion. That said, it feels .... surprisingly good. I miss the LH2 out of nostalgia but the lithium version works really well, too well honestly. Since I brought up the LH2, what's your plan for those tanks? They're far too pretty to just deprecate indefinitely. I have a few concepts bouncing around but I want to hear your opinions on it, because those matter more.

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...