Skip to content

Commit

Permalink
fixed bugs in MAFOT,QT5,GUI
Browse files Browse the repository at this point in the history
  • Loading branch information
plasmapotential committed Jan 15, 2021
1 parent e0061bd commit 54d69ab
Show file tree
Hide file tree
Showing 8 changed files with 72 additions and 28 deletions.
14 changes: 12 additions & 2 deletions source/AppImageBuilder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ version: 1
#notes:
#if you get a permission denied error from self.unix_socket, run this command:
# sudo chmod 0666 /var/run/docker.sock
#
# You need to make sure MAFOT was compiled into the HEAT directory

script:
# Remove any previous build
Expand Down Expand Up @@ -39,8 +41,11 @@ script:
- cp -rn /opt/openfoam/openfoam-OpenFOAM-v1912/etc AppDir/usr/opt/openfoam/openfoam1912/etc
- cp -rn /opt/openfoam/openfoam-OpenFOAM-v1912/bin AppDir/usr/opt/openfoam/openfoam1912/bin
- cp -rn /opt/openfoam/openfoam-OpenFOAM-v1912/platforms AppDir/usr/opt/openfoam/openfoam1912/platforms
# set up environment var files for openfoam inside appimage
- rm AppDir/usr/opt/openfoam/openfoam1912/etc/bashrc
- mv AppDir/usr/opt/openfoam/openfoam1912/etc/bashrc_HEAT AppDir/usr/opt/openfoam/openfoam1912/etc/bashrc
- rm AppDir/usr/opt/openfoam/openfoam1912/etc/config.sh/setup
- mv AppDir/usr/opt/openfoam/openfoam1912/etc/config.sh/setupHEAT AppDir/usr/opt/openfoam/openfoam1912/etc/config.sh/setup
# copy swak4foam bins and libs (for groovyBC)
- cp -rn /home/tom/OpenFOAM/tom-v1912/platforms/linux64GccDPInt32Opt/bin/* AppDir/usr/opt/openfoam/openfoam1912/platforms/linux64GccDPInt32Opt/bin
- cp -rn /home/tom/OpenFOAM/tom-v1912/platforms/linux64GccDPInt32Opt/lib/* AppDir/usr/opt/openfoam/openfoam1912/platforms/linux64GccDPInt32Opt/lib
Expand Down Expand Up @@ -68,7 +73,7 @@ AppDir:
id: HEATAppimage
name: HEAT_AppImage
icon: flame
version: v1.1-beta
version: v1.2-beta
# # Set the python executable as entry point
# exec: usr/bin/python3
# # Set the application main script path as argument. Use '$@' to forward CLI parameters
Expand All @@ -89,15 +94,16 @@ AppDir:
# key_url: 'https://dl.openfoam.com/pubkey.gpg'

include:
- qt5-default
- libc6-dev
- bash
- libnglib-6.2.1804
- coreutils
- python3
- python3-pkg-resources
- python3-tk
- mdsplus-python
- python3-distutils
- mdsplus-python
# FreeCAD
# - freecad-python3 #
- freecad
Expand Down Expand Up @@ -175,6 +181,10 @@ AppDir:
PyLib: '3.8'
MATPLOTLIBDATA: '${APPDIR}/usr/lib/python3.8/site-packages/matplotlib/mpl-data'
MATPLOTLIBRC: '${APPDIR}/usr/lib/python3.8/site-packages/matplotlib/mpl-data/matplotlibrc'
# openFOAM no user files
FOAM_CONFIG_NOUSER: 'True'
# for debbuging qt errors
#QT_DEBUG_PLUGINS: '1'

test:
fedora:
Expand Down
4 changes: 2 additions & 2 deletions source/GUIclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ def findPsiSepfromPFCs(self, t, rNew=None):
Both MHD and PFC objects must be defined before running this function
"""
tIdx = np.where(t==self.MHD.timesteps)[0][0]
gfile = self.MHD.shotPath + '/' + '{:06d}/'.format(t) + 'g{:6d}.{:05d}'.format(self.MHD.shot, t)
gfile = self.MHD.shotPath + '{:06d}/'.format(t) + 'g{:06d}.{:05d}'.format(self.MHD.shot, t)
#redefine LCFS to be tangent to CAD maximum R (because rNew=None)
self.newLCFS(t, rNew=rNew, zNew=None, psiSep=None)
print("CAD rTangent: {:f}".format(self.MHD.rTangent))
Expand Down Expand Up @@ -405,7 +405,7 @@ def newLCFS(self, t, rNew=None, zNew=None, psiSep=None):
self.MHD.rTangent = rNew

#overwrite existing gfile
gfile = self.MHD.shotPath + '/' + '{:06d}/'.format(t) + 'g{:06d}.{:05d}'.format(self.MHD.shot, t)
gfile = self.MHD.shotPath + '{:06d}/'.format(t) + 'g{:06d}.{:05d}'.format(self.MHD.shot, t)
self.MHD.writeGfile(gfile, shot=self.MHD.shot, time=t, ep=ep)
self.MHD.ep[idx] = EP.equilParams(gfile)
for PFC in self.PFCs:
Expand Down
64 changes: 52 additions & 12 deletions source/GUIscripts/postProcessFunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,39 +13,79 @@
#data = np.genfromtxt(file,comments="#", autostrip=True)
#fig = px.line(x=data[:,0],y=data[:,1])

root = '/home/tom/HEAT/data/d3d_000002/openFoam/heatFoam/'
file1 = root+'T002/postProcessing/probes/0/T'
file2 = root+'T101A/postProcessing/probes/0/T'
root = '/home/tom/results/WGPFC_Validation/staticScans/memo010_1.1/nstx_116313_LwrOut/openFoam/heatFoam/'
file1 = root+'SOLID844/postProcessing/probes/0/T'
file2 = root+'E-ED1408-284/postProcessing/probes/0/T'

data1 = np.genfromtxt(file1,comments="#", autostrip=True)
data2 = np.genfromtxt(file2,comments="#", autostrip=True)
fig = go.Figure()
fig.add_trace(go.Scatter(x=data1[:,0], y=data1[:,1], name="T002", line=dict(color='royalblue', width=6, dash='dashdot')))
fig.add_trace(go.Scatter(x=data2[:,0],y=data2[:,1],name="T101A", line=dict(color='magenta', width=6)))
fig.add_trace(go.Scatter(x=data1[:,0], y=data1[:,1], name="IBDH", line=dict(color='royalblue', width=6, dash='dot')))
fig.add_trace(go.Scatter(x=data2[:,0],y=data2[:,1],name="OBD", line=dict(color='magenta', width=6)))
fig.add_trace(go.Scatter(
x=[0, 3.2],
x=[0, 6],
y=[1873, 1873],
mode="lines+markers+text",
name="Sublimation T",
name="Limit",
text=["Limit", "Limit"],
textposition="top center",
line=dict(color='firebrick', width=3, dash='dot'),
textfont=dict(family="Arial", size=16, color="firebrick"),
textfont=dict(family="Arial", size=18, color="firebrick"),

))

fig.update_layout(
title="Temperature Probe Time Evolution: D3D negD",
#title="Temperature Probe Time Evolution",
xaxis_title="Time [s]",
yaxis_title="Temperature [K]",
font=dict(
family="Arial",
size=24,
color="Black"
family="Arial",
size=24,
color="Black"
),
margin=dict(
l=5,
r=5,
b=5,
t=5,
pad=2
),
)

fig.update_layout(legend=dict(
yanchor="top",
y=0.99,
xanchor="left",
x=0.01
))

fig.add_annotation(x=3.0, y=1000,
text="IBDH T(5s) = 2533 K",
showarrow=False,
yshift=20,
font=dict(
family="Arial",
size=24,
color="royalblue",
),
)

fig.add_annotation(x=3.0, y=850,
text=" OBD T(5s) = 1935 K",
showarrow=False,
yshift=20,
font=dict(
family="Arial",
size=24,
color="magenta",
),
)



fig.show()

fig.write_image("/home/tom/phd/papers/2020Fall_FST_HEATintro/HEATintro/figures/hf_case1_2.svg")


import pandas as pd
Expand Down
Binary file modified source/__pycache__/GUIclass.cpython-38.pyc
Binary file not shown.
2 changes: 0 additions & 2 deletions source/dashGUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -878,8 +878,6 @@ def loadRes(n_clicks, ROIGridRes, gridRes, MachFlag):
[State('CAD-upload', 'contents'),
State('MachFlag', 'value')])
def loadCAD(STPfile, STPcontents, MachFlag):
if STPfile is None:
raise PreventUpdate
if MachFlag is None:
return [html.Label("Select a machine first", style={'color':'#fc0313'})]
else:
Expand Down
6 changes: 3 additions & 3 deletions source/inputs/NSTXU/30degLwrDiv.csv
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
#
timesteps, PFCname, MapDirection, DivCode, intersectName
#=====IBDH
0:5000, SOLID844, 1, LO, SOLID844:SOLID843#:E-ED1408-284:E-ED1408-573:E-ED1408-556
0:5000, SOLID844, 1, LO, SOLID844:SOLID843:E-ED1408-284:E-ED1408-573:E-ED1408-556
#0:5000, SOLID843, 1, LO, SOLID843:SOLID842#:E-ED1408-556:E-ED1408-539:E-ED1408-522
#=====OBD
0:5000, E-ED1408-284, 1, LO, E-ED1408-284:E-ED1408-573#:E-ED1408-556
0:5000, E-ED1408-573, 1, LO, E-ED1408-573:E-ED1408-556#:E-ED1408-539
0:5000, E-ED1408-284, 1, LO, E-ED1408-284:E-ED1408-573:E-ED1408-556
#0:5000, E-ED1408-573, 1, LO, E-ED1408-573:E-ED1408-556#:E-ED1408-539
#0:5000, E-ED1408-556, 1, LO, E-ED1408-556:E-ED1408-539:E-ED1408-522
#0:5000, E-ED1408-539, 1, LO, E-ED1408-539:E-ED1408-522:E-ED1408-159
#=====IBD
Expand Down
2 changes: 1 addition & 1 deletion source/inputs/ST40/ST40_input.csv
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ fracLO,0.0
#==============================================================
Nphi, 1
ittLaminar, 10.0
ittStruct, 1.0
ittStruct, 30.0
Smin, 0.0
Smax, 5.0
phimin, 0.0
Expand Down
8 changes: 2 additions & 6 deletions source/inputs/ST40/limiter.csv
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,5 @@
# 40-1783_2 TILE UPPER
# 40-1782_3 TILE LOWER TYPE A0
timesteps, PFCname, MapDirection, DivCode, intersectName
0:250, T031, -1, UI, T031:T038:T030:T039:T044:T045
0:250, T032, -1, UI, T032:T033:T022:T023:T018:T019
0:250, T033, -1, UI, T033
#0:250, T031, 1, LI, T031
0:250, T030, 1, LI, T030
0:250, T029, 1, LI, T029
0:250, T031, -1, UI, T031:T030:T024:T025
0:250, T031, 1, LI, T031:T032:T037:T038

0 comments on commit 54d69ab

Please sign in to comment.