Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
9cf2b14
Initial commit for setting up SU2-FEniCS tutorial
IshaanDesai Jul 7, 2020
934791d
Merge branch 'develop' into add_SU2-FEniCS_FSItutorial
IshaanDesai Aug 28, 2020
632fcc1
Converting Fluid participant to 2D
IshaanDesai Aug 28, 2020
14a5ad8
Further modifying SU2 participant for 2D case
IshaanDesai Sep 1, 2020
4e13ce4
Removing unnecessary log files and adding fine mesh
IshaanDesai Sep 21, 2020
9f20e55
Lowering initial velocity to stabilize SU2 participant
IshaanDesai Sep 22, 2020
00327f3
Merge branch 'develop' into add_SU2-FEniCS_FSItutorial
IshaanDesai Sep 22, 2020
2454bb3
Removing duplicate plotting file
IshaanDesai Sep 22, 2020
4f5a170
Tuning case and file restructuring
IshaanDesai Oct 1, 2020
1e460dc
Stable FSI case with reasonable tip displacement (6 seconds)
IshaanDesai Oct 1, 2020
26fd077
Changing execution scripts to make this tutorial consistent with othe…
IshaanDesai Oct 1, 2020
ae0dd89
Finalising case
IshaanDesai Oct 7, 2020
1ab536d
Modifying README
IshaanDesai Oct 14, 2020
89afbb9
Removing single physics run of SU2
IshaanDesai Oct 14, 2020
3c57800
Formatting preCICE config and moving tutorial to 2D folder
IshaanDesai Oct 15, 2020
d39257b
Removing output filed added by mistake
IshaanDesai Oct 15, 2020
a6a1f3a
Increase Elasticity modulus to make structure stiffer
IshaanDesai Oct 15, 2020
d3d7b92
Minor clean up
IshaanDesai Oct 16, 2020
1aac048
Add float dt rather than FEniCS Constant dt variable
IshaanDesai Nov 11, 2020
d629fd8
Modifying FEniCS script according to new parallel design of adapter
IshaanDesai Dec 19, 2020
ae81fd7
Revert "Modifying FEniCS script according to new parallel design of a…
IshaanDesai Dec 19, 2020
d78ff4a
Modifying FEniCS-Adapter initialization
IshaanDesai Dec 19, 2020
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
53 changes: 53 additions & 0 deletions FSI/flap_perp_2D/SU2-FEniCS/Allclean
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory

echo "Cleaning..."

# Participant 1: Fluid
Participant1="Fluid"
cd ${Participant1}
# Clean the result and auxiliary files
rm -fv flow_*.vtk
rm -fv history_*.vtk
rm -fv restart_flow_*.dat
rm -fv forces_breakdown.dat
rm -fv surface_flow_*.csv
cd ..

# Remove the log files
rm -fv ${Participant1}.log
rm -fv Output/*.log

# Participant 2: Solid
Participant2="Solid"
cd ${Participant2}
# Clean the case
rm -fv *.log
rm -fv *.vtk
rm -fv *.pvd
rm -fv FSI-S/*
cd ..
# Remove the log files
rm -fv spooles.out
rm -fv ${Participant2}.log

# Remove the preCICE-related log files
echo "Deleting the preCICE log files..."
rm -fv \
precice-*.log \
precice-postProcessingInfo.log \
precice-*-events.json

# Output files for preCICE versions before 1.2:
rm -fv \
iterations-${Participant1}.txt iterations-${Participant2}.txt \
convergence-${Participant1}.txt convergence-${Participant2}.txt \
Events-${Participant1}.log Events-${Participant2}.log \
EventTimings-${Participant1}.log EventTimings-${Participant2}.log

# Remove the preCICE address files
rm -rfv precice-run
rm -fv .*.address

echo "Cleaning complete!"
#------------------------------------------------------------------------------
66 changes: 66 additions & 0 deletions FSI/flap_perp_2D/SU2-FEniCS/Allrun
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#!/bin/bash

# This script prepares and runs all the participants in one terminal,
# forwarding the solvers' output to log files.
# Alternatively, you may execute the scripts "runSolid" and "runFluid"
# in separate terminals.

# Run this script with "-parallel" for parallel simulations

# The script "Allclean" cleans-up the result and log files.
# Set up the run parameters:

# 1 for true, 0 for false
parallel=0
if [ "$1" = "-parallel" ]; then
parallel=1
fi

# =============== Participant 1: Fluid ===========================
Participant1="Fluid"
Solver1="SU2_CFD"
nproc=2

# Run and get the process id
if [ $parallel -eq 1 ]; then
echo " Starting the ${Participant1} participant in parallel..."
mpirun -np ${nproc} ${Solver1} Fluid/euler_config_coupled.cfg > ${Participant1}.log 2>&1 &
else
echo " Starting the ${Participant1} participant in serial..."
${Solver1} Fluid/euler_config_coupled.cfg > ${Participant1}.log 2>&1 &
fi
PIDParticipant1=$!

# =============== Participant 2: Solid ===========================
Participant2="Solid"

# Run
echo " Starting the ${Participant2} participant..."
python3 ${Participant2}/perp-flap.py > ${Participant2}.log 2>&1 &
PIDParticipant2=$!


# =============== Wait for all the participants to finish =======
echo "Waiting for the participants to exit..., PIDs: ${PIDParticipant1}, ${PIDParticipant2}"
echo "(you may run 'tail -f ${Participant1}.log' in another terminal to check the progress)"

echo "To interrupt the simulation, press 'c'. Ctrl+C will only send the processes to the background."
while [ -e /proc/${PIDParticipant1} ]; do
read -r -t1 -n1 input
if [ "$input" = "c" ]; then
kill ${PIDParticipant1}
kill ${PIDParticipant2}
false
fi
done

if [ $? -ne 0 ] || [ "$(grep -c -E "error:" ${Participant1}.log)" -ne 0 ] || [ "$(grep -c -E "error:" ${Participant2}.log)" -ne 0 ]; then
echo ""
echo "Something went wrong... See the log files for more."
# Precaution
kill ${PIDParticipant1}
kill ${PIDParticipant2}
else
echo ""
echo "The simulation completed! (check for any errors)"
fi
274 changes: 274 additions & 0 deletions FSI/flap_perp_2D/SU2-FEniCS/Fluid/euler_config_coupled.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,274 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% SU2 configuration file %
% Case description: Coupled FSI simulation of fluid flow over a flap %
% Authors: Kirill Martynov, Dmytro Sashko, Jan Sültemeyer %
% Institution: Technische Universität München %
% Date: 01.11.2017 %
% %
% Modified for SU2-FEniCS tutorial by Ishaan Desai %
% Date: 28.08.2020 %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% ------------- PRECICE PROBLEM DEFINITION ------------%

PRECICE_USAGE= YES
%
PRECICE_CONFIG_FILENAME= ./precice-config.xml
%
PRECICE_WETSURFACE_MARKER_NAME= wetSurface
%
PRECICE_NUMBER_OF_WETSURFACES= 1

% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------%

% Physical governing equations (EULER, NAVIER_STOKES, NS_PLASMA)
PHYSICAL_PROBLEM= EULER
%
% Mathematical problem (DIRECT, CONTINUOUS_ADJOINT)
MATH_PROBLEM= DIRECT
%
% Restart solution (NO, YES)
RESTART_SOL= YES

% -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------%

% Mach number (non-dimensional, based on the free-stream values)
MACH_NUMBER= 0.01
%
% Angle of attack (degrees, only for compressible flows)
AOA= 0.0
%
% Side-slip angle (degrees, only for compressible flows)
SIDESLIP_ANGLE= 0.0
%
% Free-stream pressure (101325.0 N/m^2 by default)
FREESTREAM_PRESSURE= 101300.0
%
% Free-stream temperature (288.15 K by default)
FREESTREAM_TEMPERATURE= 288.0

% ------------------------- UNSTEADY SIMULATION -------------------------------%

% Unsteady simulation (NO, TIME_STEPPING, DUAL_TIME_STEPPING-1ST_ORDER,
% DUAL_TIME_STEPPING-2ND_ORDER, TIME_SPECTRAL)
UNSTEADY_SIMULATION= DUAL_TIME_STEPPING-1ST_ORDER
%
% Time Step for dual time stepping simulations (s)
UNST_TIMESTEP= 0.01
%
% Total Physical Time for dual time stepping simulations (s)
UNST_TIME= 6.0
%
% Number of internal iterations (dual time method)
UNST_INT_ITER= 200
%
% Iteration number to begin unsteady restarts
UNST_RESTART_ITER= 1

% ----------------------- DYNAMIC MESH DEFINITION -----------------------------%

% Dynamic mesh simulation (NO, YES)
GRID_MOVEMENT= YES
%
% Type of dynamic mesh (NONE, RIGID_MOTION, DEFORMING, ROTATING_FRAME,
% MOVING_WALL, STEADY_TRANSLATION, FLUID_STRUCTURE,
% AEROELASTIC, ELASTICITY, EXTERNAL,
% AEROELASTIC_RIGID_MOTION, GUST, PRECICE_MOVEMENT)
GRID_MOVEMENT_KIND= PRECICE_MOVEMENT
%
% Moving wall boundary marker(s) (NONE = no marker, ignored for RIGID_MOTION)
MARKER_MOVING= ( wetSurface0 )

% -------------------- BOUNDARY CONDITION DEFINITION --------------------------%

% Euler wall boundary marker(s) (NONE = no marker)
MARKER_EULER= ( upper_wall, lower_wall, wetSurface0 )
%
% Inlet boundary marker(s) (NONE = no marker)
% Format: ( inlet marker, total temperature, total pressure, flow_direction_x,
% flow_direction_y, flow_direction_z ... ) where flow_direction is a unit vector.
MARKER_INLET= ( inlet, 288.6, 101400.0, 1.0, 0.0, 0.0 )
%
% Outlet boundary marker(s) (NONE = no marker)
% Format: ( outlet marker, back pressure (static), ... )
MARKER_OUTLET= ( outlet, 101300.0 )

% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------%

% Numerical method for spatial gradients (GREEN_GAUSS, WEIGHTED_LEAST_SQUARES)
NUM_METHOD_GRAD= GREEN_GAUSS
%
% Courant-Friedrichs-Lewy condition of the finest grid
CFL_NUMBER= 2.0
%
% Adaptive CFL number (NO, YES)
CFL_ADAPT= NO
%
% Parameters of the adaptive CFL number (factor down, factor up, CFL min value,
% CFL max value )
CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 )
%
% Runge-Kutta alpha coefficients
RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 )
%
% Number of total iterations
EXT_ITER= 999999

% ------------------------ LINEAR SOLVER DEFINITION ---------------------------%

% Linear solver for implicit formulations (BCGSTAB, FGMRES)
LINEAR_SOLVER= FGMRES
%
% Preconditioner of the Krylov linear solver (JACOBI, LINELET, LU_SGS)
LINEAR_SOLVER_PREC= LU_SGS
%
% Minimum error of the linear solver for implicit formulations
LINEAR_SOLVER_ERROR= 1E-4
%
% Max number of iterations of the linear solver for the implicit formulation
LINEAR_SOLVER_ITER= 20

% -------------------------- MULTIGRID PARAMETERS -----------------------------%

% Multi-Grid Levels (0 = no multi-grid)
MGLEVEL= 3
%
% Multi-grid cycle (V_CYCLE, W_CYCLE, FULLMG_CYCLE)
MGCYCLE= V_CYCLE
%
% Multi-grid pre-smoothing level
MG_PRE_SMOOTH= ( 1, 2, 3, 3 )
%
% Multi-grid post-smoothing level
MG_POST_SMOOTH= ( 0, 0, 0, 0 )
%
% Jacobi implicit smoothing of the correction
MG_CORRECTION_SMOOTH= ( 0, 0, 0, 0 )
%
% Damping factor for the residual restriction
MG_DAMP_RESTRICTION= 0.9
%
% Damping factor for the correction prolongation
MG_DAMP_PROLONGATION= 0.9

% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------%

% Convective numerical method (JST, LAX-FRIEDRICH, CUSP, ROE, AUSM, HLLC,
% TURKEL_PREC, MSW)
CONV_NUM_METHOD_FLOW= JST
%
% Monotonic Upwind Scheme for Conservation Laws (TVD) in the flow equations.
% Required for 2nd order upwind schemes (NO, YES)
MUSCL_FLOW= YES
%
% Slope limiter (NONE, VENKATAKRISHNAN, VENKATAKRISHNAN_WANG,
% BARTH_JESPERSEN, VAN_ALBADA_EDGE)
SLOPE_LIMITER_FLOW= VENKATAKRISHNAN
%
% Coefficient for the Venkats limiter (upwind scheme). A larger values decrease
% the extent of limiting, values approaching zero cause
% lower-order approximation to the solution (0.05 by default)
VENKAT_LIMITER_COEFF= 0.05
%
% 2nd and 4th order artificial dissipation coefficients for
% the JST method ( 0.5, 0.02 by default )
JST_SENSOR_COEFF= ( 0.5, 0.02 )
%
% Time discretization (RUNGE-KUTTA_EXPLICIT, EULER_IMPLICIT, EULER_EXPLICIT)
TIME_DISCRE_FLOW= EULER_IMPLICIT

% --------------------------- CONVERGENCE PARAMETERS --------------------------%

% Convergence criteria (CAUCHY, RESIDUAL)
%
CONV_CRITERIA= RESIDUAL
%
% Residual reduction (order of magnitude with respect to the initial value)
RESIDUAL_REDUCTION= 1
%
% Min value of the residual (log10 of the residual)
RESIDUAL_MINVAL= -3.5
%
% Start convergence criteria at iteration number
STARTCONV_ITER= 10

% ------------------------- INPUT/OUTPUT INFORMATION --------------------------%

% Write residuals
WRT_RESIDUALS= YES
%
% Mesh input file
MESH_FILENAME= Fluid/fluidMesh.su2
%
% Mesh input file format (SU2, CGNS, NETCDF_ASCII)
MESH_FORMAT= SU2
%
% Restart flow input file
SOLUTION_FLOW_FILENAME= Fluid/initial_flow.dat
%
% Output file format (PARAVIEW, TECPLOT, STL)
OUTPUT_FORMAT= PARAVIEW
%
% Output file with the forces breakdown
BREAKDOWN_FILENAME= Fluid/forces_breakdown.dat
%
% Output file restart flow
RESTART_FLOW_FILENAME= Fluid/restart_flow.dat
%
% Output file convergence history (w/o extension)
CONV_FILENAME= Fluid/history
%
% Write binary restart files (YES, NO)
WRT_BINARY_RESTART= NO
%
% Read binary restart files (YES, NO)
READ_BINARY_RESTART= NO
%
% Output file flow (w/o extension) variables
VOLUME_FLOW_FILENAME= Fluid/flow
%
% Output file surface flow coefficient (w/o extension)
SURFACE_FLOW_FILENAME= Fluid/surface_flow
%
% Write surface solution files
WRT_SRF_SOL= NO
%
% Writing solution file frequency
WRT_SOL_FREQ= 1
%
% Writing solution file frequency for physical time steps (dual time)
WRT_SOL_FREQ_DUALTIME= 1
%
% Writing convergence history frequency
WRT_CON_FREQ= 1
%
% Writing convergence history frequency
WRT_CON_FREQ_DUALTIME= 1

% ------------------------ GRID DEFORMATION PARAMETERS ------------------------%
%
% Linear solver or smoother for implicit formulations (FGMRES, RESTARTED_FGMRES, BCGSTAB)
DEFORM_LINEAR_SOLVER= FGMRES
%
% Preconditioner of the Krylov linear solver (ILU, LU_SGS, JACOBI)
DEFORM_LINEAR_SOLVER_PREC= LU_SGS
%
% Number of smoothing iterations for mesh deformation
DEFORM_LINEAR_ITER= 50
%
% Number of nonlinear deformation iterations (surface deformation increments)
DEFORM_NONLINEAR_ITER= 1
%
% Print the residuals during mesh deformation to the console (YES, NO)
%DEFORM_CONSOLE_OUTPUT= NO
%
% Factor to multiply smallest cell volume for deform tolerance (0.001 default)
DEFORM_TOL_FACTOR = 0.1
%
% Type of element stiffness imposed for FEA mesh deformation (INVERSE_VOLUME,
% WALL_DISTANCE, CONSTANT_STIFFNESS)
DEFORM_STIFFNESS_TYPE= INVERSE_VOLUME
%
% Visualize the deformation (NO, YES)
%VISUALIZE_DEFORMATION= YES
Loading