Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Rotare
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Rouma Alexandre
Rotare
Commits
61bb6acb
Commit
61bb6acb
authored
1 year ago
by
Tamburrini Robin
Browse files
Options
Downloads
Patches
Plain Diff
fix: the code was no longer adapted for a single rotor case
parent
845a8811
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/solvers/bemt.m
+50
-51
50 additions, 51 deletions
src/solvers/bemt.m
with
50 additions
and
51 deletions
src/solvers/bemt.m
+
50
−
51
View file @
61bb6acb
...
...
@@ -38,64 +38,63 @@ function bemt(OpRot, Mod)
% First rotor always calculated as if isolated
bemtsinglerot
(
OpRot
(
1
),
Mod
);
% Deriving parameters of the second rotor to neutralize the overall torque
if
length
(
OpRot
)
==
2
% The following torque cancellation method is only valid for N_ROTORS = 2
for
i
=
2
:
length
(
OpRot
)
% Solve iteratively
isConverged
=
0
;
loopCount
=
0
;
% Parameters to vary to make both rotor torques coincide
strategy
=
Mod
.
coax
.
strategy
;
if
~
strcmp
(
strategy
,
'rpm'
)
&&
~
strcmp
(
strategy
,
'coll'
)
error
(
'bemt: the strategy must be
''
rpm
''
or
''
coll
''
.'
);
end
% Lower and Upper bounds for bissection method
if
strcmp
(
strategy
,
'rpm'
)
OpRot_l
=
1
/
10
*
OpRot
(
1
)
.
Op
.
(
strategy
);
OpRot_u
=
10
*
OpRot
(
1
)
.
Op
.
(
strategy
);
else
OpRot_l
=
-
10
*
OpRot
(
1
)
.
Op
.
(
strategy
);
OpRot_u
=
10
*
OpRot
(
1
)
.
Op
.
(
strategy
);
end
while
(
~
isConverged
)
&&
loopCount
<=
Mod
.
Num
.
maxIter
OpRot
(
2
)
.
Op
.
(
strategy
)
=
(
OpRot_l
+
OpRot_u
)/
2
;
%Midpoint
OpRot
(
2
)
.
ElPerf
.
updateupstreamvel
(
OpRot
(
1
),
Mod
);
% Update upstream velocity
bemtsinglerot
(
OpRot
(
2
),
Mod
);
% Calculate BEMT as usual, with new upstream vel distribution
% Convergence criterion
if
abs
(
OpRot
(
1
)
.
torque
-
OpRot
(
2
)
.
torque
)
<
Mod
.
Num
.
convCrit
isConverged
=
1
;
% Deriving parameters of the second rotor to neutralize the overall torque
if
Mod
.
coax
.
verif
% The following torque cancellation method is only valid for N_ROTORS = 2
% Solve iteratively
isConverged
=
0
;
loopCount
=
0
;
% Parameters to vary to make both rotor torques coincide
strategy
=
Mod
.
coax
.
strategy
;
if
~
strcmp
(
strategy
,
'rpm'
)
&&
~
strcmp
(
strategy
,
'coll'
)
error
(
'bemt: the strategy must be
''
rpm
''
or
''
coll
''
.'
);
end
% Lower and Upper bounds for bissection method
if
strcmp
(
strategy
,
'rpm'
)
OpRot_l
=
1
/
10
*
OpRot
(
1
)
.
Op
.
(
strategy
);
OpRot_u
=
10
*
OpRot
(
1
)
.
Op
.
(
strategy
);
else
% Update the bounds based on the torque
if
OpRot
(
2
)
.
torque
<
OpRot
(
1
)
.
torque
OpRot_l
=
OpRot
(
2
)
.
Op
.
(
strategy
);
OpRot_l
=
-
10
*
OpRot
(
1
)
.
Op
.
(
strategy
);
OpRot_u
=
10
*
OpRot
(
1
)
.
Op
.
(
strategy
);
end
while
(
~
isConverged
)
&&
loopCount
<=
Mod
.
Num
.
maxIter
OpRot
(
2
)
.
Op
.
(
strategy
)
=
(
OpRot_l
+
OpRot_u
)/
2
;
%Midpoint
OpRot
(
2
)
.
ElPerf
.
updateupstreamvel
(
OpRot
(
1
),
Mod
);
% Update upstream velocity
bemtsinglerot
(
OpRot
(
2
),
Mod
);
% Calculate BEMT as usual, with new upstream vel distribution
% Convergence criterion
if
abs
(
OpRot
(
1
)
.
torque
-
OpRot
(
2
)
.
torque
)
<
Mod
.
Num
.
convCrit
isConverged
=
1
;
else
OpRot_u
=
OpRot
(
2
)
.
Op
.
(
strategy
);
% Update the bounds based on the torque
if
OpRot
(
2
)
.
torque
<
OpRot
(
1
)
.
torque
OpRot_l
=
OpRot
(
2
)
.
Op
.
(
strategy
);
else
OpRot_u
=
OpRot
(
2
)
.
Op
.
(
strategy
);
end
end
if
loopCount
==
Mod
.
Num
.
maxIter
warning
(
'Rotare:Solvers:bemt:NotConverged'
,
...
[
'Solution not converged for the coaxial case after reaching the '
...
'maximum number of iterations (%d iter).\n'
],
loopCount
);
end
loopCount
=
loopCount
+
1
;
end
if
loopCount
==
Mod
.
Num
.
maxIter
warning
(
'Rotare:Solvers:bemt:NotConverged'
,
...
[
'Solution not converged for the coaxial case after reaching the '
...
'maximum number of iterations (%d iter).\n'
],
loopCount
);
end
loopCount
=
loopCount
+
1
;
else
% If there are more than 2 blades, the function can not support to cancel the total torque
OpRot
(
i
)
.
ElPerf
.
updateupstreamvel
(
OpRot
(
i
-
1
),
Mod
);
% Update upstream velocity
bemtsinglerot
(
OpRot
(
i
),
Mod
);
% Calculate BEMT as usual, with new upstream vel distribution
end
else
% If there are more than 2 blades, the function can not support to cancel the total torque
warning
(
'bemt: the total number of rotors in coaxial configuration must be equal to 2.'
)
for
i
=
2
:
length
(
OpRot
)
OpRot
(
i
)
.
ElPerf
.
updateupstreamvel
(
OpRot
(
i
-
1
),
Mod
);
% Update upstream velocity
bemtsinglerot
(
OpRot
(
i
),
Mod
);
% Calculate BEMT as usual, with new upstream vel distribution
end
end
end
...
...
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