GithubHelp home page GithubHelp logo

radiatorcalculator's Introduction

ObjectiveDane\RadiatorCalculator\RadiatorCalculator

Use to calculate the size of radiator required for a central heating system.

Formula: surface area (m2) * temperature difference (c) * uValue

The formula calculates the power required to maintain a temperature, considering the temperature on the other side of the surface and its uValue.

Surfaces must be added to a room, or rooms, which in turn must be added to a building.

Example:

RadiatorCalculator::createBuilding();
RadiatorCalculator::setDesiredTemperature(21);
RadiatorCalculator::addRoom('Living Room');

RadiatorCalculator::addSurfaceToRoom('Living Room',3, 3, 1.8, 5, 'Outer Wall (North)');
RadiatorCalculator::addSurfaceToRoom('Living Room',3, 3, 1.8, 7, 'Outer Wall (West)');
RadiatorCalculator::addSurfaceToRoom('Living Room',3, 3, 1.8, 7, 'Outer Wall (East)');
RadiatorCalculator::addSurfaceToRoom('Living Room',3, 3, 1.8, 18, 'Ceiling');
RadiatorCalculator::addSurfaceToRoom('Living Room',3, 3, 1.8, 10, 'Floor');
RadiatorCalculator::getHeatRequired(false, 'test room');

Documentation below:

===============

Class RadiatorCalculator.

This is class uses static methods and acts as an orchestrator for the other classes in the package. The intention is that the user will only interact with this class. Start with createBuilding, then addRoom then addSurface to the Rooms. The radiator size can then be fetched room by room, or as an array of all rooms, or even a building total giving the boiler size requirement (getHeatRequired).

  • Class name: RadiatorCalculator
  • Namespace: ObjectiveDane\RadiatorCalculator

Properties

$building

private mixed $building

The building instance for this calculation.

  • Visibility: private
  • This property is static.

Methods

createBuilding

mixed ObjectiveDane\RadiatorCalculator\RadiatorCalculator::createBuilding($buildingName)

Create the building and provide a name. Rooms can be added to this building.

  • Visibility: public
  • This method is static.

Arguments

  • $buildingName mixed

setDesiredTemperature

mixed ObjectiveDane\RadiatorCalculator\RadiatorCalculator::setDesiredTemperature(integer $temperature)

Set the desired temperature for the building, used by the power requirement formula.

  • Visibility: public
  • This method is static.

Arguments

  • $temperature integer

setMode

mixed ObjectiveDane\RadiatorCalculator\RadiatorCalculator::setMode($mode)

Set the output mode - BTU or Watts. Defaults to Watts.

  • Visibility: public
  • This method is static.

Arguments

  • $mode mixed - <ul> <li>must be BTU or Watts</li> </ul>

addRoom

mixed ObjectiveDane\RadiatorCalculator\RadiatorCalculator::addRoom(string $roomName)

Add a room to the building. Surfaces are added after.

  • Visibility: public
  • This method is static.

Arguments

  • $roomName string - <ul> <li>give it a name</li> </ul>

getRoom

\ObjectiveDane\RadiatorCalculator\Room\Room ObjectiveDane\RadiatorCalculator\RadiatorCalculator::getRoom(string $roomName)

Fetch a previously created room.

  • Visibility: public
  • This method is static.

Arguments

  • $roomName string

addSurfaceToRoom

mixed ObjectiveDane\RadiatorCalculator\RadiatorCalculator::addSurfaceToRoom(string $roomName, float $xMeasurement, float $yMeasurement, float $uValue, float $externalTemperature, string $surfaceName)

Add a surface (wall, ceiling) to the room. Windows and doors can be added as child surfaces by passing them as formal arguments on the end of the argument list.

  • Visibility: public
  • This method is static.

Arguments

  • $roomName string
  • $xMeasurement float
  • $yMeasurement float
  • $uValue float
  • $externalTemperature float
  • $surfaceName string

createChildSurface

\ObjectiveDane\RadiatorCalculator\Surface\Surface ObjectiveDane\RadiatorCalculator\RadiatorCalculator::createChildSurface(string $surfaceName, float $xMeasurement, float $yMeasurement, float $uValue, float $externalTemperature)

Create and return a child surface, i.e. window or door

  • Visibility: public
  • This method is static.

Arguments

  • $surfaceName string
  • $xMeasurement float
  • $yMeasurement float
  • $uValue float
  • $externalTemperature float

getHeatRequired

mixed ObjectiveDane\RadiatorCalculator\RadiatorCalculator::getHeatRequired(boolean $breakdown, null $roomName)

Get the heat required to maintain the desired temperature in the entire building

  • Visibility: public
  • This method is static.

Arguments

  • $breakdown boolean - <ul> <li>will return an array of power by room</li> </ul>
  • $roomName null - <ul> <li>will return the power for the given room</li> </ul>

radiatorcalculator's People

Contributors

danestevens avatar

Watchers

Dane Stevens avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.