Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
tutorials
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
documentation
tutorials
Commits
b6f84c96
Commit
b6f84c96
authored
7 years ago
by
François Henrotte
Browse files
Options
Downloads
Patches
Plain Diff
improvements
parent
5ee2362a
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
PotentialFlow/magnus.pro
+23
-15
23 additions, 15 deletions
PotentialFlow/magnus.pro
with
23 additions
and
15 deletions
PotentialFlow/magnus.pro
+
23
−
15
View file @
b6f84c96
/* -------------------------------------------------------------------
Tutorial 6 : Potential flow
, lift
and Magnus effect
Tutorial 6 : Potential flow and Magnus effect
Features:
- Potential flow, irrotational flow
, lift and Magnus effect
- Potential flow, irrotational flow
- Multivalued scalar field
- Non-linear iteration on an Associated global quantity
- Use a run-time variable in a Post-Operation
- Lift and Magnus effect, stagnation points
- Run-time variables
- Elementary algorithms in the Resolution section
- Non-linear iteration to achieve Kutta's condition
To compute the solution in a terminal:
getdp magnus.pro -solve PotentialFlow -pos PotentialFlow
...
...
@@ -89,8 +91,6 @@
f(V) = argVTrail[ {d phi } ] OnPoint {1.0001,0,0}
comes below a fixed tolerance.
*/
Include
"magnus_common.pro"
;
...
...
@@ -244,12 +244,22 @@ Resolution{
Generate
[
A
];
Solve
[
A
];
SaveSolution
[
A
];
Else
// Pseudo-Newton iteration to determine Dmdt in the Airfoil case.
// A resolution can contain elementary algorithms.
// Available commands are:
// Evaluate[] : affectation of a run-time variable
// Test[]{}{} : logical test
// While[]{} : iteration
// Print[{}, Format ..., File ...] : formatted display
// A pseudo-Newton iteration is implemented here
// to determine the value of Dmdt (in the Airfoil case)
// that verifies Kutta's condition.
// The run-time variable $newDmdt is used in Generate[A]
// whereas $circ, $dmdt, $argV and $phiTrailing are evaluated
// by the PostOperation[Trailing].
// A file containing "PhiTrailing = $phiTrailing;" is after all
// written on disk to be used for formatting the
// A file containing "PhiTrailing = $phiTrailing;" is
// after convergence written on disk to be used
// for formatting purposes in the PostOperation section.
DeleteFile
[
"KJiter.txt"
];
...
...
@@ -265,11 +275,9 @@ Resolution{
Format
"iter = %3g Circ = %5.2f Dmdt = %5.2f argV = %5.2e"
];
While
[
Norm
[
$
argV
]
>
1e-3
&&
$
syscount
<
50
]
{
Test
[
$
syscount
&&
Norm
[
$
argV
-
$
argVp
]
>
1e-3
]
{
Evaluate
[
$
jac
=
Min
[
(
$
dmdt
-
$
dmdtp
)
/
(
$
argV
-
$
argVp
),
0.2
]
]
;}
{
Evaluate
[
$
jac
=
0.2
];}
Print
[{
$
jac
},
Format
"Jac = %7.5e"
];
Evaluate
[
$
newDmdt
=
$
dmdt
-
$
jac
*
$
argV
];
Evaluate
[
$
syscount
=
$
syscount
+
1
];
...
...
@@ -371,10 +379,10 @@ PostOperation{
Print
[
normVelocity
,
OnElementsOf
Vol_rho
,
File
"p.pos"
];
Echo
[
Str
[
"l=PostProcessing.NbViews-1;"
,
"View[l].Name = 'stagnation points';"
,
"View[l].ScaleType = 2;"
],
"View[l].ScaleType = 2;
// log scale
"
],
File
"tmp.geo"
,
LastTimeStepOnly
]
;
// Show the isovalue phi=$PhiTrailing
// Show the isovalue
"
phi=$PhiTrailing
"
// which should be perpendicular to the airfoil
// if the Kutta condition is fulfilled
Print
[
phi
,
OnElementsOf
Vol_rho
,
File
"KJ.pos"
];
...
...
@@ -382,8 +390,8 @@ PostOperation{
"l=PostProcessing.NbViews-1;"
,
"View[l].Name = 'isovalue phiTrailing';"
,
"View[l].IntervalsType = 3;"
,
"Mesh.SurfaceEdges = 0;"
,
"View[l].RangeType = 2;"
,
"Mesh.SurfaceEdges = 0;
// hide mesh
"
,
"View[l].RangeType = 2;
// custom range
"
,
"View[l].CustomMin = PhiTrailing;"
,
"View[l].CustomMax = 1.001*PhiTrailing;"
,
"View[l].NbIso = 10;"
],
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment