[A12d] RedistHeat - Vents/Ducts (Oct 12, v42b) Small heater fix

Started by Latta, March 01, 2015, 01:41:49 AM

Previous topic - Next topic

Ninefinger

Quote from: DopplerEffect on April 22, 2015, 11:25:45 AM
Quote from: Kaballah on April 22, 2015, 11:20:51 AM
he way i see it is the flow of heat is only in one direction from colder room to hotter room since the room is already hotter than the desired temperature all the fan can do is turn itself off it can not reverse the flow of heat to remove excess heat in the room, i suggest adding a duct intake inside the room and put a duct outlet or smart fan anywhere that is considered "outside" and make sure the temperature is set to a higher temperature that it is outside and connect them with a duct so it can act like a vent. or try adding a active vent on the wall of the hotter room.

I didn't realize that the temperature gradient was directional.  I thought it just used the network temperature to change each room temperature?

yeah im pretty sure its directional there is an intake and outtake i think the best way is to add a active vent in the wall so that it can vent excess heat outside but it will close and stop venting once it drops to the desired temperature allowing the system to turn off and stop using power and that way your not constantly pumping warm air in and out, never allowing the system to turn off. my smart fan idea leading outside will constantly run since it will never reach its desired temp if set above outdoor temp. keep in mind the vent has to lead outside. otherwise if your hallway is already too hot the vent wont work you might have to make a simple room that is outside called an equalizing room where active vents can vent heat outside while fans can pump excess heat from there rooms into the equalizing room.

DopplerEffect

But that still doesn't explain why the regular Duct Opening is working while the smart Duct Opening is not?

DopplerEffect

Also, looking at the source code, specifically this section of Building_DuctComp.cs


                public override void TickRare()
{
//base.Tick();

if (!Validate())
return;

RoomNorth = (Position + IntVec3.North.RotatedBy(Rotation)).GetRoom();
if (RoomNorth == null) return;

float tempEq;
if (RoomNorth.UsesOutdoorTemperature)
tempEq = RoomNorth.Temperature;
else
{
tempEq = (RoomNorth.Temperature * RoomNorth.CellCount + CompAir.ConnectedNet.Temperature * CompAir.ConnectedNet.Nodes.Count)
/ (RoomNorth.CellCount + CompAir.ConnectedNet.Nodes.Count);
}

//compAir.connectedNet.PushHeat((roomNorth.Temperature - compAir.connectedNet.Temperature) * compAir.props.energyPerSecond);

ExchangeHeatNet(tempEq, EqualizationRate);
if (!RoomNorth.UsesOutdoorTemperature)
ExchangeHeat(RoomNorth, tempEq, EqualizationRate);
}

private void ExchangeHeatNet(float targetTemp, float rate)
{
var tempDiff = Mathf.Abs(CompAir.ConnectedNet.Temperature - targetTemp);
var tempRated = tempDiff * rate;
if (targetTemp < CompAir.ConnectedNet.Temperature)
CompAir.ConnectedNet.Temperature = Mathf.Max(targetTemp, CompAir.ConnectedNet.Temperature - tempRated);
else if (targetTemp > CompAir.ConnectedNet.Temperature)
CompAir.ConnectedNet.Temperature = Mathf.Min(targetTemp, CompAir.ConnectedNet.Temperature + tempRated);
}
private static void ExchangeHeat(Room r, float targetTemp, float rate)
{
var tempDiff = Mathf.Abs(r.Temperature - targetTemp);
var tempRated = tempDiff * rate;
if (targetTemp < r.Temperature)
r.Temperature = Mathf.Max(targetTemp, r.Temperature - tempRated);
else if (targetTemp > r.Temperature)
r.Temperature = Mathf.Min(targetTemp, r.Temperature + tempRated);
}


Leads me to believe that I was correct in the assumption that heat is equalized between the network and each room connected via a node (Duct Opening, Smart Duct Opening or Intake Duct).  So unless i'm completely missing something my setup should work.

Ninefinger

Quote from: DopplerEffect on April 22, 2015, 11:38:29 AM
But that still doesn't explain why the regular Duct Opening is working while the smart Duct Opening is not?

The smart duct opening is working im sure of it, its simply cant do anything because the excess heat has no place to go it will only tun on if the temp in the room drops below the desired temp. try placing a duct intake in the room and duct it to an equalizing room built outside whos soul purpose is to take excess heat from all other rooms and place a smart duct opening inside the equalizing room and place active vents inside the equalizing room going outside so it can vent the excess heat directly outside, set both smart fans and the active vent to the same temperature.

DopplerEffect

Okay so putting the intake in the bedroom works because it allows equalization between the network and the room, but why would putting a Smart Duct in each room and an Intake in the cold room not work?  Why would it be set up any other way, since you might want to have different temperatures in different rooms?

Ninefinger

Quote from: DopplerEffect on April 22, 2015, 12:03:21 PM
Okay so putting the intake in the bedroom works because it allows equalization between the network and the room, but why would putting a Smart Duct in each room and an Intake in the cold room not work?  Why would it be set up any other way, since you might want to have different temperatures in different rooms?

Im not too sure, it seems like if you do that the system will continuously run without shutting off unless im wrong then you have found the best solution, but after more thought i think the easiest way to do what i was explaining is to simply place an active vent on the room wall leading to the hallway and placing an active vent from the hallway leading outside making the hallway your equalizing room.

DopplerEffect



                private bool ValidateTemp(float roomTemp, float netTemp)
{
return ((roomTemp < compTempControl.targetTemperature && roomTemp < netTemp) || (roomTemp > compTempControl.targetTemperature && roomTemp > netTemp));
}


Seems to be indicating that the Smart Duct should work the way I describe.  If the room temperature is below the set point and the network temperature is greater than the room temperature, then the vent can activate to raise the temperature of the room.  Conversely, if the room temp is greater than the setpoint and the net temperature is below the room temperature, the vent can activate to cool the room.  However that does not seem to be happening in my case.

Ninefinger

Quote from: DopplerEffect on April 22, 2015, 12:12:43 PM


                private bool ValidateTemp(float roomTemp, float netTemp)
{
return ((roomTemp < compTempControl.targetTemperature && roomTemp < netTemp) || (roomTemp > compTempControl.targetTemperature && roomTemp > netTemp));
}


Seems to be indicating that the Smart Duct should work the way I describe.  If the room temperature is below the set point and the network temperature is greater than the room temperature, then the vent can activate to raise the temperature of the room.  Conversely, if the room temp is greater than the setpoint and the net temperature is below the room temperature, the vent can activate to cool the room.  However that does not seem to be happening in my case.

yeah i was wrong about it being directional that is weird it should be working.

DopplerEffect

Do you know if Rimworld behaves well when you attach VS to it?  Or is there a better debugging technique?

Ninefinger

Quote from: DopplerEffect on April 22, 2015, 12:26:16 PM
Do you know if Rimworld behaves well when you attach VS to it?  Or is there a better debugging technique?

I dont know Dll coding enough to say for sure but i would think that VS should work fine, what i would do is compare the smart duct outlet code to the regular duct outlet code and see if there are any errors but. but it might be something simple as restarting your game or maybe the smart fan is just not connecting properly to the duct or maybe the duct system is acting weird and needs to be reconfigured a bit and you could try giving the smart fan its own duct network separate from the regular one.

Kaballah

I've used this version of the mod in A10D for a while and the smart duct openings/smartfans work perfectly for me, for heating and cooling.  Part of your problem may be just that your rooms have 1x thick walls and are not insulated well enough, but your doors still look weird to me, are they vanilla doors?

DopplerEffect

No the doors are from Superior Crafting.  Let me try building a room without those doors and see what happens

Kaballah

Yeah you might even make a test game with that mod disabled.

DopplerEffect

I created a new world with only this mod enabled, and I still have the same issue

http://imgur.com/PjSiCST

Kaballah

When you mouse over the bedroom, are you sure it's all roofed/indoors?