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

MEP_Engine: Remove AHU Create Method, Add LengthbyPart and FaceArea #1704

Merged
merged 2 commits into from
Apr 28, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 0 additions & 81 deletions MEP_Engine/Create/AirHandlingUnit.cs

This file was deleted.

3 changes: 2 additions & 1 deletion MEP_Engine/MEP_Engine.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Create\AirHandlingUnit.cs" />
<Compile Include="Create\CoolingCoil.cs" />
<Compile Include="Create\ElectricalConnector.cs" />
<Compile Include="Create\EnergyWheel.cs" />
Expand All @@ -70,6 +69,8 @@
<Compile Include="Create\HeatingCoil.cs" />
<Compile Include="Create\IdentityFragment.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Query\EquipmentLengthByPart.cs" />
<Compile Include="Query\FaceAreaByVelocity.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\BHoM_Engine\BHoM_Engine.csproj">
Expand Down
65 changes: 65 additions & 0 deletions MEP_Engine/Query/EquipmentLengthByPart.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/*
* This file is part of the Buildings and Habitats object Model (BHoM)
* Copyright (c) 2015 - 2020, the respective contributors. All rights reserved.
*
* Each contributor holds copyright over their respective contributions.
* The project versioning (Git) records all such contribution source information.
*
*
* The BHoM is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3.0 of the License, or
* (at your option) any later version.
*
* The BHoM is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this code. If not, see <https://www.gnu.org/licenses/lgpl-3.0.html>.
*/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using BH.oM.MEP;
using BH.oM.MEP.Equipment;
using BH.oM.Base;
using BH.oM.Geometry;
using BH.Engine.Geometry;

using BH.oM.Reflection.Attributes;
using System.ComponentModel;

using BH.oM.Geometry.SettingOut;

using BH.Engine.Base;

namespace BH.Engine.MEP
{
public static partial class Query
{
/***************************************************/
/**** Public Methods ****/
/***************************************************/

[Description("Returns the length of the equipment based on the input of a list of parts")]
[Input("airsidePartsByLength", "Collection of airside parts from a dataset that contains parts by length")]
[Output("length", "The total length of the equipment based on the length of the parts")]
public static double EquipmentLengthByPart (this List<CustomObject> airsidePartsByLength)
{
double length = 0;
foreach (CustomObject o in airsidePartsByLength)
{
if (o.CustomData.ContainsKey("length"))
length += System.Convert.ToDouble(o.CustomData["length"]);
}

return length;
}
}
}
59 changes: 59 additions & 0 deletions MEP_Engine/Query/FaceAreaByVelocity.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*
* This file is part of the Buildings and Habitats object Model (BHoM)
* Copyright (c) 2015 - 2020, the respective contributors. All rights reserved.
*
* Each contributor holds copyright over their respective contributions.
* The project versioning (Git) records all such contribution source information.
*
*
* The BHoM is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3.0 of the License, or
* (at your option) any later version.
*
* The BHoM is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this code. If not, see <https://www.gnu.org/licenses/lgpl-3.0.html>.
*/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using BH.oM.MEP;
using BH.oM.MEP.Equipment;
using BH.oM.Base;
using BH.oM.Geometry;
using BH.Engine.Geometry;

using BH.oM.Reflection.Attributes;
using System.ComponentModel;

using BH.oM.Geometry.SettingOut;

using BH.Engine.Base;

namespace BH.Engine.MEP
{
public static partial class Query
{
/***************************************************/
/**** Public Methods ****/
/***************************************************/

[Description("Returns the height and width of the equipment based on the inputs of AirVelocityAcrossCoil and TotalAirFlow")]
[Input("mepEquipmentObject", "MEP object that contains properties for AirVelocityAcrossCoil and TotalAirFlow")]
[Output("widthlength", "This is the width OR the length (they are the same value), since the method is taking the square root of the airflow divided by the velocity")]
public static double FaceAreaByVelocity(this AirHandlingUnit mepEquipmentObject)
{
return Math.Sqrt(mepEquipmentObject.TotalAirFlow / mepEquipmentObject.AirVelocityAcrossCoil);

FraserGreenroyd marked this conversation as resolved.
Show resolved Hide resolved
}
}
}