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

CondFD Conductivity/Specific Heat Actuator Bug #9221

Merged
merged 3 commits into from
Jan 4, 2022

Conversation

mitchute
Copy link
Collaborator

@mitchute mitchute commented Jan 2, 2022

Pull request overview

  • Fixes a bug in the CondFD conductivity and specific heat actuators where the k and cp values were not being updated in all places.
  • Minor doc updates.

@mitchute mitchute added the Defect Includes code to repair a defect in EnergyPlus label Jan 2, 2022
@mitchute mitchute self-assigned this Jan 2, 2022
Copy link
Collaborator Author

@mitchute mitchute left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I boneheadedly missed that the heat flux with/without EMS actuated k and cp values were not matching before 😒 . This is due to missing updating k and cp in two places with the EMS overrides. The heat flux values now match.

The plot below shows the direct and ems heat flux values for one surface. "Direct" values come from setting k and cp directly in the IDF, and the "ems" values come from setting k and cp to different values in the IDF and then modifying them back to the original values using EMS.

Screen Shot 2022-01-02 at 1 16 32 PM

@@ -110,7 +110,7 @@ \subsection{Conduction Finite Difference}\label{conduction-finite-difference}
Several actuators, called ``CondFD Surface Material Layer,'' are available with actuated component control types for models that use the Conduction Finite Difference solution for conduction through surfaces. These are described below.

\begin{itemize}
\item ``Thermal Conductivity''. Has units of [W/m-K]. Controls the thermal conductivity of the specified material layer within a given surface. Actuator is named from the surface name and material layer name combined with a colon ":". E.g. "SURFNAME:MATERIALLAYERNAME"
\item ``Thermal Conductivity''. Has units of [W/m-K]. Controls the thermal conductivity of the specified material layer within a given surface. Actuator is named from the surface name and material layer name combined with a colon ``:''. E.g. ``SURFNAME:MATERIALLAYERNAME''
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to use correct quotation marks.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment on lines +4171 to +4178
\paragraph{CondFD EMS Heat Source Power After Layer}

This output is the heat power added after material layer N from the EMS heat flux actuator (Component type: ``CondFD Surface Material Layer''; Control type: ``Heat Flux''). Only valid for the CondFD solution algorithm.

\paragraph{CondFD EMS Heat Source Energy After Layer}

This output is the heat energy added after material layer N from the EMS heat flux actuator (Component type: ``CondFD Surface Material Layer''; Control type: ``Heat Flux''). Energy is aggregated on the electricity meter and is only valid for the CondFD solution algorithm.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New EMS-specific output vars are now referenced here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good addition.

Comment on lines +1814 to +1815
ktA1 = kt;
ktA2 = kt;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bugfix: updating conductivity here with EMS override value.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, good call.

Comment on lines +2022 to +2037
// EMS Conductivity 2 Override
if (condActuator2.isActuated) {
kt2 = condActuator1.actuatedValue;
}

// EMS Specific Heat 2 Override
if (specHeatActuator2.isActuated) {
Cp2 = specHeatActuator1.actuatedValue;
}

// Update EMS internal variables
surfFD.condNodeReport(i) = kt1;
surfFD.specHeatNodeReport(i) = Cp1;
surfFD.condNodeReport(i + 1) = kt2;
surfFD.specHeatNodeReport(i + 1) = Cp2;

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bugfix: updating k and cp here with EMS override values.

Comment on lines -2064 to -2068
// EMS Conductivity 2 Override
if (condActuator2.isActuated) {
kt2 = condActuator2.actuatedValue;
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused code, removing.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome

Comment on lines -2074 to -2077
// EMS Specific Heat 2 Override
if (specHeatActuator2.isActuated) {
Cp2 = specHeatActuator2.actuatedValue;
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused code, removing.

Comment on lines -2080 to +2091
state.dataHeatBalFiniteDiffMgr->SurfaceFD(Surf).condNodeReport(i) = kt1;
state.dataHeatBalFiniteDiffMgr->SurfaceFD(Surf).specHeatNodeReport(i) = Cp1;
state.dataHeatBalFiniteDiffMgr->SurfaceFD(Surf).condNodeReport(i + 1) = kt2;
state.dataHeatBalFiniteDiffMgr->SurfaceFD(Surf).specHeatNodeReport(i + 1) = Cp2;
surfFD.condNodeReport(i) = kt1;
surfFD.specHeatNodeReport(i) = Cp1;
surfFD.condNodeReport(i + 1) = kt2;
surfFD.specHeatNodeReport(i + 1) = Cp2;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renaming with already-existing local reference.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice.

Comment on lines -2181 to +2192
state.dataHeatBalFiniteDiffMgr->SurfaceFD(Surf).condNodeReport(i) = kt1;
state.dataHeatBalFiniteDiffMgr->SurfaceFD(Surf).specHeatNodeReport(i) = Cp1;
state.dataHeatBalFiniteDiffMgr->SurfaceFD(Surf).condNodeReport(i + 1) = kt2;
state.dataHeatBalFiniteDiffMgr->SurfaceFD(Surf).specHeatNodeReport(i + 1) = Cp2;
surfFD.condNodeReport(i) = kt1;
surfFD.specHeatNodeReport(i) = Cp1;
surfFD.condNodeReport(i + 1) = kt2;
surfFD.specHeatNodeReport(i + 1) = Cp2;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renaming with already-existing local reference.

@@ -110,7 +110,7 @@ \subsection{Conduction Finite Difference}\label{conduction-finite-difference}
Several actuators, called ``CondFD Surface Material Layer,'' are available with actuated component control types for models that use the Conduction Finite Difference solution for conduction through surfaces. These are described below.

\begin{itemize}
\item ``Thermal Conductivity''. Has units of [W/m-K]. Controls the thermal conductivity of the specified material layer within a given surface. Actuator is named from the surface name and material layer name combined with a colon ":". E.g. "SURFNAME:MATERIALLAYERNAME"
\item ``Thermal Conductivity''. Has units of [W/m-K]. Controls the thermal conductivity of the specified material layer within a given surface. Actuator is named from the surface name and material layer name combined with a colon ``:''. E.g. ``SURFNAME:MATERIALLAYERNAME''
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment on lines +4171 to +4178
\paragraph{CondFD EMS Heat Source Power After Layer}

This output is the heat power added after material layer N from the EMS heat flux actuator (Component type: ``CondFD Surface Material Layer''; Control type: ``Heat Flux''). Only valid for the CondFD solution algorithm.

\paragraph{CondFD EMS Heat Source Energy After Layer}

This output is the heat energy added after material layer N from the EMS heat flux actuator (Component type: ``CondFD Surface Material Layer''; Control type: ``Heat Flux''). Energy is aggregated on the electricity meter and is only valid for the CondFD solution algorithm.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good addition.

Comment on lines +1814 to +1815
ktA1 = kt;
ktA2 = kt;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, good call.

Comment on lines -2064 to -2068
// EMS Conductivity 2 Override
if (condActuator2.isActuated) {
kt2 = condActuator2.actuatedValue;
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome

Comment on lines -2080 to +2091
state.dataHeatBalFiniteDiffMgr->SurfaceFD(Surf).condNodeReport(i) = kt1;
state.dataHeatBalFiniteDiffMgr->SurfaceFD(Surf).specHeatNodeReport(i) = Cp1;
state.dataHeatBalFiniteDiffMgr->SurfaceFD(Surf).condNodeReport(i + 1) = kt2;
state.dataHeatBalFiniteDiffMgr->SurfaceFD(Surf).specHeatNodeReport(i + 1) = Cp2;
surfFD.condNodeReport(i) = kt1;
surfFD.specHeatNodeReport(i) = Cp1;
surfFD.condNodeReport(i + 1) = kt2;
surfFD.specHeatNodeReport(i + 1) = Cp2;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice.

@Myoldmopar
Copy link
Member

Great fix here, the change makes sense, and some extra cleanup along the way. CI is happy with it except the license year, which is fixed separately. Not wasting more cycles just for that. Merging this in, thanks @mitchute !

@Myoldmopar Myoldmopar merged commit 1a9288c into develop Jan 4, 2022
@Myoldmopar Myoldmopar deleted the condfd-actuator-bug branch January 4, 2022 15:17
yujiex pushed a commit that referenced this pull request Jan 27, 2022
CondFD Conductivity/Specific Heat Actuator Bug
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
Development

Successfully merging this pull request may close these issues.

6 participants