Skip to content

Commit

Permalink
Merge branch 'develop' into dev_polarbug
Browse files Browse the repository at this point in the history
  • Loading branch information
sduess authored Oct 11, 2023
2 parents dadee64 + ef679ad commit 0b8c572
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 19 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ RUN conda init bash && \
conda config --set always_yes yes --set changeps1 no && \
conda update -q conda && \
conda config --set auto_activate_base false && \
conda env create -f /sharpy_dir/utils/environment_minimal.yml && conda clean -afy && \
conda env create -f /sharpy_dir/utils/environment_new.yml && conda clean -afy && \
find /miniconda3/ -follow -type f -name '*.a' -delete && \
find /miniconda3/ -follow -type f -name '*.pyc' -delete && \
find /miniconda3/ -follow -type f -name '*.js.map' -delete
Expand All @@ -40,7 +40,7 @@ RUN conda init bash && \
RUN ln -s /sharpy_dir/utils/docker/* /root/

RUN cd sharpy_dir && \
conda activate sharpy_minimal && \
conda activate sharpy && \
git submodule update --init --recursive && \
mkdir build && \
cd build && \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2368,18 +2368,8 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Run SHARPy Simulation\n",
"Before running SHARPy, we remove the old linear system generated if existing. It would cause an error that still needs to be fixed (your first contribution?)."
]
},
{
"cell_type": "code",
"### Run SHARPy Simulation"
"execution_count": 22,
"metadata": {},
"outputs": [],
"source": [
"if os.path.isfile(os.path.join(output_folder, pazy_model_ROM.case_name, 'savedata', pazy_model_ROM.case_name + '.linss.h5')):\n",
" os.remove(os.path.join(output_folder, pazy_model_ROM.case_name, 'savedata', pazy_model_ROM.case_name + '.linss.h5'))"
]
},
{
Expand Down
13 changes: 9 additions & 4 deletions sharpy/aero/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,11 @@ def span_chord(i_node_surf, zeta):

def find_aerodynamic_solver_settings(settings):
"""
Retrieves the settings of the first aerodynamic solver used in the solution ``flow``.
Retrieves the settings of the first aerodynamic solver used in the solution ``flow``.
For coupled solvers, the aerodynamic solver is found in the aero solver settings.
The StaticTrim solver can either contain a coupled or aero solver in its solver
settings (making it into a possible 3-level Matryoshka).
Args:
settings (dict): SHARPy settings (usually found in ``data.settings`` )
Expand All @@ -142,10 +145,12 @@ def find_aerodynamic_solver_settings(settings):
tuple: Aerodynamic solver settings
"""
flow = settings['SHARPy']['flow']
for solver_name in ['StaticUvlm', 'StaticCoupled', 'DynamicCoupled', 'StepUvlm']:
for solver_name in ['StaticUvlm', 'StaticCoupled', 'StaticTrim', 'DynamicCoupled', 'StepUvlm']:
if solver_name in flow:
aero_solver_settings = settings[solver_name]
if 'aero_solver' in settings[solver_name].keys():
if solver_name == 'StaticTrim':
aero_solver_settings = aero_solver_settings['solver_settings']['aero_solver_settings']
elif 'aero_solver' in settings[solver_name].keys():
aero_solver_settings = aero_solver_settings['aero_solver_settings']

return aero_solver_settings
Expand Down
6 changes: 4 additions & 2 deletions sharpy/postproc/savedata.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,10 @@ def initialise(self, data, custom_settings=None, caller=None, restart=False):
self.filename = self.folder + self.data.settings['SHARPy']['case'] + '.data.h5'
self.filename_linear = self.folder + self.data.settings['SHARPy']['case'] + '.linss.h5'

if os.path.isfile(self.filename):
os.remove(self.filename)
# remove old file if it exists
for file_path in [self.filename, self.filename_linear]:
if os.path.isfile(file_path):
os.remove(file_path)

# check that there is a linear system - else return setting to false
if self.settings['save_linear'] or self.settings['save_linear_uvlm']:
Expand Down

0 comments on commit 0b8c572

Please sign in to comment.