Skip to content

Commit

Permalink
FM_Burner: preliminary results NIST 2023
Browse files Browse the repository at this point in the history
  • Loading branch information
rmcdermo committed Aug 16, 2023
1 parent eb9bb24 commit 8c2e943
Show file tree
Hide file tree
Showing 21 changed files with 2,054 additions and 28 deletions.
57 changes: 29 additions & 28 deletions .github/workflows/Extinction.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ name: Extinction

# Controls when the workflow will run
on:
# # Triggers the workflow on push or pull request events but only for the master branch
# push:
# branches: [ master ]
# paths:
# - .github/Extinction.yml
# - Extinction/**
# pull_request:
# branches: [ master ]
# paths:
# - .github/Extinction.yml
# - Extinction/**
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
paths:
- .github/Extinction.yml
- Extinction/**
pull_request:
branches: [ master ]
paths:
- .github/Extinction.yml
- Extinction/**

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -40,23 +40,24 @@ jobs:

# When submitting computational results, add your script to the list below (follow the example)

# # Step 1: generate the plots
# - name: NIST Preliminary Results
# run: |
# echo $GITHUB_WORKSPACE
# cd $GITHUB_WORKSPACE/Liquid_Pool_Fires/NIST_Pool_Fires/Computational_Results/2023/NIST
# python NIST_Pool_Fires_plot_cmp.py

# # Step 2: push the plots to the releases page
# - name: Push NIST Results to release
# if: github.event_name == 'push' && github.repository_owner == 'MaCFP'
# run: |
# cd $GITHUB_WORKSPACE/Liquid_Pool_Fires/NIST_Pool_Fires/Computational_Results/2023/NIST/Preliminary_Results
# zip Plots.zip -r Plots
# mv Plots.zip NIST_Pool_Fires_NIST_Plots.zip
# gh release upload SCRIPT_FIGURES NIST_Pool_Fires_NIST_Plots.zip --clobber
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Step 1: generate the plots
- name: NIST Preliminary Results
run: |
echo $GITHUB_WORKSPACE
cd $GITHUB_WORKSPACE/Extinction/FM_Burner/Computational_Results/2023/NIST
python FM_Burner_post_process.py
python FM_Burner_plot_cmp.py
# Step 2: push the plots to the releases page
- name: Push NIST Results to release
if: github.event_name == 'push' && github.repository_owner == 'MaCFP'
run: |
cd $GITHUB_WORKSPACE/Extinction/FM_Burner/Computational_Results/2023/NIST/Preliminary_Results
zip Plots.zip -r Plots
mv Plots.zip FM_Burner_NIST_Plots.zip
gh release upload SCRIPT_FIGURES FM_Burner_NIST_Plots.zip --clobber
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# ADD YOUR INSTITUTION BELOW, COPY STEPS 1 AND 2, CHANGE INSTITUTE NAME (AFTER 2023 AND WITHIN ZIP FILENAME)

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env python3
# McDermott
# Feb 2021

# first, make sure the macfp module directory is in your path
# if not, uncomment the lines below and replace <path to macfp-db>
# with the path (absolute or relative) to your macfp-db repository

import sys
# sys.path.append('<path to macfp-db>/macfp-db/Utilities/')
sys.path.append('../../../../../../macfp-db/Utilities/')

import macfp
import importlib
importlib.reload(macfp) # use for development (while making changes to macfp.py)
import matplotlib.pyplot as plt

macfp.dataplot(config_filename='FM_Burner_cmp_config.csv',
institute='NIST',
revision='MaCFP-3, Tsukuba, 2023',
expdir='../../../Experimental_Data/',
cmpdir='./Preliminary/',
pltdir='./Preliminary/Plots/',
close_figs=True,
verbose=True,
plot_list=['all'])

# plt.show()
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/usr/bin/env python3
# McDermott
# 16 Aug 2023
#
# Read and process FDS output files for FM_Burner cases to compute
# Eta (combustion efficiency) and Chi_r (radiative fraction)

import numpy as np
import pandas as pd

outdir = './Preliminary_Results/'

# create files with XO2 as independent column

fuel_name = ['C2H4','C3H6','C3H8','CH4']
res_name = ['2cm'] #,'1cm','5mm']

for fuel in fuel_name:
for res in res_name:

DEV = pd.read_csv(outdir+'FM_15cm_Burner_'+fuel+'_'+res+'_devc.csv', sep=',', header=1)
HRR = pd.read_csv(outdir+'FM_15cm_Burner_'+fuel+'_'+res+'_hrr.csv', sep=',', header=1)

XO2_FDS = DEV["XO2"].values[:].astype(float)
Qdot_FDS = HRR["HRR"].values[:].astype(float)
Qrad_FDS = HRR["Q_RADI"].values[:].astype(float)

ETA = Qdot_FDS/np.max(Qdot_FDS)
CHI_R = np.minimum(1.,np.maximum(0.,-Qrad_FDS)/np.maximum(0.001,Qdot_FDS))

df = pd.DataFrame({'XO2': XO2_FDS[1:],
'eta': ETA[1:],
'Chi_R': CHI_R[1:]})

df.to_csv(outdir+'FM_15cm_Burner_'+fuel+'_'+res+'.csv',index=False,float_format='%5.3f')

# create files with Time as independent column for C2H4 fuel

O2_name = ['20p9','19p0','16p8','15p2']
res_name = ['2cm'] #,'1cm','5mm']

for O2 in O2_name:
for res in res_name:

HRR = pd.read_csv(outdir+'FM_15cm_Burner_C2H4_'+O2+'_'+res+'_hrr.csv', sep=',', header=1);

Time_FDS = HRR["Time"].values[:].astype(float)
Qdot_FDS = HRR["HRR"].values[:].astype(float)
Qrad_FDS = HRR["Q_RADI"].values[:].astype(float)

CHI_R = np.minimum(1.,np.maximum(0.,-Qrad_FDS)/np.maximum(0.001,Qdot_FDS))

df = pd.DataFrame({'Time': Time_FDS[1:],
'Chi_r': CHI_R[1:]})

df.to_csv(outdir+'FM_15cm_Burner_C2H4_'+O2+'_'+res+'_chir.csv',index=False,float_format='%5.3f')


Loading

0 comments on commit 8c2e943

Please sign in to comment.