Skip to content

Conversation

@Nicola-Fonzi
Copy link
Contributor

Proposed Changes

Dear all, in this PR there are few modification related to the new fsi interface in python, namely:

  • A different treatment for imposed motions. This is actually a first step towards an automatic identification of the aerodynamic transfer functions for state-space models.
  • Some changes in the outputs
  • The introduction of a test case for this feature

Regarding the last point, I am having issues trying to understand how to appropriately set up the regression. In particular, the fsi interface needs two additional packages to run (libspatialindex and petsc) with their counterparts in python (rtree and petsc4py). @pcarruscag suggested me to add the apt-get lines in the regression.yml file, but I am really not sure where to place them and I do not want to mess it up.
Further, the files in the tutorial folder cannot be used for this scope. Indeed, in the tutorial, there are the cfg files that can be used to reproduce the same behaviour predicted by the theory of Theodorsen. However, in order to do so, some iterations of fluid only simulation must be performed before the coupling. This takes time so I prepared a test case where the two solvers (fluid and structure) are coupled from the beginning. Unfortunately, the mesh is ignored by git in the TestCase folder, so I am not sure how to make it run.

I would really appreciate if you could help me with this last point.

Related Work

#1124

PR Checklist

Put an X by all that apply. You can fill this out after submitting the PR. If you have any questions, don't hesitate to ask! We want to help. These are a guide for you to know what the reviewers will be looking for in your contribution.

  • I am submitting my contribution to the develop branch.
  • My contribution generates no new compiler warnings (try with the '-Wall -Wextra -Wno-unused-parameter -Wno-empty-body' compiler flags, or simply --warnlevel=2 when using meson).
  • My contribution is commented and consistent with SU2 style.
  • I have added a test case that demonstrates my contribution, if necessary.
  • I have updated appropriate documentation (Tutorials, Docs Page, config_template.cpp) , if necessary.

@Nicola-Fonzi Nicola-Fonzi marked this pull request as draft December 29, 2020 16:04
Copy link
Member

@pcarruscag pcarruscag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the tests run in a docker https://hub.docker.com/r/su2code/test-su2/tags?page=1&ordering=last_updated
Which is created based on https://github.com/su2code/Docker-Builds/blob/master/build/Dockerfile

(This is the first time I've tried to figure this out) using apt-get install will probably not work.
Perhaps @talbring can shed some light, and in the process document this a little.

Comment on lines 217 to 218
testcase_su2_nastran = TestCase('py_su2_nastran')
testcase_su2_nastran.cfg_dir = "TestCases/py_su2_nastran"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is supposed to get the grids from the tutorials repo, not from testcases.

% Author: %
% Institution: %
% Date: %
% File Version 7.0.2 "Blackbird" %
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

version numbers

Comment on lines 104 to 112
% 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 )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove irrelevant options such as these

Comment on lines 134 to 136
MUSCL_FLOW= YES
% Slope limiter (VENKATAKRISHNAN, MINMOD)
SLOPE_LIMITER_FLOW= VENKATAKRISHNAN
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these

% Spatial numerical order integration (1ST_ORDER, 2ND_ORDER, 2ND_ORDER_LIMITER)
%
MUSCL_TURB= NO
SLOPE_LIMITER_TURB= VENKATAKRISHNAN
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and this.

Because it is a lot of work when we need to update things.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very sorry... I took the wrong template. Fixing it now

Comment on lines 193 to 254
print("\n------------------------------ Configuring the structural tester solver for FSI simulation ------------------------------")
print("\n---------- Configuring the structural tester solver for FSI simulation ----------")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better to use rfill / lfill with the total width defined somewhere central.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! Thank you for the suggestion

Comment on lines 62 to 64
if case():
sys.exit('Imposed function {} not found, please implement it in pysu2_nastran.py'.format(self.tipo))
break
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't do this, throw an exception.

if (TimeMarching == DT_STEPPING_2ND) cout << "Unsteady simulation, dual time stepping strategy (second order in time)."<< endl;
if (Unst_CFL != 0.0) cout << "Time step computed by the code. Unsteady CFL number: " << Unst_CFL <<"."<< endl;
else cout << "Unsteady time step provided by the user (s): "<< Delta_UnstTime << "." << endl;
cout << "Total number of internal Dual Time iterations: "<< InnerIter <<"." << endl;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this output not relevant?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is redundant as the number of inner iterations are displayed in any case. Plus, the number of inner iterations is actually nInnerIter, thus that output always display Total number of internal Dual Time iterations: 0
Is it maybe a legacy of old implementations?

@Nicola-Fonzi
Copy link
Contributor Author

The modification required should be implemented. @pcarruscag thank you very much for taking the time to give me the suggestions and for checking out the issue with docker.

@Nicola-Fonzi Nicola-Fonzi marked this pull request as ready for review January 25, 2021 15:20
@Nicola-Fonzi
Copy link
Contributor Author

Dear all,

I temporarily removed the test case because there were a couple of fix to do before. If you still think the test case for this feature may be important, I think a separate PR is more appropriate, as there will be the need to discuss about the best way to incorporate it.

In the meantime, I included a fix on the outputs that allow to print grid velocities in the output files using the new mesh deformation solver and a small fix on the restart from the python side.

Looking forward for your comments!

Copy link
Member

@pcarruscag pcarruscag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Nicola-Fonzi Nicola-Fonzi merged commit 5c53093 into su2code:develop Jan 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants