Skip to content

Commit

Permalink
Merge pull request #234 from ucdavis/KL/addAdditionalOutputs
Browse files Browse the repository at this point in the history
Report additional outputs for chp and gp models
  • Loading branch information
kaiyanl authored Apr 18, 2022
2 parents 2bed6bb + f36f7d7 commit 4a48403
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 35 deletions.
1 change: 1 addition & 0 deletions src/components/Results/ResultsTables.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ export const ResultsTable = (props: Props) => {
props.yearlyResults.length
)}
system={props.frcsInputs.system}
teaModel={props.teaModel}
/>
</div>
</>
Expand Down
95 changes: 60 additions & 35 deletions src/components/Results/Technoeconomic/TechnoeconomicTables.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import React from 'react';
import { formatCurrency, formatNumber } from '../../Shared/util';
import { YearlyResult } from '../../../models/Types';
import { TechnoeconomicModels, YearlyResult } from '../../../models/Types';
import { Table } from 'reactstrap';
import { CashFlow } from '@ucdavis/tea/output.model';

interface Props {
yearlyResults: YearlyResult[];
cashFlows: CashFlow[];
system: String;
teaModel: string;
}

export const TechnoeconomicTables = (props: Props) => {
Expand Down Expand Up @@ -266,6 +267,25 @@ export const TechnoeconomicTables = (props: Props) => {
</td>
))}
</tr>
{props.teaModel === TechnoeconomicModels.gasificationPower && (
<tr>
<td>Dual Fuel Cost</td>
<td>$</td>
<td>
{formatCurrency(
props.cashFlows.reduce(
(sum: number, x: CashFlow) => sum + x.DualFuelCost,
0
)
)}
</td>
{props.cashFlows.map((result, i) => (
<td key={`dualFuelCost-${i}`}>
{formatCurrency(result.DualFuelCost)}
</td>
))}
</tr>
)}
<tr>
<td>Non-fuel Expenses</td>
<td>$</td>
Expand Down Expand Up @@ -318,7 +338,7 @@ export const TechnoeconomicTables = (props: Props) => {
))}
</tr>
<tr>
<td>Income Capacity</td>
<td>Income--Capacity</td>
<td>$</td>
<td>
{formatCurrency(
Expand All @@ -334,40 +354,45 @@ export const TechnoeconomicTables = (props: Props) => {
</td>
))}
</tr>
<tr>
<td>Interest On Debt Reserve</td>
<td>$</td>
<td>
{formatCurrency(
props.cashFlows.reduce(
(sum: number, x: CashFlow) => sum + x.InterestOnDebtReserve,
0
)
)}
</td>
{props.cashFlows.map((result, i) => (
<td key={`interestOnDebtReserve-${i}`}>
{formatCurrency(result.InterestOnDebtReserve)}
{(props.teaModel === TechnoeconomicModels.genericCombinedHeatAndPower ||
props.teaModel === TechnoeconomicModels.gasificationPower) && (
<tr>
<td>Income--Heat</td>
<td>$</td>
<td>
{formatCurrency(
props.cashFlows.reduce(
(sum: number, x: CashFlow) => sum + x.IncomeHeat,
0
)
)}
</td>
))}
</tr>
<tr>
<td>Income -- Capacity</td>
<td>$</td>
<td>
{formatCurrency(
props.cashFlows.reduce(
(sum: number, x: CashFlow) => sum + x.IncomeCapacity,
0
)
)}
</td>
{props.cashFlows.map((result, i) => (
<td key={`incomeCapacity-${i}`}>
{formatCurrency(result.IncomeCapacity)}
{props.cashFlows.map((result, i) => (
<td key={`incomeHeat-${i}`}>
{formatCurrency(result.IncomeHeat)}
</td>
))}
</tr>
)}
{props.teaModel === TechnoeconomicModels.gasificationPower && (
<tr>
<td>Income--Char/Ash</td>
<td>$</td>
<td>
{formatCurrency(
props.cashFlows.reduce(
(sum: number, x: CashFlow) => sum + x.IncomeChar,
0
)
)}
</td>
))}
</tr>
{props.cashFlows.map((result, i) => (
<td key={`incomeChar-${i}`}>
{formatCurrency(result.IncomeChar)}
</td>
))}
</tr>
)}
<tr>
<td>Interest On Debt Reserve</td>
<td>$</td>
Expand All @@ -380,7 +405,7 @@ export const TechnoeconomicTables = (props: Props) => {
)}
</td>
{props.cashFlows.map((result, i) => (
<td key={`interestonDebtReserve-${i}`}>
<td key={`interestOnDebtReserve-${i}`}>
{formatCurrency(result.InterestOnDebtReserve)}
</td>
))}
Expand Down

0 comments on commit 4a48403

Please sign in to comment.