Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sensible + latent output doesn't match total output energy in VRF #10607

Closed
2 of 3 tasks
yujiex opened this issue Jul 15, 2024 · 1 comment · Fixed by #10557
Closed
2 of 3 tasks

sensible + latent output doesn't match total output energy in VRF #10607

yujiex opened this issue Jul 15, 2024 · 1 comment · Fixed by #10557
Assignees
Labels
Defect Includes code to repair a defect in EnergyPlus

Comments

@yujiex
Copy link
Collaborator

yujiex commented Jul 15, 2024

Issue overview

The following is how the sensible and latent output is computed in CalcVRF_FluidTCtrl and CalcVRF

    LoadMet = AirMassFlow * PsyDeltaHSenFnTdb2W2Tdb1W1(TempOut, SpecHumOut, TempIn, SpecHumIn); // sensible {W}
    LatentLoadMet = AirMassFlow * (SpecHumOut - SpecHumIn);                                     // latent {kgWater/s}

The LatentLoadMet in kgWater/s is converted to W in function ReportVRFTerminalUnit

    Real64 const H2OHtOfVap = PsyHgAirFnWTdb(0.0, TempOut);
    // convert latent in kg/s to watts
    TotalConditioning = SensibleConditioning + (LatentConditioning * H2OHtOfVap);

    if (TotalConditioning <= 0.0) {
        state.dataHVACVarRefFlow->VRFTU(VRFTUNum).TotalCoolingRate = std::abs(TotalConditioning);
        state.dataHVACVarRefFlow->VRFTU(VRFTUNum).TotalHeatingRate = 0.0;
    ...

This is different from the calculation in the GeneralRoutines.cc as follows

        TotalOutput = MassFlow * (Psychrometrics::PsyHFnTdbW(TDB2, W2) - Psychrometrics::PsyHFnTdbW(TDB1, W1)); // total addition/removal rate, {W};
        SensibleOutput = MassFlow * Psychrometrics::PsyDeltaHSenFnTdb2W2Tdb1W1(TDB2, W2, TDB1, W1); // sensible addition/removal rate, {W};
        LatentOutput = TotalOutput - SensibleOutput;                                                // latent addition/removal rate, {W}

However when adding the sensible output to this latent output computed as the above as (AirMassFlow * (SpecHumOut - SpecHumIn)) * PsyHgAirFnWTdb(0.0, TempOut), the total does not match the TotalOutput computed as follows.

TotalOutput = AirMassFlow * (Psychrometrics::PsyHFnTdbW(TempOut, SpecHumOut) - Psychrometrics::PsyHFnTdbW(TempIn, SpecHumIn)); // total addition/removal rate, {W};

This can be observed by adding this to the code and running the US+SF+CZ4A+hp+crawlspace+IECC_2006_VRF.idf example file using weather file USA_NY_New.York-John.F.Kennedy.Intl.AP.744860_TMY3.epw:

    // calculate sensible load met using delta enthalpy
    LoadMet = AirMassFlow * PsyDeltaHSenFnTdb2W2Tdb1W1(TempOut, SpecHumOut, TempIn, SpecHumIn); // sensible {W}
    LatentLoadMet = AirMassFlow * (SpecHumOut - SpecHumIn);                                     // latent {kgWater/s}
    // debug print
    if (AirMassFlow > 0.0) {
        Real64 diff = abs(LoadMet + LatentLoadMet * PsyHgAirFnWTdb(0.0, TempOut) -
                          AirMassFlow * (Psychrometrics::PsyHFnTdbW(TempOut, SpecHumOut) - Psychrometrics::PsyHFnTdbW(TempIn, SpecHumIn)));
        if (diff > 10) {
            fmt::print("too large difference at {}: diff = {}, TempOut={}, SpecHumOut={}, TempIn={}, SpecHumIn={}\n",
                       state.dataEnvrn->CurMnDyHr,
                       diff,
                       TempOut,
                       SpecHumOut,
                       TempIn,
                       SpecHumIn);
        }
    }

This txt file has all has the output with the debugging print
large_diff.txt

The following is an instance with large difference between the TotalOutput and the SensibleOutput + LatentOutput

diff = 10.083951937490237, 
TempOut=18.710784212366956, 
SpecHumOut=0.012661531422619608, 
TempIn=23.888585998167404, 
SpecHumIn=0.014184600203099161

Defect file

US+SF+CZ4A+hp+crawlspace+IECC_2006_VRF.idf with USA_NY_New.York-John.F.Kennedy.Intl.AP.744860_TMY3.epw

Details

Some additional details for this issue (if relevant):

  • Platform (Mac, 13.5.2)
  • Version of EnergyPlus (24.1)
  • Unmethours link or helpdesk ticket number

Checklist

Add to this list or remove from it as applicable. This is a simple templated set of guidelines.

  • Defect file added (list location of defect file here)
  • Ticket added to EnergyPlus Defect Complexity (Github Project)
  • Pull request created (the pull request will have additional tasks related to reviewing changes that fix this defect)
@yujiex yujiex added the Defect Includes code to repair a defect in EnergyPlus label Jul 15, 2024
@yujiex yujiex self-assigned this Jul 15, 2024
@yujiex yujiex added this to the EnergyPlus 24.2 milestone Jul 15, 2024
@mjwitte
Copy link
Contributor

mjwitte commented Jul 15, 2024

@yujiex There are some special pysch functions for this that are used by the other DX coils. See

CalcComponentSensibleLatentOutput(evapOutletNode.MassFlowRate,
evapInletNode.Temp,
evapInletNode.HumRat,
evapOutletNode.Temp,
evapOutletNode.HumRat,
this->sensCoolingEnergyRate,
this->latCoolingEnergyRate,
this->totalCoolingEnergyRate);

Indeed. This is how cooling coil cooling electricity rate (thisDXCoolingCoil.TotalCoolingEnergyRate) is calculated. While the TU cooling rate (thisVRFTU.TotalCoolingRate) uses the calculation in CalcVRF_FluidTCtrl and CalcVRF, so the TU one is a bit different from the coil one. I saw this happening when fixing some unit tests in another VRF branch.

Oh you mean I should change the TU sensible and latent output calculation in CalcVRF_FluidTCtrl and CalcVRF to use this function as well? @mjwitte

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Defect Includes code to repair a defect in EnergyPlus
Projects
None yet
2 participants