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

VRFFluidTCtrl HR model division by zero when hard sized #10800

Open
1 of 3 tasks
yujiex opened this issue Oct 23, 2024 · 0 comments · May be fixed by #10649
Open
1 of 3 tasks

VRFFluidTCtrl HR model division by zero when hard sized #10800

yujiex opened this issue Oct 23, 2024 · 0 comments · May be fixed by #10649
Assignees

Comments

@yujiex
Copy link
Collaborator

yujiex commented Oct 23, 2024

Issue overview

In debug build, the following line will trigger a division-by-zero error, due to HeatingCapacityUser being 0 if the system is not autosized.

if ((std::abs(HeatingCapacityDes - HeatingCapacityUser) / HeatingCapacityUser) > state.dataSize->AutoVsHardSizingThreshold) {

When the system is not autosized, HeatingCapacityUser gets value from the RatedHeatCapacity of the VRF object.

HeatingCapacityUser = state.dataHVACVarRefFlow->VRF(VRFCond).RatedHeatCapacity;

HeatingCapacityUser is zero because the RatedHeatCapacity field of the HR model is not initialized (so it's defaults to 0).

The following is the code of the VRF FluidTCtrl HR model input reading, the RatedHeatingCapacity is not initialized, only HeatingCapacity is.

        thisVrfFluidCtrlHR.RatedEvapCapacity = rNumericArgs(1);
        thisVrfFluidCtrlHR.RatedCompPowerPerCapcity = rNumericArgs(2);
        thisVrfFluidCtrlHR.RatedCompPower = thisVrfFluidCtrlHR.RatedCompPowerPerCapcity * thisVrfFluidCtrlHR.RatedEvapCapacity;
        thisVrfFluidCtrlHR.CoolingCapacity = thisVrfFluidCtrlHR.RatedEvapCapacity;
        thisVrfFluidCtrlHR.HeatingCapacity = thisVrfFluidCtrlHR.RatedEvapCapacity * (1 + thisVrfFluidCtrlHR.RatedCompPowerPerCapcity);

This is how the VRF FluidTCtrl HP model inits rated heating capacity

        thisVrfFluidCtrl.RatedEvapCapacity = rNumericArgs(1);
        thisVrfFluidCtrl.RatedCompPowerPerCapcity = rNumericArgs(2);
        thisVrfFluidCtrl.RatedCompPower = thisVrfFluidCtrl.RatedCompPowerPerCapcity * thisVrfFluidCtrl.RatedEvapCapacity;
        thisVrfFluidCtrl.CoolingCapacity = thisVrfFluidCtrl.RatedEvapCapacity;
        thisVrfFluidCtrl.RatedHeatCapacity = thisVrfFluidCtrl.RatedEvapCapacity * (1 + thisVrfFluidCtrl.RatedCompPowerPerCapcity); // <- initialized here
        thisVrfFluidCtrl.HeatingCapacity = thisVrfFluidCtrl.RatedHeatCapacity;

Details

Some additional details for this issue (if relevant):

  • Platform (MacOS, 13.5.2)
  • Version of EnergyPlus (25.1 ec7398a)
  • Unmethours link or helpdesk ticket number

Defect file

VariableRefrigerantFlow_FluidTCtrl_HR_5Zone_hardsize.idf.zip

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 this to the EnergyPlus 25.1 milestone Oct 23, 2024
@yujiex yujiex self-assigned this Oct 23, 2024
@yujiex yujiex linked a pull request Oct 23, 2024 that will close this issue
20 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant