Rotary Engine
Rotary Engine
Brahmadevan V Padmarajan
School of Engineering
MSc
Cranfield University
School of Engineering
MSc Thesis
2004
Brahmadevan V Padmarajan
ABSTRACT
Smooth, powerful, compact and light are the salient features of rotary engine. For many
peoples surprise rotary engines are still used in many field ranging from military to
electronics not to forget mazda RX-8.
In order to design efficient rotary engines, it is necessary to have a good understanding
of how engine design and operating parameters affect the unsteady multidimensional
fluid flow, fuel-air mixing and combustion occurring inside rotary engine.
Mathematical models have been developed in the last couple of decades to enhance
understanding of the flow field, fuel-air mixing and combustion in rotary engine. Earlier
improvements in performance and emission have been achieved primarily through
experimental trial and error procedures making the analysis time consuming and costly.
FLUENT 6.1 was used to develop a flexible rotary engine model. Dynamic mesh
capabilities are explored in handling the eccentric rotation of the rotor and deforming
housing of the rotary engine.
Simulation is carried out with the model having no inlet and exhaust ports and rotor
pocket for demonstration and finally recommendation and suggestions are made for
future work.
ACKNOWLEDGMENT
At the end of my thesis I would like to thank all those people who made this thesis
possible and an enjoyable experience for me.
I am deeply indebted to my supervisor, Dr. Philip Rubini, for patient guidance,
encouragement and excellent advice. Without his help, this work would not be possible.
I am grateful to Dr. Jin Yan for his generous assistance during this time.
Finally, thanks to my parents and numerous friends for always offering support and
love.
I dedicate this thesis to my father and mother.
ii
TABLE OF CONTENTS
ABSTRACT ...................................................................................................................... i
ACKNOWLEDGMENT .................................................................................................. ii
TABLE OF FIGURES ..................................................................................................... v
TABLE OF EQUATIONS ............................................................................................. vii
TABLE OF SYMBOLS AND NOTATIONS............................................................... viii
1
Introduction .............................................................................................................. 1
2
Review of Rotary engine .......................................................................................... 3
2.1
History of Rotary engine .................................................................................. 3
2.2
Principle of Operation ...................................................................................... 3
2.3
Salient features of rotary engine....................................................................... 4
2.4
Basic Equation of the rotary engine ................................................................. 5
2.5
Basic construction of the rotary engine ............................................................ 7
2.5.1
Rotor ......................................................................................................... 7
2.5.2
Housing..................................................................................................... 7
2.5.3
Phasing gear mechanism .......................................................................... 8
2.5.4
Output shaft .............................................................................................. 8
2.5.5
Gas sealing mechanism ............................................................................ 8
2.5.6
Intake and exhaust port system................................................................. 9
2.6
RENESIS .......................................................................................................... 9
2.7
Other applications of rotary engine ................................................................ 10
2.8
Scope for improvement .................................................................................. 12
2.9
Conclusion ...................................................................................................... 12
3
Review of the analysis of rotary engine using computational fluid dynamics....... 13
3.1
Computational Fluid Dynamics...................................................................... 13
3.2
Review of the analysis of RE using CFD ....................................................... 13
3.3
Conclusion ...................................................................................................... 17
4
Dynamic mesh ........................................................................................................ 19
4.1
Introduction to dynamic mesh ........................................................................ 19
4.2
Dynamic mesh update methods...................................................................... 19
4.2.1
Spring based smoothing ......................................................................... 19
4.2.2
Dynamic layering ................................................................................... 21
4.2.3
Local remeshing method ........................................................................ 23
4.3
Volume mesh update procedure ..................................................................... 25
4.4
Solid-Body Kinematics .................................................................................. 25
4.5
Setting mesh update parameters ..................................................................... 26
4.6
User defined function (UDF).......................................................................... 30
4.6.1
UDF for dynamic mesh .......................................................................... 30
4.7
Conclusion ...................................................................................................... 32
5
Modelling of rotary engine using dynamic mesh ................................................... 33
5.1
Dynamic mesh model with stationary rotor and deforming housing ............. 33
5.2
Dynamic mesh model with rotating rotor and stationary housing ................. 37
5.3
Eccentric rotation............................................................................................ 38
5.3.1
Rotation of a box .................................................................................... 38
5.3.2
Eccentric rotation of the box .................................................................. 40
5.3.3
Rotary engine with large housing........................................................... 43
5.4
Deforming housing......................................................................................... 46
iii
5.4.1
Butterfly Valve ....................................................................................... 46
5.4.2
Triangular valve...................................................................................... 50
5.4.3
Rotary engine with small clearance between rotor and housing ............ 54
5.4.4
Rotary engine with rotor and housing in perfect contact........................ 57
5.5
Conclusion ...................................................................................................... 61
6
Simulation of rotary engine .................................................................................... 62
6.1
Ideal gas compressible flow simulation.......................................................... 62
6.1.1
Rotary engine with small clearance........................................................ 63
6.2
Rotary engine with perfect contact................................................................. 66
6.3
Conclusion ...................................................................................................... 67
7
Conclusion .............................................................................................................. 68
8
Recommendation and Suggestion .......................................................................... 69
8.1
Recommendation for future work................................................................... 69
8.2
Suggestions for FLUENT............................................................................... 69
References ...................................................................................................................... 70
APPENDIX .................................................................................................................... 73
APPENDIX A - M-file used in the MATLAB for rotor and housing........................ 73
APPENDIX B - Triangular valve............................................................................... 78
APPENDIX C UDF for rotary engine..................................................................... 80
iv
TABLE OF FIGURES
Figure 2-1: Rotary Engine [1] .......................................................................................... 4
Figure 2-2: Peritrochoid curve of housing........................................................................ 5
Figure 2-3: Contour of the rotor ....................................................................................... 6
Figure 2-4: Parts of the rotor [1]....................................................................................... 7
Figure 2-5: Side housing [1]............................................................................................. 7
Figure 2-6: Out put shaft [1]............................................................................................. 8
Figure 2-7: Gas seal [1] .................................................................................................... 9
Figure 2-8: Intake port system [1] .................................................................................... 9
Figure 2-9: RENESIS (courtesy MAZDA) .................................................................... 10
Figure 2-10: Skycar (Courtesy Skycar) .......................................................................... 11
Figure 2-11: Micro-rotary engine used in Micro Electro Mechanical System (MEMS) 11
Figure 2-12: UAV (Courtesy UEL)................................................................................ 11
Figure 4-1: Spring based smoothing on interior nodes: Start [26] ................................. 20
Figure 4-2: Spring based smoothing on interior nodes: End [26] .................................. 20
Figure 4-3: Dynamic layering [26]................................................................................. 21
Figure 4-4: Results of splitting layer by constant height [26] ........................................ 22
Figure 4-5: Result of splitting layer by constant ratio [26] ............................................ 22
Figure 4-6: Remeshing at a deforming boundary [26] ................................................... 24
Figure 4-7: Dynamic mesh panel for smoothing ............................................................ 26
Figure 4-8: Effect of a spring constant factor of 1 on interior node motion [26]........... 27
Figure 4-9: Effect of a spring constant factor of 0 on interior node motion [26]........... 27
Figure 4-10: Dynamic mesh panel for layering.............................................................. 28
Figure 4-11: Dynamic mesh panel for local remeshing ................................................. 29
Figure 5-1: Complete RE (a) and a part of RE (b) that was considered......................... 33
Figure 5-2: Positions of the rotating rotor in a stationary housing [1]. .......................... 34
Figure 5-3: Positions of the housing with stationary rotor. ............................................ 37
Figure 5-4: Initial position of a square box. ................................................................... 38
Figure 5-5: Square box after 1 sec rotation. ................................................................... 39
Figure 5-6: Eccentric rotation of small box.................................................................... 41
Figure 5-7: Eccentric rotation of small box after 0.5 sec. .............................................. 41
Figure 5-8: Eccentric rotation of a small box after 1.0 sec............................................. 42
Figure 5-9: Eccentric rotation of a small box after 1.5 sec............................................. 42
Figure 5-10: Eccentric rotation of a small box after 2.0 sec........................................... 42
Figure 5-11: RE with large housing. .............................................................................. 43
Figure 5-12: RE with large housing after 0.5 sec. .......................................................... 44
Figure 5-13: RE with large housing after 1.0 sec. .......................................................... 44
Figure 5-14: RE with large housing after 1.5 sec. .......................................................... 44
Figure 5-15: RE with large housing after 2.0 sec. .......................................................... 45
Figure 5-16: RE with large housing after 2.5 sec. .......................................................... 45
Figure 5-17: RE with large housing after 3.0 sec. .......................................................... 45
Figure 5-18: Butterfly valve ........................................................................................... 48
Figure 5-19: Butterfly valve after 1.5 sec....................................................................... 49
Figure 5-20: Butterfly valve after 2.5 sec....................................................................... 49
Figure 5-21: Triangular valve......................................................................................... 50
Figure 5-22: Triangular valve after 2.5 sec with old macro. .......................................... 50
vi
TABLE OF EQUATIONS
x = E cos(3 A) + ( R + C ) cos( A)
y = E sin(3 A) + ( R + C ) sin( A)
.Equation 2-1..................... 5
x = r sin( t )
y = r cos( t )
x = D cos
y = D sin
x / D = cos
= cos 1 ( x / D)
y = D sin(cos 1 ( x / D))
vii
omega
position
x, y, z
CG
CFD
time
E
d
R
hideal
c
s
vel
hmin
name
dt
r
D
rad/sec
RE
sec
3D
t
dtime
TDC
2D
UAV
UDF
viii
1 Introduction
Dr. Felix Wankel developed the first rotary engine in 1954 in NSU, Germany. Later it
has been licensed to many car makers like Ford, General Motors, Citroen, Mazda, etc.
Since last decade Mazda is the only car maker using rotary engine. Recently Mazdas
rotary engine, RENESIS was awarded International engine of the year 2003.
Rotary engine operation is similar to the typical reciprocating engine where four strokes
are completed by the rotation of the rotor inside a housing which is of complex
geometry called peritrochoid. Small size, low weight, high specific power density and
multi fuel capabilities are some of the advantages of rotary engine over reciprocating
engine. Further details of the rotary engine are discussed in chapter 2.
In order to design efficient rotary engine first it is necessary to understand how various
engine parameters affect the fuel-air mixing, fluid flow and combustion inside the
combustion chamber. Various mathematical models have been developed over the years
to enhance the understanding.
Automotive industry is using CFD as one of its research and design tools. Whether it is
the study of the external flow dynamics over the body of a vehicle or for the internal
flow through the engine/hood, CFD is helping automotive engineers to better
understand the physical flow processes and in turn to design improved vehicles.
FLUENT the most widely available commercial CFD software is used for the modelling
and simulation.
An extensive literature review has been carried out in chapter 3 to understand the
previous work done on rotary engine using CFD. Lack of experimental data which has
been acknowledged by all researchers hampers the proper validation of the model.
Some measured data which are available like flow pattern will be used for the
validation, once complete basic model is simulated.
It was found out that the last analysis of rotary engine using CFD was carried out in way
back in 1994. The shear development in CFD during this decade gives a lot of scope for
doing this project.
Dynamic capabilities of FLUENT and user defined function (UDF) are explained in
chapter 4. Various dynamic mesh update methods and their applicability were
discussed. User defined function is written in C programming language that can be
dynamically loaded with the FLUENT solver to enhance the standard features of the
code. UDF are defined using DEFINE macros that are supplied by FLUENT company.
Project Objective was
To setup a flexible model using dynamic mesh capabilities for rotary engine
First it was planned to set up a model having stationary rotor and rotating housing as it
was very simple to do. As this model was not flexible enough this model was not
pursued further.
Dynamic mesh option available in the FLUENT 6.1 was explored and UDF was used in
setting up the rotary engine model with stationary housing and rotating rotor.
The project was divided into many steps:
Eccentric rotation of the rotor: A rotary engine model is set up with oversized housing
having eccentric rotation of the rotor.
Deforming housing: Then the problem arising due to the contact between rotor and
housing is handled almost successfully.
Both the models with stationary rotor and rotating rotor are discussed in chapter 5.
Simulation is carried out with a model having no inlet and exhaust ports and rotor
pockets. The idea was to demonstrate simulation of rotary engine which is done in
chapter 6.
Based on the conclusion made in chapter 7, finally suggestion and recommendations are
made in chapter 8 for future work in setting up a practical rotary engine model.
The equation of peritrochoid for the RE in practical application can be expressed by the
coordinates of point P(x, y) as
x = E cos(3 A) + ( R + C ) cos( A)
y = E sin(3 A) + ( R + C ) sin( A)
Equation 2-1
The inner envelope of the peritrochoid is a basic curve forming the contour of the rotor.
The equation given in [1] is as follows
2.5.1 Rotor
The function of the rotor is similar to the
piston
and
reciprocating
connecting
engine.
rod
Rotor
of
directly
2.5.2 Housing
The housing of the RE is similar to the cylinder block and cylinder of the reciprocating
engine. As it is seen in figure 2-1, cooling air or
water is provided through the passages around
the outside of the inner surface of the rotor
housing. For higher rigidity and better cooling
effect, ribs or fins are also provided. Also in the
rotor housing spark plug holes, and exhaust port
(in the case of peripheral exhaust port) etc are
provided at their respective optimum positions.
The side housing is provided with an intake port (and exhaust port in RENESIS) as
shown in figure 2-5. The interior is made hallow for the passage of cooling water. For
rigidity and better cooling effect ribs are provided.
In the side intake system the direction of intake is normal to the rotor revolution thus
easily generates swirl and shorter overlap time between the intake and exhaust ports
results in stable combustion even during low-speed or light loading conditions. But at
high speed or heavy loading condition performance is lower than that of the peripheral
intake system.
Side exhaust port system will cause a great amount of leak of high temperature exhaust
gas into the rotor side space causing deterioration of the side and oil seals.
2.6 RENESIS
combustion
economy.
RENESIS
and
also
better
fuel
has
two
thermal efficiency, power output and fuel economy. RENESIS has two exhaust port per
rotor chamber thus able to afford delay in the opening of the exhaust port which in turn
leads to a longer expansion cycle giving improved thermal efficiency, power output and
fuel economy. Additionally, the intake port close timing has been ex tended, resulting in
increased charging volume and more power. RENESIS gains 30% in intake port area
over the previous engine, and this, combined with the delayed intake port close timing,
makes for a sizable increase in charging volume resulting in greater power output.
RENESIS employs a new cut-off seal located between the rotor's dual oil seals and side
seal. This sealing arrangement eliminates blow-by between intake and exhaust ports and
prevents carry-over of exhaust gas to the next intake cycle. Exhaust gas build-up against
the side seal can easily cause carbonization, but with the wedge-shaped or cuneiform
side seal, the seal shape is optimized to remove carbon.
10
Skycar
Micro-rotary engine
11
2.9 Conclusion
The principle operation and basic construction of RE has been discussed. Other than
automotive, RE are used in UAV, Skycar, etc. RENESIS really brought a dramatic
changes in the performance of RE. A literature review of the previous work done on RE
using CFD is done in the next chapter.
12
13
injection, spray and nozzle optimizations, rotor pocket and nozzle relocation, fluid flow,
fluid-air mixing and combustion can be analysed.
The first two dimensional model of the motored RE in the absence of combustion was
modelled by Shih et al. 1986 [5]. Their model is based on the computer code UF-LRC2D (University of Florida Lewis Research Center 2-Dimensional).
Grasso et al. [6] developed the first three dimensional model of the stratified charge RE
during early stages of flame propagation using REC-3D-FSC-86 computer code at John
Deere & Co., REC-3D-FSC-86, is a modified version of the KIVA code developed at
Los Alamos National Laboratory for the modelling of reciprocating engines [7].
Unfortunately detailed measurements are almost non-existent for REs [8]. In 1988 [9],
Abraham et al. compared the measured and computed chamber pressures thus for the
first time validating the three-dimensional computations for RE. They concluded that
the main feature of the combustion flow field in the engine is slow and non uniform
mixing of fuel and air that leads to long and incomplete combustion. And the cause for
non uniformity is attributed to the large fluid acceleration caused by the motion of the
rotor.
Using the computer code UF-LRC-3D which was an extension of UF-LRC-2D,
Steinthorsson et al [10] developed a model to study unsteady three-dimensional flow
field inside RE. They showed the velocity field inside a motored RE, the mixing of non
homogeneous fuel-air mixtures that enter trough the intake port, and the mixing that
takes place when the gaseous fuel is injected into the combustion chamber during
compression. But UF-LRC-3D code was unconditionally unstable for 3-dimensional
modelling.
Later Abraham and Bracco [11] carried out the comparisons of measured and computed
mean velocities and of measured fluctuating intensities and computed turbulence
intensities in a motored RE. The measurements were obtained by Laser Doppler
Velocimetry (LDV) at the Sandia National Laboratories [12, 13]. Results nearly agreed
14
with the experimental results and also they concluded that the turbulence intensity tends
to be rather homogeneous and of similar magnitude before and after TDC but
significantly inhomogeneous and of greater magnitude around TDC. This study also
supported their previous papers [7, 9].
A three-dimensional model for flow and combustion was applied to a direct-injection
stratified charge RE by Abraham and Bracco in 1989 [14] to identify the parameters that
control its burning rate. To enhance vaporization and the production of flammable
mixture, it is concluded that the orientation of the six sprays of the main injector with
respect to the air stream is important and no spray should be in the wake of any other
spray. It was predicted that if such a condition is respected, the indicated efficiency
would increase by some 6% at higher loads and 2% at lower loads. They further carried
out the work [19] on improvement in combustion with a pilot injector and predicted to
increase the indicated efficiency by about 5% over the range of operating conditions
studied.
Raju and Willis developed a new computer code for predicting the turbulent, and
chemically reacting flows with sprays occurring inside of a stratified-charge RE in 1990
[15]. One apparent finding of their study is that vaporization appears to be more rate-
controlling than mixing during the combustion process, in the case with advanced fuel
injection and spark ignition. Their results were in agreement with the experimental
flow-visualization pattern of Hamady et al. [16].
Comparison of computed and measured pressure in a premixed charge natural-gasfuelled RE, by Abraham and Bracco [23]. Computed and measured pressure agreed
within 12%. In addition they showed that the laminar conversion time becomes
dominant as flames approach walls, thus slowing down their propagation rate.
On their earlier developed computer model [6], Abraham and Bracco extended the
computations for premixed charge natural gas combustion of RE [17]. They concluded
that a leading pocket with a leading deep recess, a compression ratio of 9.5 and two
spark plugs, one before the minor axis and the other after, provide the best indicated
15
efficiency of the configurations. Also they mentioned that it is very likely that even
greater efficiency gains will be obtained if more drastic geometric changes are
investigated.
Abraham and Bracco [20], worked on ignition strategies in a stratified charge RE. They
predicted that a second ignition source located upstream of the main injector if ignites
the mixture consistently will lead to an increase in indicated efficiency of 6-8%. Also
they predicted that the gain in efficiency of the engine with two ignition sources would
be 7-10%, instead of 6-8% if a two-hole pilot injector is also used instead of the onehole pilot.
Again on the modified geometries of the rotor pocket, Abraham and Bracco along with
Epstein [21] studied two modifications to the pocket geometry of a stratified-charge RE.
In one of the modification, a pocket which is located towards the leading edge of the
rotor has been shown to produce recirculation within the pocket and in turn results in
faster burning of the fuel. In the second modification standard single pocket
configuration is replaced by two pockets with two injectors and two spark plugs. They
stated that such a configuration appears to result in better utilization of air in the
chamber and hence higher efficiency.
Finally in 1994 Abraham and Magi [18] carried out computations of the flows in the
cavity are presented for different configurations of the pilot injector and spark plug and
for different timings and fuel injection rates from pilot and main injectors. The results
showed that in order to maintain fast burning in the main chamber, the variables has to
be optimized so that the flame in the cavity ignites the charge in the main chamber prior
to TDC. Also, the relative timings of the main injector and pilot injector should be
optimized such that there is sufficient amount of flammable charge present in the
vicinity of the cavity opening by TDC.
Airflow visualization is carried by Hamady et al [16] in a motored stratified charge RE
for naturally aspirated and supercharged conditions. Major flow feature identified
include leakage past the apex seal, separation at the rotor pocket and a large
16
recirculation during intake. Also Hamady et al [22] carried out measurement in the
major plane near the central housing wall to quantify the blow-by (leakage at apex
seals) that has proven to be a dominating feature in the intake flow pattern. They
concluded that the intake stroke flow pattern was found to be dominated by a large scale
vertical structure circulating in the opposite direction from the rotor motion. The
compression stroke flow pattern was characterized by a rotor driven flow, although flow
reversal were present. These analyses are carried out to compare with a computer
model. They suggested simulation modelling of three combustion chambers, rather than
the single combustion chamber currently being used to include the effect of leakage at
apex seals. They observed leakage at apex seals even in modern RE.
Heywood et al [24] developed two types of computer models to analyze the
performance of both premixed-charge and direct-injection stratified-charge RE. In the
first model the combustion heat release rate as a function of crank angle is predicted
from measured engine chamber pressure data throughout the combustion process. The
second model predicts the development of the chamber pressure and hence engine
performance from an assumed mass burning rate or heat release profile.
Fuel-air mixing and combustion in a 2-D RE is carried out by Ramos et al [25]. The
effects of mixture stratification at the intake port and gaseous fuel injection on the flow
field and fuel-air mixing in a 2-D RE model have been investigated. They have shown
that the fuel distribution in the combustion chamber is a function of the air-fuel mixture
fluctuations at the intake port. The fuel is adverted by the flow field induced by the rotor
and is concentrated near the leading apex during the intake stroke. During compression,
the fuel concentration is highest near the trailing apex and lowest near the rotor. The
penetration of gaseous fuel injected into the combustion chamber during the
compression stroke increases with the injection velocity and results in recirculation
zones between the injector and trailing apex. And finally the fuel concentration near the
trailing apex and rotor is small except at high injection velocities.
3.3 Conclusion
17
The last computations of RE was carried out a decade from now (that is in 1994).
During this time a lot of development has happened in the CFD software field. This
itself provides an ample scope for the computation of RE.
As suggested by Hamday et al [22] analysis of RE must be carried with all the three
combustion chambers, rather than the single combustion chamber currently being used
to include the effect of leakage at apex seals.
KIVA code developed at Los Alamos National Laboratory or other codes used earlier
for the analysis of RE was not used because of the lack of supervision in using these
codes. Fluent 6.1, the most widely used CFD software was used for the modelling and
simulation of RE.
18
4 Dynamic mesh
FLUENT is generic CFD software. Dynamic mesh capability is the latest addition to
this software to make it more versatile. Applicability of the different dynamic mesh
updates methods is discussed. To enhance the standard features of the code user defined
functions are used.
19
Spring based smoothing can be used for any cell or face zone whose boundary is
moving or deforming.
For non-tetrahedral (non-triangular for 2D) when the following conditions are met,
spring based smoothing method is recommended:
1. The boundary of the cell zone predominantly in one direction. In other words
no anisotropic stretching or compression of the cell zone.
2. Predominantly the motion is normal to the boundary zone.
20
In any case the above mentioned conditions are not met, the resulting cell may have
high skewness value, since not all possible combinations of node pairs in nontetrahedral (non-triangular for 2D) are idealized as springs.
. Equation 4-1
21
Constant Ratio: In this method the cells are split such that locally, the ratio of
the new cell heights is exactly s everywhere.
In the case of compression, the cells in the layer j are being compressed until
hmin < c hideal
Equation 4-2
22
Dynamic layering method can be used to merge or split cells adjacent to any moving
boundary provided the following conditions are met:
1. Even though the cell zone contain mixed cell shapes, all cells adjacent to the
moving face zone are either wedges or hexahedral (quadrilateral in 2D).
2. Except when sliding interfaces are used, the cell layer must be completely
bounded by one-sided face zones.
3. In the case of boundary face zone with two sided walls, the wall and wall
shadow pair must be split and use the coupled sliding pair interface option to
couple the adjacent cell zones.
4. In the case of model having periodic face zones in the cell zone where
dynamic layering is used only the serial version of the solver can be used.
However parallel solver for dynamic layering can be used, if the periodic
zones as periodic non-conformal interfaces.
23
Local remeshing method can be used only in zones that contain tetrahedral or triangular
cells.
While using local remeshing the faces on the deforming face zone can be remeshed only
if the following conditions are met:
24
25
Enable smoothing option under mesh methods in the dynamic mesh panel to turn on the
spring based smoothing. The relevant parameters are as shown in figure 4-7.
Spring stiffness is controlled by adjusting the Spring Constant Factor between 0 and 1.
There is no damping on the spring if the value is 0 and the boundary node displacement
has more influence on the motion of the interior nodes. A default level of damping is
imposed on the interior node displacements if the value is 1.
The effect of spring constant is illustrated in figure 4-8 and 4-9. Degenerate cells are
created with spring constant factor of 1 as shown in figure 4-8. If the spring constant
factor is set to 0 the original mesh position is recovered as shown in figure 4-9.
26
Figure 4-8: Effect of a spring constant factor of 1 on interior node motion [26]
Figure 4-9: Effect of a spring constant factor of 0 on interior node motion [26]
If the model contains deforming boundary zones, Boundary Node Relaxation can be
used to control how the node positions on the deforming boundaries are updated. A
value of 0 prevents deforming boundary nodes from moving which is equal to turning
off smoothing on deforming boundary zones and a value of 1 indicates under-relaxation.
The solution can be controlled by using the values of Convergence Tolerance and
Number of Iteration.
Dynamic layering
Enable the layering option under mesh methods in the dynamic mesh panel to turn on
the dynamic layering.
27
Local remeshing
Enable the remeshing option under mesh methods in the dynamic mesh panel to turn on
the local remeshing.
Based on skewness, size and height of the adjacent moving zones, cells are remeshed
under local remeshing. Desired skewness of the mesh is specified in the Maximum Cell
Skewness. Cells having skewness above the maximum cell skewness value is marked
for remeshing. Based on the size criteria cells with volume above maximum cell volume
and below minimum cell volume are marked for remeshing. Based on skewness the
marking of cells is done at each time step whereas marking based on size criteria is
performed between the specified Size Remesh Interval since change in cell size is
typically small over one time step.
28
FLUENT replaces the remeshed cells only if the quality of the remeshed cells has
improved. But this behaviour can be over ruled by disabling Must Improve Skewness
under option.
If the Sizing Function under option is enabled FLUENT marks cells based on the size
distribution generated by the sizing function in addition to the marking cells based on
the minimum and maximum volumes. The size distribution can be controlled by
specifying the Sizing Function Rate and Sizing Function Variation.
Sizing Function Variation is used to control how large or small an interior cell can be
with respect to its closest boundary cell. A value of zero indicates constant size
distribution away from the boundary. A value of 0.5 indicates an interior cell size can be
at most 1.5 times the size of the closest boundary cell. A value of -0.5 indicates an
interior cell size can be half the size of the closest boundary cell.
Sizing Function Rate is used to control how rapidly the cell size varies from the
boundary. This value can be specified between -1 and 1. A value of 0 indicates a linear
variation of cell size away from the boundary. If the value is positive, slower transition
29
from the boundary to the specified size function variation value. If the value is negative,
faster transition from the boundary to the specified size function variation value.
The resolution of the sizing function can be controlled by using Sizing Function
Resolution. The size of the background bins used to evaluate the size distribution with
respect to the minimum characteristic length of the current mesh is determined by the
sizing function resolution.
30
If the zone is deforming and moving at the same time UDF can be used to define the
geometry and motion of the zone which change with time.
DEFINE macros that can be used to control the behaviour of the dynamic mesh are
1. DEFINE_CG_MOTION
2. DEIFNE_GEOM
3. DEFINE_GRID_MOTION
4.6.1.1 DEFINE_CG_MOTION
Using this macro, motion of a particular dynamic zone can be specified by providing
linear (vel) and angular velocity (omega) at every time step. FLUENT uses these
velocities to update the node positions on the dynamic zone.
Macro: DEFINE_CG_MOTION ( name, dt, vel, omega, time, dtime)
name is supplied by the user. This name is used while hooking the UDF file to
the dynamic zone.
dt is is a pointer to the dynamic zone data structure
vel is used to specify linear velocity by the user
omega is used to specify angular velocity by the user
time is the current time supplied by FLUENT
dtime is the time step supplied by FLUENT
dt, vel, omega, time, dtime are variables that are passed by the FLUENT solver to the
UDF. The linear and angular velocities are returned to FLUENT by overwriting the
arrays vel and omega respectively.
4.6.1.2 DEFINE_GEOM
This macro is used to define the geometry of the deforming zone. Through spring based
smoothing or after local remeshing the nodes are repositioned by calling
DEFINE_GEOM UDF when FLUENT updates a node on a deforming zone.
Macro: DEFINE_GEOM (name, d, dt, position)
31
name is supplied by the user. This name is used while hooking the UDF file to
the dynamic zone.
d is the domain pointer
dt is a pointer to the dynamic zone data structure
position is an array of coordinates
d, dt, position are variables that are passed by the FLUENT solver to the UDF. After
projection to the geometry defining zone the new position is returned to the FLUENT
by overwriting the position array.
4.6.1.3 DEFINE_GRID_MOTION
While updating the node position on a dynamic zone, FLUENT assumes that there is no
relative motion between the nodes. If there is a need to control the motion of each node
independently, this macro can be used. For example based on the deflection due to fluid
structure interaction the position of each node can be updated.
Macros: DEFINE_GRID_MOTION (name, d, dt, time, dtime)
The terms used in this macro are already explained in the previous two macros. d, dt,
time, dtime are variables that are passed by the FLUENT solver to the UDF.
DEFINE_GRID_MOTION is not used in setting up the model, but the remaining two
macros are discussed further as and when they are used.
4.7 Conclusion
All the methods in the dynamic mesh update and its applications are discussed. A lot of
effort was put to understand the working of UDF for dynamic mesh. UDF for dynamic
mesh are further explained in the next chapter as and when they are used.
32
(a)
(b)
Figure 5-1: Complete RE (a) and a part of RE (b) that was considered.
33
In a practical RE the positions of the rotating rotor inside a stationary housing is shown
in figure 5-2. As explained in section 2.2 crankshaft completes three rotations when
rotor makes one complete rotation. Also it is clear that rotor rotates eccentrically with
the help of phasing gear mechanism so that all the apex seal is in touch with the
housing. In doing so rotor is moving upward in figure 5-2(ii) as the rotor rotates in
clockwise direction in figure 5-2(iii) rotor is moving towards the right hand side.
Further in figure 5-2(iv) rotor is moving down wards and finally to the left hand side
(figure 5-2(vi)) as rotor rotates. This sequence is periodic with the rotation of the rotor.
34
To generate coordinates with stationary rotor and deforming housing model, housing is
made to rotate in the same sequence but in opposite direction. MATLAB is used to
rotate the housing as said in the above sequence using m-files. M-files used to generate
curves for rotor and housing is provided in APPENDIX A. Positions of the housing at
an interval of 30 degree rotation with stationary rotor are shown in figure 5-3. In the
figure 5-3 only the part of the housing coming in front of the considered phase of the
rotor is taken into consideration. These coordinate later could have been used in UDF to
define the boundary of the housing changing with time. Thus the volume of the
combustion chamber is made to vary with time.
35
36
This method was not pursued further due to the following limitations:
1. At the later stage inlet and exhaust ports can not be provided as this will make
the housing boundary discontinuous.
2. Ignition, inlet and exhaust ports effect can not be considered.
3. Also, the effect on the flow when the rotor rotates in the stationary housing is
not same as the effect of stationary rotor and rotating housing. This effect was
over looked because of the simplicity it offered.
According to Sierens et al. [27], using an electric discharge system while rotating the
housing around a fixed rotor, Wolters (1978) measured gas velocities in the combustion
chamber of a RE. No additional information about Wolters measurements is provided.
37
3. After successfully developing the above two model the same idea is
implemented into the RE model and carryout flow simulation.
Once the basic model is set up then it can be further developed like providing inlet and
exhaust port for the flow analysis, providing sparkplug for combustion analysis, varying
the rotor recess geometry, spark plug location, etc.
38
Grid is generated using GAMBIT which is pre processor for generation of grid and
applying boundary conditions.
Using DEFINE_CG_MOTION macro, motion of a particular dynamic zone can be
specified by providing with the linear (vel) and angular velocity (omega) at every time
step. FLUENT uses these velocities to update the node positions on the dynamic zone.
#include "udf.h"
DEFINE_CG_MOTION(rotate, dt, vel,omega, time, dtime)
{
NV_S (vel, =, 0.0);
NV_S (omega, =, 0.0);
omega[2] = 1.0;
}
39
Equation 5-1
x = r sin( t )
..Equation 5-2
y = r cos( t )
In this case angular velocity is given three times the value of omega.
#include "udf.h"
#define E 3.0 /*Eccentricity*/
real beta;
DEFINE_CG_MOTION(eccentric, dt, vel, omega, time, dtime)
{
NV_S (vel, =, 0.0);
NV_S (omega, =, 0.0);
omega[2] = 1.0;
beta = 3;
vel[0] = -beta*E*sin(beta*time);
vel[1] = beta*E*cos(beta*time);
vel[2] = 0;
}
In this case linear velocity (vel) is used to specify motion of the small box at a distance
E from the centre of big box.
vel[0], vel[1] and vel[2] represents x, y and z Cartesian coordinates respectively.
beta is the angular velocity which is assigned as three rad/sec.
As explained earlier angular velocity (omega) is used to specify the motion of the box
about its own CG.
The initial grid is generated using GAMBIT with a small box placed at a distance from
the centre of the big box as shown in the figure 5-6. Local remeshing and smoothing is
40
used as the mesh is triangular and again not much concentration was given on the
parameters of smoothing and remeshing. The preview position of the small box is
shown from figure 5-16 to 5-20m, fine mesh is used and quality of remeshing is not
good (white patches) as the small box rotates.
41
42
43
44
45
..Equation 5-3
46
..Equation 5-4
= cos 1 ( x / D)
y = D sin(cos 1 ( x / D))
..Equation 5-5
The above equation is used to define the circular geometry of the housing.
#include "udf.h"
#define D 10 /* radius of the circle */
DEFINE_GEOM(slippery_arcs, domain, dt, position)
{
real y;
y=position[1];
if (y>=0.0)
position[1] = D*sin(acos(position[0]/D));
else
position[1] = -D*sin(acos(position[0]/D));
}
DEFINE_CG_MOTION(rotate, dt, vel,omega, time, dtime)
{
NV_S (vel, =, 0.0);
NV_S (omega, =, 0.0);
omega[2] = 1.0;
}
DEFINE_GEOM is used along with DEFINE_CG to define the rotation of the valve.
The standard features of UDF DEFINE_GEOM are discussed in section 4.6.1.2.
Here position [0] and position [1] corresponds to x and y coordinates of the housing.
Due to the trigonometric limitation y coordinates less than zero are just multiplied by
negative sign.
Specified parameters are
Spring based smoothing
Spring constant factor
0.02
0.30
Convergence tolerance
0.001
Number of iteration
Local remeshing
47
0.017
0.65
0.5
-0.5
Dynamic zone
Valve
Type
rigid body
Cell height
0.005
UDF file
rotate
x=-0.0; y=0.0
Housing
Type
deforming
Geometry UDF
Slippery_arcs
Cell height
0.005
Height factor
0.5
Maximum skewness
0.65
The preview of the butterfly valve is show from figure 5-18 to 5-20.
48
At the end of 2.5 sec the mesh quality was reasonable good and also it was able to retain
the geometry of the housing in good shape.
49
Figure 5-22: Triangular valve after 2.5 sec with old macro.
50
Even after playing with local remeshing and spring based smoothing parameters, the
geometry of the housing was not able to retain to its original shape as shown in figure 522.
If we revisit the equations used DEFINE_GEOM, using the x-coordinates, ycoordinates of the nodes are repositioned. But as the node is displaced during the time
step both x and y coordinates may have moved away from the original circle
coordinates. So the x-coordinates used to find y-coordinates may itself be displaced
from the original circle coordinates thus giving a wrong y-coordinate value.
Also for housing having complex equation as in the case of RE, it is difficult to inverse
the equation (like Equation 5-4) and use this method.
To overcome this problem, x and y-coordinates for the nodes placed on the housing at
initial conditions are generated. At each time step, as the FLUENT calls
DEFINE_GEOM to reposition each node individually, the distance between the
displaced node and the generated points is compared to identify the closest and thus
reposition the node with the coordinates of the closest point. By doing so both x and y
coordinates are replaced instead of doing only one coordinates.
DEFINE_GEOM is used along with DEFINE_CG to define the rotation of the valve.
The standard features of UDF DEFINE_GEOM are discussed in section 4.6.1.2.
#include "udf.h"
#define NCOORDS 126 /* number of coordinates points*/
DEFINE_GEOM(slippery_arcs, domain, dt, position)
{
int i;
real dist2;
int closest_i;
real distmin =100.00;
real nodex[NCOORDS] = { ..... x coordinates of the housing
};
real nodey[NCOORDS] = {
};
51
distmin = dist2;
}
position[0] = nodex[closest_i];
position[1] = nodey[closest_i];
In the above programme nodex and nodey are generated x and y coordinates which are
defined as arrays.
NCOORDS is the number of coordinates points generated
i is the integer used for counting number of arrays.
dist2 is the square of the distance between the generated points and the displaced node
point.
distmin is the variable to store the minimum value of the square of the distance
between the generated points and the displaced node point.
When distmin reaches minimum value the corresponding x and y coordinates are used
to reposition the nodes on the housing using position.
Again position [0] and position [1] corresponds to x and y coordinates of each node on
the housing.
This same UDF along with x and y coordinates are given in APPENDIX B. Triangular
Valve after 20 sec is shown in figure 5-24.
52
Parameters
0.02
0.30
Convergence tolerance
0.001
Number of iteration
Local remeshing
Minimum cell volume (m3)
0.017
0.65
Dynamic zone
Valve
Type
rigid body
Cell height
0.4
UDF file
rotate
x=-0.0; y=0.0
Housing
Type
deforming
Geometry UDF
Slippery_arcs
Cell height
0.4
53
Height factor
0.5
Maximum skewness
0.65
The quality of the remesh at the end of 20 sec was good and the geometry of the
housing was also in perfect shape.
5.4.3 Rotary engine with small clearance between rotor and housing
After the successful run of the triangular valve, RE with small clearance between rotor
and housing is modelled using GAMBIT as shown in figure 5-24. The UDF used in
triangular valve is implemented for both RE with clearance and perfect contact. Exactly
same UDF is used for both RE model. As the geometry of the housing is not as simple
as a circle, UDF is bit modified for the reason discussed in section in 5.4.4. UDF is
given in APPENDIX C.
54
55
Parameters
0.5
0.4
Convergence tolerance
0.001
Number of iteration
Local remeshing
Minimum cell volume (m3)
3.088e-06
0.65
Dynamic zone
Rotor
Type
rigid body
Cell height
0.0039
UDF file
eccentric
x=-0.01542; y=0.0
Housing
Type
deforming
Geometry UDF
Slippery_arcs
56
Cell height
0.0039
Height factor
0.5
Maximum skewness
0.65
The model is running properly even after more than 3 sec. Simulation is carried out on
this model first before doing on the RE with rotor and housing in perfect contact. This
gives an idea in setting up the parameters for simulation in RE with perfect contact.
Also the simulation in model having perfect will be slower than the RE with small
clearance.
Figure 5-29: Rotary engine having perfect contact between rotor and housing.
After the successful run of the triangular valve model, RE with perfect contact between
rotor and housing is modelled as shown in figure 5-29. The same UDF used for the
triangular valve is used with some modification for both RE with and without clearance
between rotor and housing model.
During grid generation nodes are placed at equal distance on the circumference of the
housing and using MATLAB coordinates are generated for equal increments of angle.
Increment of angle is set equal to the circumferential distance between the nodes. In the
case of triangular valve the housing was a perfect circle so nodes are uniformly placed
over the housing in terms of angle between the nodes from the origin.
57
Where as in the case of rotor housing, the radius from the centre of the origin is not
constant as shown in the figure 5-31, thus the nodes placed at equal distance on the rotor
housing will not be at equal interval of angle from the origin. This in turn leads to the
mismatch in the coordinates generates at equal increment of angle using MATLAB and
the coordinates of the nodes placed during grid generation. To overcome this problem
coordinates are generated at closer interval than the actual node position. In other words
if the housing has 100 nodes, say 200 coordinates at equal interval of angle from the
origin is generated and fed into the UDF. The UDF is given in APPENDIX C.
58
59
Parameters
0.2
0.5
Convergence tolerance
0.001
Number of iteration
Local remeshing
Minimum cell volume (m3)
3.053e-06
0.65
Dynamic zone
Rotor
Type
rigid body
Cell height
0.0039
UDF file
eccentric
x=-0.01542; y=0.0
Housing
Type
deforming
Geometry UDF
Slippery_arcs
Cell height
0.0039
60
Height factor
0.5
Maximum skewness
0.65
Figure 5-31 to 35 shows the RE with zero clearance at different time position. At the
end of the preview the shape of the housing is retained. As it is said earlier the
coordinates generated is more the no of actual nodes on the housing, the quality of the
mesh near the housing was not as good as it was in the triangular valve model. In turn
preview failed at 2.4 sec due to negative cells. The quality of remeshing other than near
rotor housing is good.
Before opting for this model many other options like with finer mesh, coarser mesh,
varying intensity of the coordinates only at some region, increasing area of contact
between rotor and housing, etc has been checked out without any success. Also, the
coordinates of the node on the housing was tried to measure indirectly by placing vertex
on each node (In GAMBIT there is no option to check the coordinate value of the node)
and thus generating coordinate value. Due to compromise done while placing the vertex
finally the model with UDF having measured coordinates did not worked out at all.
After exploring many options it is settled for present UDF having generated coordinates
points double the number of nodes on the housing. The logic has already been tested
convincingly in triangular valve model. Only a fine tuning is required in terms of
coordinates generated which is used in UDF for smooth running.
5.5 Conclusion
Dynamic capabilities has been explored deeply to setup a flexible RE model which
accept complexities of practical RE like inlet and exhaust ports, ignition, etc., The
eccentric rotation of the rotor is accomplished. The problem arising from the contact
between the rotating part and the housing has been handled successfully as shown in
triangular valve. Finally a RE model with perfect contact between rotor and housing is
set up. The UDF used in triangular valve model was customized for RE model due to
the complex shape of the rotor housing. For demonstration simulation of the available
RE model has been carried which will be discussed in the next chapter.
61
X Velocity
0.2 m/s
62
Y velocity
0.2m/s
Temperature
300k
During the simulation rotor is rotating in anti-clockwise direction as shown in figure 61.
1e-6
63
Figure 6-2: Static pressure simulation of rotary engine with clearance at 0.3 sec.
Figure 6-3: Velocity vector simulation of rotary engine with clearance at 0.3 sec.
64
Figure 6-4: Static pressure simulation of rotary engine with clearance at 0.5 sec.
Figure 6-5: Velocity vector simulation of rotary engine with clearance at 0.5 sec.
65
Figure 6-6: Static pressure simulation of rotary engine with perfect contact at 0.33 sec.
Figure 6-7: Velocity vector simulation of rotary engine with perfect contact at 0.33 sec.
66
After getting an idea about the time step input simulation of the RE model with perfect
time contact between rotor and housing is carried out. The iteration parameters are as
follows
Time step
1e-6
6.3 Conclusion
Simulation of RE with small clearance and perfect contact between rotor and housing is
carried out for demonstration. Nothing really can be drawn in terms of flow analysis as
there were no inlet and exhaust port and rotor pocket. This is the first step in setting up a
2D model of a practical RE.
67
7 Conclusion
Principle operation of RE is completed by the typical four stroke of an otto cycle.
During this time the crankshaft rotates at three times the speed of the rotor. RE is
mechanically simpler IC engine with no valves, cranking mechanism and reciprocating
part. This makes the RE compact, smooth and powerful.
Review of the analysis of the RE using CFD is carried out, and lack of experimental
data is acknowledged. The last computational analysis on RE was carried out in 1994.
In order to design efficient RE it is necessary to under the influence of the engine
parameters on fluid flow, fuel-air mixing and combustion of RE. Dynamic mesh
capabilities and UDF of FLUENT are explored in setting up a flexible RE model.
Modelling of RE was started with stationary rotor and rotating housing. Later
modelling of RE with stationary housing and rotating rotor is set up as it was found
more flexible in handling inlet and exhaust ports and ignition for further work. The
eccentric rotation of the rotor is modelled successfully. The most challenging part of
this project was the problem arising from the contact between the rotating part and the
housing as in triangular valve is modelled to run smoothly as a result of tenacious effort.
Further the complex geometry of the rotor housing does not make the situation any
simple. Thus modelling of the RE was done with limited success.
Ideal gas compressible flow simulation is carried out both on RE model having small
clearance and perfect contact between rotor and housing. This was carried out to
demonstration the simulation of RE.
68
Sometimes when files are read from recent files, UDF goes missing in
dynamic zone.
Couple of times case file having same parameters has resulted in different
mesh preview.
69
References
1. Yamamoto, K., Rotary Engine, Sankaido, Tokyo, 1981.
2. Jones, C., Ellis, D.R and Meng, P. R., Multi-Fuel Rotary Engine for General
Aviation Aircraft, AIAA/SAE/ASME 19th Joint Propulsion Conference, Seatle, Wash.,
Paper No. AIAA-83-1340, 1983.
3. Ritsuharu Shimizu, Harno Okimoto, Seijo Tashima and Suguru Fuse, The
Characteristic of Fuel Consumption and Exhaust Emission of the Side Exhaust port
Rotary Engine, SAE International Congress and Exposition, Detroit, Mich., SAE Paper
No. 950454, 1995.
4. John D. Anderson, Computational fluid dynamics: The basics with applications,
McGraw-Hill, Inc. New York, 1995.
5. Shih, T.I-P., Yang, S-L., and Schock, H.J., A Two-dimensional Numerical Study of
the Flow Inside the Combustion Chamber of a Motored Rotary Engine, SAE
International Congress and Exposition, Detroit, Mich., SAE Paper No. 860615, 1986
6. Grasso, F., Wey, M.J., Bracco, F.V., and Abraham, J., Three-Dimensional
Computations of Flows in a Stratified-Charge Rotary Engine, SAE International
Congress and Exposition, Detroit, Mich., SAE Paper No. 870409, 1987.
7. Amsden, A.A., Ramshaw, J.D., ORourke, P.J., and Dukowicz, J.K., KIVA: A
Computer Program for Two and Three Dimensional Fluid Flows with Chemical
Reactions and Fuel Sprays, LA-10245-MS, Los Alamos National Laboratory, Feb.
1985.
8. Ramos, J.I., Internal Combustion Engine Modeling, Newyork, 1989.
9. Abraham, J., Grasso, F., Wey, M.J and Bracco, F.V., Pressure Non-Uniformity
and Mixing Characteristics in Stratified-Charge Rotary Engine Combustion, SAE
International Congress and Exposition, Detroit, Mich., SAE Paper No. 880624, 1988.
10. Steinthorsson, E., Shih, T.I-P, Schock, H.j., and Stegman, J., Calculations of the
Unsteady, Three-Dimensional Flow Field Inside a Motored Wankel Engine, SAE
International Congress and Exposition, Detroit, Mich., SAE Paper No. 880625, 1988.
11. Abraham, J., and Bracco, F.V., Comparisons of Computed and Measured Mean
Velocity and Turbulence Intensity in a Motored Rotary Engine, SAE International
Congress and Exposition, Detroit, Mich., SAE Paper No. 881602, 1988.
70
71
22. Chouinard, E., Hamady, F., and Schock, H., Air flow Visulization and LDV
Measurement in a Motored Rotary Engine Assembly Part II: LDV Measurements, SAE
International Congress and Exposition, Detroit, Mich., SAE Paper No. 900031, 1989.
23. Abraham, J and Bracco, F.V., Comparison of Computed and Measured Pressure
in a Premixed-charge Natural-Gas-Fueled Rotary Engine, SAE International Congress
and Exposition, Detroit, Mich., SAE Paper No. 890671, 1989.
24. Roberts, J.A., Norman, T.J., Ekchian, J.A., and Heywood, J.B., Computer
Models for Evaluating Premixed and Disc Wankel Engine Performance, SAE
International Congress and Exposition, Detroit, Mich., SAE Paper No. 860613, 1986.
25. Shih, T, I-P., Schock, H.J., Ramos, J.I., Fuel-Air Mixing and Combustion in a
Two-Dimensional Wankel Engine, SAE International Congress and Exposition, Detroit,
Mich., SAE Paper No. 870408, 1987.
26. FLUENT Inc., FLUENT 6.1 documentation.
27. Sierens, R., Baert, R., Winterbone, D.E., and Baruah, P. C., A Comprehensive
study of Wankel Engine Performance, SAE International Congress and Exposition,
Detroit, Mich., SAE Paper No.830332, 1983.
72
APPENDIX
APPENDIX A - M-file used in the MATLAB for rotor and housing
M-file for rotor
% Rotor
R=0.1064;
%Generating Radius
e=0.01542;
%Eccentricity
C=0;
%Clearance
% v=(pi/6):.01:(pi/2);
% for the rotor face 1
% v=(5*pi/6):.01:(7*pi/6);
% for the rotor face 2
v=(3*pi/2):.01:(11*pi/6);
% for the rotor face 3
x=R*cos(2*v)-3*((e^2)/R)*sin(6*v).*sin(2*v)+2*e*(19*(e/R)^2*(sin(3*v)).^2).^(1/2).*cos(3*v).*cos(2*v);
y=R*sin(2*v)+3*((e^2)/R)*sin(6*v).*cos(2*v)+2*e*(19*(e/R)^2*(sin(3*v)).^2).^(1/2).*cos(3*v).*sin(2*v);
figure(1)
plot(x,y)
axis equal
hold on
M-file for housing
Zero degree rotation
% Rotor Housing
R=0.1064;
E=0.01542;
C=0.0015;
A=-pi/3:.01:pi/3;
t1=(0.01542)*cos(0*pi/6);
t2=(0.01542)*sin(0*pi/6);
x=E*cos(3*A)+(R+C)*cos(A);
y=E*sin(3*A)+(R+C)*sin(A);
r=sqrt(x.^2+y.^2);
theta=(atan(y./x))+0*pi/6;
X=r.*cos(theta);
Y=r.*sin(theta);
m=X+t1;
n=Y+t2;
figure(1)
plot(m,n)
axis equal
hold on
%Generating Radius
%Eccentricity
%Clearance
%Eccentric rotation
%Eccentric rotation
73
30 degree rotation
% Rotor Housing
R=0.1064;
E=0.01542;
C=0.001;
A=-pi/2:.01:pi/6;
t1=(0.01542)*cos(1*pi/6-pi/2);
t2=(0.01542)*sin(1*pi/6-pi/2);
x=E*cos(3*A)+(R+C)*cos(A);
y=E*sin(3*A)+(R+C)*sin(A);
r=sqrt(x.^2+y.^2);
theta=(atan(y./x))+1*pi/6;
X=r.*cos(theta);
Y=r.*sin(theta);
m=X+t1;
n=Y+t2;
figure(1)
plot(m,n)
axis equal
hold on
%Generating Radius
%Eccentricity
%Clearance
%Eccentric rotation
%Eccentric rotation
60 degree rotation
Part A
% Rotor Housing
R=0.1064;
E=0.01542;
C=0.001;
A=-pi/2:.01:0;
t1=(0.01542)*cos(2*pi/6);
t2=(0.01542)*sin(2*pi/6);
x=E*cos(3*A)+(R+C)*cos(A);
y=E*sin(3*A)+(R+C)*sin(A);
r=sqrt(x.^2+y.^2);
theta=(atan(y./x))+2*pi/6;
X=r.*cos(theta);
Y=r.*sin(theta);
m=X-t1;
n=Y-t2;
figure(2)
plot(m,n)
axis equal
hold on
Part B
% Rotor Housing
R=0.1064;
%Generating Radius
%Eccentricity
%Clearance
%Eccentric rotation
%Eccentric rotation
%Generating Radius
74
E=0.01542;
C=0.001;
A=pi/3:.01:pi/2;
t1=(0.01542)*cos(2*pi/6);
t2=(0.01542)*sin(2*pi/6);
x=E*cos(3*A)+(R+C)*cos(A);
y=E*sin(3*A)+(R+C)*sin(A);
r=sqrt(x.^2+y.^2);
theta=(atan(y./x))+2*pi/6+pi;
X=r.*cos(theta);
Y=r.*sin(theta);
m=X-t1;
n=Y-t2;
figure(2)
plot(m,n)
axis equal
hold on
%Eccentricity
%Clearance
%Eccentric rotation
%Eccentric rotation
90 degree rotation
part A
% Rotor Housing
R=0.1064;
E=0.01542;
C=0.001;
A=pi/6:.01:pi/2;
t1=(0.01542)*cos(3*pi/6-pi/2);
t2=(0.01542)*sin(3*pi/6-pi/2);
x=E*cos(3*A)+(R+C)*cos(A);
y=E*sin(3*A)+(R+C)*sin(A);
r=sqrt(x.^2+y.^2);
theta=(atan(y./x))+3*pi/6+pi;
X=r.*cos(theta);
Y=r.*sin(theta);
m=X-t1;
n=Y-t2;
figure(2)
plot(m,n)
axis equal
hold on
Part B
% Rotor Housing
R=0.1064;
E=0.01542;
C=0.001;
A=-pi/2:.01:-pi/6;
t1=(0.01542)*cos(3*pi/6-pi/2);
%Generating Radius
%Eccentricity
%Clearance
%Eccentric rotation
%Eccentric rotation
%Generating Radius
%Eccentricity
%Clearance
%Eccentric rotation
75
t2=(0.01542)*sin(3*pi/6-pi/2);
x=E*cos(3*A)+(R+C)*cos(A);
y=E*sin(3*A)+(R+C)*sin(A);
r=sqrt(x.^2+y.^2);
theta=(atan(y./x))+3*pi/6;
X=r.*cos(theta);
Y=r.*sin(theta);
m=X-t1;
n=Y-t2;
figure(2)
plot(m,n)
axis equal
hold on
%Eccentric rotation
part A
% Rotor Housing
R=0.1064;
E=0.01542;
C=0.001;
A=-pi/2:.01:-pi/3;
t1=(0.01542)*cos(4*pi/6);
t2=(0.01542)*sin(4*pi/6);
x=E*cos(3*A)+(R+C)*cos(A);
y=E*sin(3*A)+(R+C)*sin(A);
r=sqrt(x.^2+y.^2);
theta=(atan(y./x))+4*pi/6;
X=r.*cos(theta);
Y=r.*sin(theta);
m=X+t1;
n=Y+t2;
figure(2)
plot(m,n)
axis equal
hold on
Part B
% Rotor Housing
R=0.1064;
E=0.01542;
C=0.001;
A=0:.01:pi/2;
t1=(0.01542)*cos(4*pi/6);
t2=(0.01542)*sin(4*pi/6);
x=E*cos(3*A)+(R+C)*cos(A);
y=E*sin(3*A)+(R+C)*sin(A);
r=sqrt(x.^2+y.^2);
%Generating Radius
%Eccentricity
%Clearance
%Eccentric rotation
%Eccentric rotation
%Generating Radius
%Eccentricity
%Clearance
%Eccentric rotation
%Eccentric rotation
76
theta=(atan(y./x))+4*pi/6+pi;
X=r.*cos(theta);
Y=r.*sin(theta);
m=X+t1;
n=Y+t2;
figure(1)
plot(m,n)
axis equal
hold on
150 degree rotation
% Rotor Housing
R=0.1064;
E=0.01542;
C=0.001;
A=-pi/6:.01:pi/2;
t1=(0.01542)*cos(5*pi/6-pi/2);
t2=(0.01542)*sin(5*pi/6-pi/2);
x=E*cos(3*A)+(R+C)*cos(A);
y=E*sin(3*A)+(R+C)*sin(A);
r=sqrt(x.^2+y.^2);
theta=(atan(y./x))+5*pi/6+pi;
X=r.*cos(theta);
Y=r.*sin(theta);
m=X+t1;
n=Y+t2;
figure(2)
plot(m,n)
axis equal
hold on
%Generating Radius
%Eccentricity
%Clearance
%Eccentric rotation
%Eccentric rotation
In some cases two m-files like part A and B are used for the rotation of the housing.
This is due to the trigonometric limitations. For the remaining rotating angle it is just
the repeat of the above sequence.
77
78
closest_i = i;
distmin = dist2;
}
}
position[0] = nodex[closest_i];
position[1] = nodey[closest_i];
79
80
-0.0267,-0.0299,-0.0331,-0.0362,-0.0392,-0.0422,-0.0452,-0.0480,
-0.0508,-0.0535,-0.0562,-0.0587,-0.0612,-0.0636,-0.0659,-0.0681,
-0.0703,-0.0723,-0.0743,-0.0761,-0.0779,-0.0796,-0.0811,-0.0826,
-0.0840,-0.0853,-0.0865,-0.0877,-0.0887,-0.0897,-0.0906,-0.0914,
-0.0921,-0.0927,-0.0933,-0.0938,-0.0943,-0.0947,-0.0950,-0.0953,
-0.0955,-0.0957,-0.0959,-0.0960,-0.0960,-0.0961,-0.0961,-0.0961,
-0.0961,-0.0960,-0.0959,-0.0959,-0.0958,-0.0957,-0.0956,-0.0955,
-0.0954,-0.0953,-0.0952,-0.0952,-0.0951,-0.0951,-0.0950,-0.0950,
-0.0950,-0.0950,-0.0950,-0.0950,-0.0951,-0.0951,-0.0952,-0.0952,
-0.0953,-0.0954,-0.0955,-0.0956,-0.0957,-0.0958,-0.0959,-0.0959,
-0.0960,-0.0961,-0.0961,-0.0961,-0.0961,-0.0960,-0.0960,-0.0959,
-0.0957,-0.0955,-0.0953,-0.0950,-0.0947,-0.0943,-0.0938,-0.0933,
-0.0927,-0.0921,-0.0914,-0.0906,-0.0897,-0.0887,-0.0877,-0.0865,
-0.0853,-0.0840,-0.0826,-0.0811,-0.0796,-0.0779,-0.0761,-0.0743,
-0.0723,-0.0703,-0.0681,-0.0659,-0.0636,-0.0612,-0.0587,-0.0562,
-0.0535,-0.0508,-0.0480,-0.0452,-0.0422,-0.0392,-0.0362,-0.0331,
-0.0299,-0.0267,-0.0235,-0.0202,-0.0169,-0.0135,-0.0102,-0.0068,
-0.0034, 0.0000, 0.0034, 0.0068, 0.0102, 0.0135, 0.0169, 0.0202,
0.0235, 0.0267, 0.0299, 0.0331, 0.0362, 0.0392, 0.0422, 0.0452,
0.0480, 0.0508, 0.0535, 0.0562, 0.0587, 0.0612, 0.0636, 0.0659,
0.0681, 0.0703, 0.0723, 0.0743, 0.0761, 0.0779, 0.0796, 0.0811,
0.0826, 0.0840, 0.0853, 0.0865, 0.0877, 0.0887, 0.0897, 0.0906,
0.0914, 0.0921, 0.0927, 0.0933, 0.0938, 0.0943, 0.0947, 0.0950,
0.0953, 0.0955, 0.0957, 0.0959, 0.0960, 0.0960, 0.0961, 0.0961,
0.0961, 0.0961, 0.0960, 0.0959, 0.0959, 0.0958, 0.0957, 0.0956,
0.0955, 0.0954, 0.0953, 0.0952, 0.0952, 0.0951, 0.0951, 0.0950,
0.0950, 0.0950, 0.0950, 0.0950, 0.0950, 0.0951, 0.0951, 0.0952,
0.0952, 0.0953, 0.0954, 0.0955, 0.0956, 0.0957, 0.0958, 0.0959,
0.0959, 0.0960, 0.0961, 0.0961, 0.0961, 0.0961, 0.0960, 0.0960,
0.0959, 0.0957, 0.0955, 0.0953, 0.0950, 0.0947, 0.0943, 0.0938,
0.0933, 0.0927, 0.0921, 0.0914, 0.0906, 0.0897, 0.0887, 0.0877,
0.0865, 0.0853, 0.0840, 0.0826, 0.0811, 0.0796, 0.0779, 0.0761,
0.0743, 0.0723, 0.0703, 0.0681, 0.0659, 0.0636, 0.0612, 0.0587,
0.0562, 0.0535, 0.0508, 0.0480, 0.0452, 0.0422, 0.0392, 0.0362,
0.0331, 0.0299, 0.0267, 0.0235, 0.0202, 0.0169, 0.0135, 0.0102,
0.0068, 0.0034
};
for(i=0; i < NCOORDS; i++)
{
dist2 = (position[0] - nodex[i])*(position[0] - nodex[i])
+ (position[1] - nodey[i])*(position[1] - nodey[i]);
if (dist2 < distmin)
{
closest_i = i;
distmin = dist2;
}
}
position[0] = nodex[closest_i];
position[1] = nodey[closest_i];
81
omega[2] = 1.0;
beta = 3;
vel[0] = -beta*R*sin(beta*time);
vel[1] = beta*R*cos(beta*time);
vel[2] = 0;
}
82