Skip to content

Thermal Model

stefanosts edited this page Aug 6, 2016 · 1 revision

The temperature calculation of the Parametric CO2MPAS model is based on the energy equilibrium between the heat produced by the combustion of fuel and the various thermal losses, e.g. exhaust gases, temperature increase of engine body, cooling, etc.

The main function is separated on the cold and hot phases of the cycle and it is physically expressed as:

Cold Phase

Hot Phase

, where

and the different constants are provided either as an input to the model or calculated by empirical functions.

Inputs

Name Units Source / Comments Parameter

Outputs

Engine Coolant Temperature [oC] / engine_coolant_temperatures

Source Code

Bellow, the main python function for the calculation of the temperature is provided.

def calculate_coolant_temperatures(
        temperature_max, temperature_threshold, initial_engine_temperature, 
        temperature_increase_when_engine_off, engine_coolant_flow, 
        engine_coolant_constant, heat_to_engine, engine_fuel_lower_heating_value,
        engine_coolant_heat_capacity, engine_coolant_equiv_mass, engine_heat_capacity, 
        engine_mass, fuel_consumptions, engine_powers_out, engine_speeds_out):
    
    tmax = temperature_max
    tthres = temperature_threshold
    t0 = initial_engine_temperature
    tgrad = temperature_increase_when_engine_off
    cflow = engine_coolant_flow
    ccnst = engine_coolant_constant
    ccp = engine_coolant_heat_capacity
    cm = engine_coolant_equiv_mass
    ecp = engine_heat_capacity
    em = engine_mass
    h2e = heat_to_engine
    flhv = engine_fuel_lower_heating_value
    fc = fuel_consumptions
    p = engine_powers_out
    n = engine_speeds_out

    def calculate_dQ(
            fc, p, t, t0, tthres, flhv, h2e, cmcp, cflow):
        if fc <= 0:
            dQ = 0
        else:
            fh = fc * flhv
            dQ = fh * h2e
            if t > tthres:
                dQ -= cmcp * ((t - t0) * cflow)
        return dQ

    t = []
    l = len(fc)

    cmcp = ccp*cm

    t_ii = t0
    for i in range(l):

        if (t_ii >= tmax) or ((t_ii > tthres) and (p[i] <= 0)):
            t_i = t_ii - ccnst * (t_ii - tthres) / (tmax - tthres)

        elif n[i] > 0:
            dQ = calculate_dQ(
                    fc[i - 1], p[i - 1], t_ii, t0, tthres, flhv, h2e, cmcp, cflow)
            t_i = t_ii + dQ / (em * ecp)

        else:
            t_i = t_ii + tgrad

        t_ii = t_i
        t.append(t_i)

    return np.array(t)