Skip to content

model_air

ModelAir

ModelAir(
    static_env: StaticEnvAir,
    scenario: DataFrame[ScenarioSchemaAir],
)

Bases: Model[ModelAirRunOptions, StateAir, ScenarioSchemaAir]

The ModelAir is used to compute temperature of using the finite differences methodology.

In finite differences a 1D approach is taken to modelling the environment and the cables, pipes and soil within it. The finite differences computation are fast and efficient.

In most cases the model is used by instantiating it using a StaticEnvAir and a valid scenario and calling the run() method. >> model = ModelAir(environment, scenario) >> result = model.run()

To initialize a ModelAir instance two inputs are required: a static environment and a scenario dataframe.

N.B. the column names of 'scenario' should be as follows: 'load_circuit_1' contains the load (in A) of the 'circuit_1' object of static_env and column 'ambient_temperature' contains the ambient temperature (in degrees Celsius)

Parameters:

Name Type Description Default
static_env StaticEnvAir

A StaticEnvAir instance containing the circuit configuration and cable properties.

required
scenario DataFrame[ScenarioSchemaAir]

A pandera DataFrame[ScenarioSchemaAir] containing the dynamic data i.e. loads of the cable circuits and the ambient temperature

required
Source code in cable_thermal_model/model/model_air.py
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
def __init__(self, static_env: StaticEnvAir, scenario: DataFrame[ScenarioSchemaAir]):
    """Initializes the ModelAir instance with a static environment and scenario.

    To initialize a ModelAir instance two inputs are required: a static
    environment and a scenario dataframe.

    N.B. the column names of 'scenario' should be as follows:
    'load_circuit_1' contains the load (in A) of the 'circuit_1' object of
    static_env and column 'ambient_temperature' contains the ambient
    temperature (in degrees Celsius)

    Args:
        static_env: A StaticEnvAir instance containing the circuit configuration and cable properties.
        scenario:   A pandera DataFrame[ScenarioSchemaAir] containing the dynamic data i.e. loads of the
                    cable circuits and the ambient temperature

    """
    if not isinstance(static_env, StaticEnvAir):
        raise ValueError(
            f"Can not use model '{self.__class__.__name__}' if static "
            "environment is not an environment in air. Please use "
            "ModelSoil instead."
        )

    super().__init__(static_env=static_env, scenario=scenario)