-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #225 from kent0/cyl-update
Update cylinder example with new run_rom and run_fom scripts
- Loading branch information
Showing
6 changed files
with
82 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
% read fom and rom data | ||
fx=dlmread('fom.dragx.dat'); | ||
fy=dlmread('fom.dragy.dat'); | ||
rx=dlmread('rom.dragx.dat'); | ||
ry=dlmread('rom.dragy.dat'); | ||
|
||
% plot fom result: | ||
|
||
tstart=401; | ||
tend=500; | ||
|
||
figure; | ||
plot(fx(:,2),fx(:,3)); xlim([tstart tend]); | ||
title('Drag result'); | ||
xlabel('Time'); | ||
ylabel('Drag'); | ||
|
||
% plot rom result: | ||
%figure; | ||
hold on | ||
rx(:,1)=rx(:,1)+tstart; % restart from t=400 | ||
%plot(rx(:,1),rx(:,4)); xlim([400 500]); | ||
plot(rx(:,1),rx(:,4),'--'); | ||
legend('FOM','ROM'); | ||
%title('ROM drag result'); | ||
xlabel('Time'); | ||
ylabel('Drag'); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
|
||
np=8 # number of processors to use for FOM calculation | ||
makerom cyl_fom # `makerom` can be replaced with `makenek` | ||
|
||
# generate mesh connectivity information | ||
genmap << EOF | ||
cyl | ||
0.1 | ||
EOF | ||
|
||
echo 'running Nek5000 FOM calculation...' | ||
neklmpi cyl $np | ||
logfile=cyl.log.$np | ||
mkdir snaps && mv *cyl0.f* $logfile snaps && ls -r snaps/cyl0.f* > file.list | ||
|
||
# For the current case, we have Re=100. The drag and lift coefficients are also computed by calls in userchk. The following lines extract the data to .dat files | ||
grep dragx snaps/$logfile | sed 's/1dragx//g' > fom.dragx.dat | ||
grep dragy snaps/$logfile | sed 's/1dragy//g' > fom.dragy.dat | ||
|
||
echo 'done with FOM, exiting...' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
makerom cyl_rom | ||
neklmpi cyl 1 | ||
|
||
logfile=cyl.log.1 | ||
|
||
# The detail computation of drag in the ROM is in Kento Kaneko An Augmented Basis Method for Reduced Order Models of Turbulent Flow. Ph.D. thesis (2022). | ||
grep dragx $logfile | sed 's/dragx//' > rom.dragx.dat | ||
grep dragy $logfile | sed 's/dragy//' > rom.dragy.dat | ||
|