Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
O
Oersted
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Pries, Jason
Oersted
Commits
5f478851
Commit
5f478851
authored
Dec 03, 2017
by
Pries, Jason
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Work on SynchronousReluctanceRotor ModelTemplate
parent
0ae85aed
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
94 additions
and
11 deletions
+94
-11
CMakeLists.txt
CMakeLists.txt
+1
-1
src/Model Templates/src/SynchronousReluctanceRotor.cpp
src/Model Templates/src/SynchronousReluctanceRotor.cpp
+86
-1
test/Model Templates/test_SynchronousReluctanceRotor.cpp
test/Model Templates/test_SynchronousReluctanceRotor.cpp
+7
-9
No files found.
CMakeLists.txt
View file @
5f478851
...
...
@@ -4,7 +4,7 @@ project(Oersted)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-std=gnu++17"
)
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O3 --coverage -fopenmp")
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-g -O
3
-fopenmp"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-g -O
0
-fopenmp"
)
include_directories
(
./lib/
)
include_directories
(
./lib/Eigen/
)
...
...
src/Model Templates/src/SynchronousReluctanceRotor.cpp
View file @
5f478851
...
...
@@ -61,10 +61,91 @@ void SynchronousReluctanceRotor::add_to_sketch(Sketch &s, std::shared_ptr<Vertex
auto
f3
=
s
.
new_element
<
Fixation
>
(
v3
);
auto
l0
=
s
.
new_element
<
LineSegment
>
(
v0
,
v1
);
L
.
push_back
(
l0
);
//auto l1 = s.new_element<LineSegment>(origin,v2); // for construction
//auto l2 = s.new_element<LineSegment>(origin,v3); // for construction
auto
c0
=
s
.
new_element
<
CircularArc
>
(
v2
,
v3
,
origin
,
ro
-
dra
[
j
]);
C
.
push_back
(
c0
);
{
double_t
x0
=
xr
[
j
];
double_t
y0
=
yr
[
j
];
double_t
x1
=
xa
[
j
];
double_t
y1
=
ya
[
j
];
double_t
dx
=
x1
-
x0
;
double_t
dy
=
y1
-
y0
;
double_t
t0
=
atan2
(
dy
,
dx
);
double_t
t1
=
t0
+
M_PI_2
;
double_t
x2
=
0.5
*
(
x0
+
x1
);
double_t
y2
=
0.5
*
(
y0
+
y1
);
double_t
a0
=
-
sin
(
M_PI
/
Np
);
double_t
b0
=
+
cos
(
M_PI
/
Np
);
double_t
a1
=
-
sin
(
t1
);
double_t
b1
=
+
cos
(
t1
);
double_t
c
=
a1
*
x2
+
b1
*
y2
;
double_t
d
=
a0
*
b1
-
a1
*
b0
;
double_t
x3
=
-
b0
*
c
/
d
;
double_t
y3
=
+
a0
*
c
/
d
;
double_t
r3
=
hypot
(
x3
-
x1
,
y3
-
y1
);
auto
vc1
=
s
.
new_element
<
Vertex
>
(
x3
,
y3
);
s
.
new_element
<
Coincident
<
LineSegment
>>
(
vc1
,
L
[
1
]);
auto
c1
=
s
.
new_element
<
CircularArc
>
(
v1
,
v3
,
vc1
,
r3
);
C
.
push_back
(
c1
);
}
{
double_t
x0
=
xr
[
j
+
1
];
double_t
y0
=
yr
[
j
+
1
];
double_t
x1
=
xa
[
j
+
1
];
double_t
y1
=
ya
[
j
+
1
];
double_t
dx
=
x1
-
x0
;
double_t
dy
=
y1
-
y0
;
double_t
t0
=
atan2
(
dy
,
dx
);
double_t
t1
=
t0
+
M_PI_2
;
double_t
x2
=
0.5
*
(
x0
+
x1
);
double_t
y2
=
0.5
*
(
y0
+
y1
);
double_t
a0
=
-
sin
(
M_PI
/
Np
);
double_t
b0
=
+
cos
(
M_PI
/
Np
);
double_t
a1
=
-
sin
(
t1
);
double_t
b1
=
+
cos
(
t1
);
double_t
c
=
a1
*
x2
+
b1
*
y2
;
double_t
d
=
a0
*
b1
-
a1
*
b0
;
double_t
x3
=
-
b0
*
c
/
d
;
double_t
y3
=
+
a0
*
c
/
d
;
double_t
r3
=
hypot
(
x3
-
x1
,
y3
-
y1
);
auto
vc1
=
s
.
new_element
<
Vertex
>
(
x3
,
y3
);
s
.
new_element
<
Coincident
<
LineSegment
>>
(
vc1
,
L
[
1
]);
auto
c1
=
s
.
new_element
<
CircularArc
>
(
v0
,
v2
,
vc1
,
r3
);
C
.
push_back
(
c1
);
}
//auto vc2 = s.new_element<Vertex>(1.1 * ro * cos(a180p), 1.1 * ro * sin(a180p));
//s.new_element<Coincident<LineSegment>>(vc2,L[1]);
//auto c2 = s.new_element<CircularArc>(v0,v2,vc2,RadialThickness[j]);
//C.push_back(c2);
}
// Impose constraints
...
...
@@ -72,6 +153,8 @@ void SynchronousReluctanceRotor::add_to_sketch(Sketch &s, std::shared_ptr<Vertex
s
.
new_element
<
Radius
>
(
C
[
0
],
ri
);
s
.
new_element
<
Radius
>
(
C
[
1
],
ro
);
s
.
new_element
<
Coincident
<
LineSegment
>>
(
origin
,
L
[
1
]);
s
.
new_element
<
Angle
>
(
L
[
0
],
L
[
1
],
180.0
/
Np
);
double_t
tol
=
s
.
solve
();
...
...
@@ -86,6 +169,8 @@ void SynchronousReluctanceRotor::add_to_sketch(Sketch &s, std::shared_ptr<Vertex
tol
=
s
.
solve
();
if
(
Convexify
)
{
throw
;
auto
V0p
=
s
.
select_periodic_vertex
(
V
[
0
],
origin
,
360.0
/
Poles
);
s
.
new_element
<
LineSegment
>
(
origin
,
V
[
0
]);
s
.
new_element
<
LineSegment
>
(
origin
,
V0p
);
}
}
\ No newline at end of file
test/Model Templates/test_SynchronousReluctanceRotor.cpp
View file @
5f478851
...
...
@@ -13,12 +13,12 @@ TEST_F(Synchronous_Reluctance_Rotor, basic_test) {
srr
.
InnerRadius
=
25.4e-3
;
srr
.
OuterRadius
=
89e-3
-
0.03
*
25.4e-3
;
srr
.
AngularBridgeThickness
=
{
0.5e-3
};
srr
.
RadialBridgeThickness
=
{
0.5e-3
};
srr
.
RadialThickness
=
{
5.0e-3
,
5.0e-3
};
srr
.
AngularThickness
=
{
5.0
,
5.0
};
srr
.
AngularBridgeThickness
=
{
0.5e-3
,
0.5e-3
,
0.5e-3
};
srr
.
RadialBridgeThickness
=
{
0.5e-3
,
0.5e-3
,
0.5e-3
};
srr
.
RadialThickness
=
{
5.0e-3
,
5.0e-3
,
5.0e-3
,
5.0e-3
,
5.0e-3
,
5.0e-3
};
srr
.
AngularThickness
=
{
3.2
,
3.2
,
3.2
,
3.2
,
3.2
,
3.2
};
//srr.Convexify = true; std::cout << "//
Mesh creation fails with non-convex domains" << std::endl;
srr
.
Convexify
=
true
;
std
::
cout
<<
"// TODO:
Mesh creation fails with non-convex domains"
<<
std
::
endl
;
Sketch
sketch
;
...
...
@@ -33,13 +33,11 @@ TEST_F(Synchronous_Reluctance_Rotor, basic_test) {
EXPECT_TRUE
(
sketch
.
build
());
/*
Mesh
mesh
{
sketch
};
mesh.create();
mesh
.
create
();
std
::
cout
<<
"TODO: Mesh creation fails with small gaps for rotor bridges"
;
mesh
.
MinimumElementQuality
=
0.5
;
EXPECT_TRUE
(
mesh
.
refine
());
mesh.save_as(SAVE_DIR,"Distributed_Winding_Stator");
*/
mesh
.
save_as
(
SAVE_DIR
,
"Synchronous_Reluctance_Rotor"
);
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment