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
2ebea148
Verified
Commit
2ebea148
authored
1 year ago
by
Thomas Lambert
Browse files
Options
Downloads
Patches
Plain Diff
feat(Result): introduce result class
parent
e46a4279
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/classes/@Result/Result.m
+61
-0
61 additions, 0 deletions
src/classes/@Result/Result.m
src/rotare.m
+13
-1
13 additions, 1 deletion
src/rotare.m
with
74 additions
and
1 deletion
src/classes/@Result/Result.m
0 → 100644
+
61
−
0
View file @
2ebea148
classdef
Result
<
handle
% RESULT Result obtained from a simulation with Rotare.
% This class defines the Result object that can be used to store the solution an entire Rotare
% simulation.
%
% Notes:
% - Almost all properties are private to prevent accidental overwriting.
%
% -----
%
% Result properties:
% leishman - Results obtained with the leishman solver
% indfact - Results obtained with the indFact solver
% indvel - Results obtained with the indVel solver
% stahlhut - Results obtained with the stalhlut solver
% operPts - Table with the operating points for each individual result
%
%
% Result methods:
%
% Result constructor:
% Result = Result() creates an empty object.
%
% Constructor inputs:
%
% See also: Rotor, rotare, template, af_tools.Airfoil.
%
% <a href="https:/gitlab.uliege.be/rotare/documentation">Complete documentation (online)</a>
% ----------------------------------------------------------------------------------------------
% FIXME: Make plot methods to compare two results easily
% ----------------------------------------------------------------------------------------------
% (c) Copyright 2022-2023 University of Liege
% Author: Thomas Lambert <t.lambert@uliege.be>
% ULiege - Aeroelasticity and Experimental Aerodynamics
% MIT License
% Repo: https://gitlab.uliege.be/rotare/rotare
% Docs: https://gitlab.uliege.be/rotare/documentation
% Issues: https://gitlab.uliege.be/rotare/rotare/-/issues
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Base properties of the elements
properties
leishman
(
1
,
:)
OperRotor
% Results obtained with the leishman solver
indfact
(
1
,
:)
OperRotor
% Results obtained with the indFact solver
indvel
(
1
,
:)
OperRotor
% Results obtained with the indVel solver
stahlhut
(
1
,
:)
OperRotor
% Results obtained with the stalhlut solver
operPts
(:,
4
)
table
% Table of operating points for each individual result
end
methods
function
self
=
Result
()
% Result Constructor.
% Creates the Result object.
%
% Currently empty on purpose. Results are to be assigned manually.
end
end
end
This diff is collapsed.
Click to expand it.
src/rotare.m
+
13
−
1
View file @
2ebea148
function
[
OpRot
]
=
rotare
(
configFile
)
function
[
Results
]
=
rotare
(
configFile
)
% ROTARE A feature-rich and open source implementation of the BEMT.
% ROTARE A feature-rich and open source implementation of the BEMT.
% This code is an implementation of the Blade Element Momentum Theory (BEMT) used for the
% This code is an implementation of the Blade Element Momentum Theory (BEMT) used for the
% analysis of all all kinds of rotors.
% analysis of all all kinds of rotors.
...
@@ -58,6 +58,9 @@ function [OpRot] = rotare(configFile)
...
@@ -58,6 +58,9 @@ function [OpRot] = rotare(configFile)
% Import packages
% Import packages
import
af_tools
.*
import
af_tools
.*
% Init the output object
Results
=
Result
();
% ==============================================================================================
% ==============================================================================================
% ==================================== Pre-processing ==========================================
% ==================================== Pre-processing ==========================================
% ==============================================================================================
% ==============================================================================================
...
@@ -132,6 +135,10 @@ function [OpRot] = rotare(configFile)
...
@@ -132,6 +135,10 @@ function [OpRot] = rotare(configFile)
% Keep track of CPU time for the solution
% Keep track of CPU time for the solution
OpRot
(
iOperPoint
,
i
)
.
cpuTime
=
toc
(
tStart
);
OpRot
(
iOperPoint
,
i
)
.
cpuTime
=
toc
(
tStart
);
% Table that identifies the operating point for future reuse
operPoints
(
iOperPoint
,
:)
=
[
Uop
.
altitude
(
iAlt
),
Uop
.
speed
(
iSpeed
),
...
Uop
.
rpm
(
i
,
iRpm
),
Uop
.
collective
(
i
,
iColl
)];
iOperPoint
=
iOperPoint
+
1
;
iOperPoint
=
iOperPoint
+
1
;
end
end
...
@@ -143,6 +150,11 @@ function [OpRot] = rotare(configFile)
...
@@ -143,6 +150,11 @@ function [OpRot] = rotare(configFile)
disp
(
' '
);
disp
(
' '
);
end
end
% Output result in an easily accessible form
Results
.
(
Mod
.
solver
)
=
OpRot
;
Results
.
operPts
=
array2table
(
operPoints
,
...
'VariableNames'
,
{
'Alt'
,
'V_ax'
,
'RPM'
,
'Coll'
});
% Save solution to MAT-file for future reusability
% Save solution to MAT-file for future reusability
if
Sim
.
Save
.
autosave
if
Sim
.
Save
.
autosave
TmpStruct
.
OpRot
=
OpRot
;
TmpStruct
.
OpRot
=
OpRot
;
...
...
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