PDSim.scroll package¶
Submodules¶
PDSim.scroll.common_scroll_geo module¶
- class PDSim.scroll.common_scroll_geo.CVInvolute¶
Bases:
objectA simple struct to contain the involute angles
- dphi_max_dtheta¶
‘double’
The derivative of phi_max w.r.t. crank angle
- Type:
- dphi_min_dtheta¶
‘double’
The derivative of phi_min w.r.t. crank angle
- Type:
- class PDSim.scroll.common_scroll_geo.CVInvolutes¶
Bases:
object- Inner¶
PDSim.scroll.common_scroll_geo.CVInvolute
The values for the inner involute of this chamber
- Type:
- Outer¶
PDSim.scroll.common_scroll_geo.CVInvolute
The values for the outer involute of this chamber
- Type:
- has_line_1¶
‘bool’
Boolean for existence of the line #1
- Type:
- has_line_2¶
‘bool’
Boolean for existence of the line #2
- Type:
- PDSim.scroll.common_scroll_geo.Gr(double phi, geoVals geo, double theta, int inv) double¶
The antiderivative of the area integration term, where
\[Gr \equiv \int\left[\left(-y\frac{dx(\phi)}{d\phi}+x\frac{dy(\phi)}{d\phi}\right)d\phi\right]\]
- class PDSim.scroll.common_scroll_geo.HTAnglesClass¶
Bases:
objectA struct with angles associated with the calculations needed for the assesment of heat transfer in the chambers of the scroll compressor
- phi_1_i¶
‘double’
Maximum involute angle on the inner involute of the wrap that forms the outer wall of the CV
- Type:
- phi_1_o¶
‘double’
Maximum involute angle on the outer involute of the wrap that forms the inner wall of the CV
- Type:
- phi_2_i¶
‘double’
Minimum involute angle on the inner involute of the wrap that forms the outer wall of the CV
- Type:
- phi_2_o¶
‘double’
Minimum involute angle on the outer involute of the wrap that forms the inner wall of the CV
- Type:
- phi_i0¶
‘double’
The initial angle on the inner involute of the wrap that forms the outer wall of the CV
- Type:
- PDSim.scroll.common_scroll_geo.VdV(double theta, geoVals geo, CVInvolutes inv) VdVstruct¶
Evaluate V and dV/dtheta in a generalized manner for a chamber
- class PDSim.scroll.common_scroll_geo.VdVstruct(V, dV)¶
Bases:
objectA struct with values for volume and derivative of volume w.r.t. crank angle
- PDSim.scroll.common_scroll_geo.coords_inv(phi, geoVals geo, double theta, flag='fi') tuple¶
def coords_inv(phi,geo,theta,flag=”fi”)
The involute angles corresponding to the points along the involutes (fixed inner [fi], fixed scroll outer involute [fo], orbiting scroll outer involute [oo], and orbiting scroll inner involute [oi] )
- Parameters:
phi_vec – 1D numpy array or double vector of involute angles
geo – geoVals class scroll compressor geometry
theta – float crank angle in the range 0 to :math: 2pi
flag – string involute of interest, possible values are ‘fi’,’fo’,’oi’,’oo’
- Returns:
tuple of coordinates on the scroll
- Return type:
(x,y)
- PDSim.scroll.common_scroll_geo.coords_norm(phi_vec, geoVals geo, double theta, flag='fi') tuple¶
The x and y coordinates of a unit normal vector pointing towards the scroll involute for the the involutes (fixed inner [fi], fixed scroll outer involute [fo], orbiting scroll outer involute [oo], and orbiting scroll inner involute [oi])
- Parameters:
phi_vec – 1D numpy array vector of involute angles
geo – geoVals class scroll compressor geometry
theta – float crank angle in the range 0 to :math: 2pi
flag – string involute of interest, possible values are ‘fi’,’fo’,’oi’,’oo’
- Returns:
tuple of unit normal coordinates pointing towards scroll wrap
- Return type:
(nx,ny)
- PDSim.scroll.common_scroll_geo.dGr_dphi(double phi, geoVals geo, double theta, int inv) double¶
The partial derivative of Gr with respect to phi with theta held constant
- PDSim.scroll.common_scroll_geo.dGr_dtheta(double phi, geoVals geo, double theta, int inv) double¶
The partial derivative of Gr with respect to theta with phi held constant
- PDSim.scroll.common_scroll_geo.fFx_p(double phi, geoVals geo, double theta, involute_index inv) double¶
The anti-derivative of the x-coordinate force term (Table 2)
- PDSim.scroll.common_scroll_geo.fFy_p(double phi, geoVals geo, double theta, involute_index inv) double¶
The anti-derivative of the y-coordinate force term (Table 2)
- PDSim.scroll.common_scroll_geo.fMO_p(double phi, geoVals geo, double theta, involute_index inv) double¶
The anti-derivative of the spinning moment calculation (Table 2)
- PDSim.scroll.common_scroll_geo.forces(double theta, geoVals geo, CVInvolutes inv, double A) dict¶
Evaluate the force terms for a control volume
- PDSim.scroll.common_scroll_geo.fxA(double phi, geoVals geo, double theta, involute_index inv) double¶
The anti-derivative for the x-coordinate of the centroid
- PDSim.scroll.common_scroll_geo.fyA(double phi, geoVals geo, double theta, involute_index inv) double¶
The anti-derivative for the y-coordinate of the centroid
- class PDSim.scroll.common_scroll_geo.geoVals¶
Bases:
object- copy_inplace(self, geoVals target)¶
For a provided target class, copy over all attributes
- delta_flank¶
‘double’
- Type:
- delta_radial¶
‘double’
- Type:
- delta_suction_offset¶
‘double’
- Type:
- is_symmetric(self) bool¶
Returns true if all the angles for the fixed scroll are the same as for the orbiting scroll
- phi_i0¶
Inner Initial Angle
- phi_ie¶
Inner Ending Angle
- phi_ie_offset¶
‘double’
- Type:
- phi_is¶
Inner Starting Angle
- phi_o0¶
Outer Initial Angle
- phi_oe¶
Outer Ending Angle
- phi_os¶
Outer Starting Angle
- val_if_symmetric(self, double val) double¶
Returns the value if symmetric, throws ValueError otherwise
- xvec_disc_port¶
numpy.ndarray
- Type:
- yvec_disc_port¶
numpy.ndarray
- Type:
- PDSim.scroll.common_scroll_geo.get_compression_chamber_index(long path, long alpha) long¶
Return the index for the compression chamber with integers
- PDSim.scroll.common_scroll_geo.get_compressor_CV_index(_key) long¶
Returns the index defined in the
compressor_CV_indicesenum.
- PDSim.scroll.common_scroll_geo.involute_heat_transfer(double hc, double hs, double rb, double phi1, double phi2, double phi0, double T_scroll, double T_CV, double dT_dphi, double phim) double¶
This function evaluates the anti-derivative of the differential of involute heat transfer, and returns the amount of scroll- wall heat transfer in kW
- Parameters:
hc (float) – Heat transfer coefficient [kW/m2/K]
hs (float) – Scroll wrap height [m]
rb (float) – Base circle radius [m]
phi1 (float) – Larger involute angle [rad]
phi2 (float) – Smaller involute angle [rad]
phi0 (float) – Initial involute angle [rad]
T_scroll (float) – Lump temperature of the scroll wrap [K]
T_CV (float) – Temperature of the gas in the CV [K]
dT_dphi (float) – Derivative of the temperature along the scroll wrap [K/rad]
phim (float) – Mean involute angle of wrap used for heat transfer [rad]
Notes
phi1andphi2are defined such thatphi1is always the larger involute angle in value
- PDSim.scroll.common_scroll_geo.involute_index_to_key(int index) bytes¶
Return the string associated with a given index from the common_scroll_geo.involute_index enumeration
- PDSim.scroll.common_scroll_geo.max2(double a, double b) double¶
- PDSim.scroll.common_scroll_geo.min2(double a, double b) double¶
- PDSim.scroll.common_scroll_geo.plus_one(signatures, args, kwargs, defaults, _fused_sigindex={})¶
- PDSim.scroll.common_scroll_geo.polyarea(x, y)¶
- PDSim.scroll.common_scroll_geo.polycentroid(xi, yi)¶
- PDSim.scroll.common_scroll_geo.rebuild_geoVals(d)¶
- PDSim.scroll.common_scroll_geo.scroll_wrap(geoVals geo) tuple¶
Calculate the scroll wrap centroid and volume
- PDSim.scroll.common_scroll_geo.sortAnglesCCW(double t1, double t2) tuple¶
Sort angles so that t2>t1 in a counter-clockwise sense idea from StackOverflow more description: SoftSurfer
If the signed area of the triangle formed between the points on a unit circle with angles t1 and t2 and the origin is positive, the angles are sorted counterclockwise. Otherwise, the angles are sorted in a counter-clockwise manner. Here we want the angles to be sorted CCW, so if area is negative, swap angles
Area obtained from the cross product of a vector from origin to 1 and a vector to point 2, so use right hand rule to get sign of cross product with unit length
- PDSim.scroll.common_scroll_geo.sortAnglesCW(double t1, double t2) tuple¶
Sort angles so that t2>t1 in a clockwise sense idea from StackOverflow more description: SoftSurfer
If the signed area of the triangle formed between the points on a unit circle with angles t1 and t2 and the origin is positive, the angles are sorted counterclockwise. Otherwise, the angles are sorted in a counter-clockwise manner. Here we want the angles to be sorted CCW, so if area is negative, swap angles
Area obtained from the cross product of a vector from origin to 1 and a vector to point 2, so use right hand rule to get sign of cross product with unit length
PDSim.scroll.core module¶
- class PDSim.scroll.core.Port[source]¶
Bases:
object- D = 0.0005¶
Diameter of the port
- area_dict = None¶
A dictionary with keys of each partner CV, and values equal to the free area of the port with that control volume
- involute = None¶
The code for the involute used to locate this point – ‘i’ or ‘o’
- offset = 0.001¶
Distance away from the involute
- phi = None¶
Involute angle of the involute used to locate this port
- theta = None¶
The array of crank angles used to calculate the free area of the port
- x0 = None¶
The x coordinate of the center of the port
- y0 = None¶
The y coordinate of the center of the port
- class PDSim.scroll.core.Scroll[source]¶
Bases:
PDSimCore,_ScrollThis is a python class that implements functionality for a scroll compressor
It is inherited from the PDSimCore class
This class is only to be used for symmetric scroll wraps, for asymmetric scroll wraps, use the AsymmetricScroll class
- DISC_C1_N(FP, X_d=1.0)[source]¶
The flow path function for the flow between discharge port and the D1 chamber
- DISC_C1_Nm1(FP, X_d=1.0)[source]¶
The flow path function for the flow between discharge port and the D1 chamber
- DISC_D1(FP, X_d=1.0)[source]¶
The flow path function for the flow between discharge port and the D1 chamber
- DISC_DD(FP, X_d=1.0)[source]¶
The flow path function for the flow between discharge port and the DD chamber
- INTERPOLATING_LIQUID_NOZZLE_FLOW(FlowPath, X_d=1.0, X_d_backflow=0.8, upstream_key='EVICIV', A_interpolator=None, DP_floor=1e-10)[source]¶
A generic flow of liquid with mass flow rate calculated from:
\[\dot m = C_d A \sqrt{2\rho\Delta p}\]Furthermore, the area is determined through the use of the spline interpolator.
See also: https://en.wikipedia.org/wiki/Discharge_coefficient
- Parameters:
FlowPath (FlowPath instance) – A fully-instantiated flow path model
X_d (float) – Flow coefficient when the flow goes from
upstream_keyto the downstream keyX_d_backflow (float) – Flow coefficient when the flow goes from downstream key to
upstream_keyupstream_key (string) – Key for the side of the flow path that is considered to be “upstream”
A_interpolator (float) – throat area for isentropic nozzle model [\(m^2\)]
DP_floor (float) – The minimum pressure drop [kPa]
- Returns:
mdot – The mass flow through the flow path [kg/s]
- Return type:
- INTERPOLATING_NOZZLE_FLOW(FlowPath, X_d=1.0, X_d_backflow=0.8, upstream_key='EVICIV', A_interpolator=None, DP_floor=1e-10)[source]¶
A generic isentropic nozzle flow model wrapper with the added consideration that if the pressure drop is below the floor value, there is no flow. This code was originally added to handle the case of the injection line where there is no flow out of the injection which greatly increases the numerical stiffness.
Furthermore, the area is determined through the use of the spline interpolator
This function also implements the use of spline interpolation to calculate the area between the EVI port and the control volume
- Parameters:
FlowPath (FlowPath instance) – A fully-instantiated flow path model
X_d (float) – Flow coefficient when the flow goes from
upstream_keyto the downstream keyX_d_backflow (float) – Flow coefficient when the flow goes from downstream key to
upstream_keyupstream_key (string) – Key for the side of the flow path that is considered to be “upstream”
A_interpolator (float) – throat area for isentropic nozzle model [\(m^2\)]
DP_floor (float) – The minimum pressure drop [kPa]
- Returns:
mdot – The mass flow through the flow path [kg/s]
- Return type:
- SA_S1(FlowPath, X_d=1.0, X_d_precompression=1.0)[source]¶
A wrapper for the flow between the suction area and the S1 chamber
Notes
If geo.phi_ie_offset is greater than 0, the offset geometry will be used to calculate the flow area. Otherwise the conventional analysis will be used.
- V_c1(theta, alpha=1, full_output=False)[source]¶
Wrapper around the Cython code for C1
theta: angle in range [0,2*pi] alpha: index of compression chamber pair; 1 is for outermost set
- V_c2(theta, alpha=1, full_output=False)[source]¶
Wrapper around the Cython code for C2
theta: angle in range [0,2*pi] alpha: index of compression chamber pair; 1 is for outermost set
- V_d1(theta, full_output=False)[source]¶
Wrapper around the compiled code for D1
theta: angle in range [0,2*pi]
- V_d2(theta, full_output=False)[source]¶
Wrapper around the compiled code for D2
theta: angle in range [0,2*pi]
- V_dd(theta, full_output=False)[source]¶
Wrapper around the compiled code for DD
theta: angle in range [0,2*pi] alpha: index of compression chamber pair; 1 is for outermost set
- V_ddd(theta, alpha=1, full_output=False)[source]¶
Wrapper around the compiled code for DDD
theta: angle in range [0,2*pi] alpha: index of compression chamber pair; 1 is for outermost set
- V_injection(theta, V_tube=None)[source]¶
Volume code for injection tube
The tube volume can either be given by the keyword argument V_tube (so you can easily have more than one injection tube), or it can be provided by setting the Scroll class attribute V_inj_tube and NOT providing the V_tube argument
The injection tube volume is assumed to be constant, hence the derivative of volume is zero
- V_sa(theta, full_output=False)[source]¶
Wrapper around the Cython code for sa calcs
- Parameters:
theta (float) – angle in range [0,2*pi]
- property Vdisp¶
- property Vratio¶
- ambient_heat_transfer(Tshell)[source]¶
The amount of heat transfer from the compressor to the ambient [kW]
- attach_HDF5_annotations(fName)[source]¶
In this function, annotations can be attached to each HDF5 field
Here we add other scroll-specific terms
- Parameters:
fName (string) – The file name for the HDF5 file that is to be used
- auto_add_CVs(inletState, outletState)[source]¶
Adds all the control volumes for the scroll compressor.
- Parameters:
inletState – A
Stateinstance for the inlet to the scroll set. Can be approximateoutletState – A
Stateinstance for the outlet to the scroll set. Can be approximate
Notes
Uses the indices of
CV
Description
saSuction Area
s1Suction chamber on side 1
s2Suction chamber on side 2
d1Discharge chamber on side 1
d2Discharge chamber on side 2
ddCentral discharge chamber
dddMerged discharge chamber
c1.iThe i-th compression chamber on side 1 (i=1 for outermost chamber)
c2.iThe i-th compression chamber on side 2 (i=1 for outermost chamber)
- auto_add_flank_leakage(flankFunc, flankFunc_kwargs={})[source]¶
A function to add all the flank leakage terms
- Parameters:
flankFunc (function) – The function that will be called for each flank leakage
flankFunc_kwargs (function) – Dictionary of terms to be passed to the flank leakage function
- auto_add_leakage(flankFunc=None, radialFunc=None, radialFunc_kwargs={}, flankFunc_kwargs={})[source]¶
Add all the leakage terms for the compressor
- Parameters:
flankFunc (function) – The function to be used for the flank leakage path
flankFunc_kwargs (function) – Dictionary of terms to be passed to the flank leakage function
radialFunc (function) – The function to be used for the radial leakage path
radialFunc_kwargs (dict) – Dictionary of terms to be passed to the radial leakage function
- auto_add_radial_leakage(radialFunc, radialFunc_kwargs)[source]¶
A function to add all the radial leakage terms
- Parameters:
radialFunc (function) – The function that will be called for each radial leakage
radialFunc_kwargs (dict) – Dictionary of terms to be passed to the radial leakage function
- build_pressure_profile()[source]¶
Build the pressure profile, tracking along s1,c1.x,d1,ddd and s2,c2.x,d2,ddd and store them in the variables summary.theta_profile, summary.p1_profile, summary.p2_profile
- cache_discharge_port_blockage(xport=None, yport=None, plot=False, N=100)[source]¶
Precalculate the discharge port blockage using the clipper polygon math module
This is computationally quite expensive, which is why it is done only once and then interpolated within.
The port position defaults to be equal to the center of arc1 in the discharge region with 90% the radius of arc1
- Parameters:
xport (list or 1D numpy array of x coordinates, optional) – The x coordinates for the port
yport (list or 1D numpy array of y coordinates, optional) – The y coordinates for the port
plot (bool, optional) – Whether or not to generate plots for each crank angle
N (int, optional) – How many steps to include over one rotation
- calculate_force_terms(orbiting_back_pressure=None)[source]¶
Calculate the force profiles, mean forces, moments, etc.
- Parameters:
orbiting_back_pressure (float, or class instance) – If a class instance, must provide a function __call__ that takes as its first input the Scroll class
- calculate_port_areas(plot=False)[source]¶
Calculate the area between a port on the fixed scroll and all of the control volumes.
This port could be a port for injection, a pressure tap for dynamic pressure measurement, etc.
This function iterates over the ports in
self.fixed_scroll_portsand loads the variablesthetaandarea_dictfor each port
- calculate_scroll_mass()[source]¶
Calculate the mass and centroid of the orbiting scroll
- Returns:
mtotal (float) – Total mass of the orbiting scroll (including any additional mass added at centroid)
zcm__thrust_surface (float) – The location of the centroid above the thrust surface. z = 0 is at the thrust surface, and positive z direction is towards the orbiting scroll
- detailed_mechanical_analysis()[source]¶
In this function the detailed mechanical analsysis is carried out.
Notes
This function implements the method of the documentation on the orbiting scroll forces
The applied force on each of the bearings can be given from:
**| |** ----- **| |** | | | | z_upper | | | **| |** | **| |** ----- **| |** | | | | | | | | | | | | | z_lower | | | | | | | | | **| |** | **| |** -----
and the ratio of bearing distances is given by
mech.L_ratio_bearingswhich is z_lower/z_upper
- determine_partner_CVs(x, y, N=1000, theta=None)[source]¶
For a given point, determine which control volume is connected to it over the course of a rotation. This can be useful for “instrumenting” of the numerical model
- Parameters:
- Returns:
theta (numpy aray) – Crank angle array
partners (list) – List of string keys for the CV found,
Noneif no partner
- get_discharge_port_blockage_poly(theta)[source]¶
Get all the polygons associated with the control volumes that could in principle be connected with the discharge a
- get_port_xy(port, Npts=50)[source]¶
Get the x and y coordinates for a circular port
- Parameters:
port (the Port instance that is being considered)
Npts (how many points in [0, 2*pi] are needed for the circle)
- guess_lump_temps(T0)[source]¶
Guess the temperature of the lump
- Parameters:
T0 (float) – First guess for temperature [K]
- heat_transfer_callback(theta)[source]¶
The scroll simulation heat transfer callback for HT to the fluid in the chambers
heat_transfer_callbackforPDSimCore.derivsmust be of the form:heat_transfer_callback(theta)
but we need to get the inlet and outlet states to get the linear temperature profile in the scroll wrap. Thus we wrap the callback we would like to call in this function that allows us to determine the inlet and outlet state at run-time.
- heat_transfer_coefficient(key, angles)[source]¶
This function evaluates the heat transfer coefficient for a selected correlation
- Parameters:
hc (float) – Heat transfer coefficient [kW/m2/K]
Notes
Pereira and Deschamps “A heat transfer correlation for the suction and compression chambers of scroll compressors” International Journal of Refrigeration, 82(2017), 325-334
- initial_motor_losses(eta_a=0.8)[source]¶
Assume an adiabatic efficiency to estimate the motor power and motor losses
- lower_bearing(W)[source]¶
Moment balance around the upper bearing gives the force for the lower bearing. Torques need to balance around the upper bearing
- lump_energy_balance_callback()[source]¶
The callback where the energy balance is carried out on the lumps
Notes
Derivation for electrical power of motor:
\[\eta _{motor} = \frac{\dot W_{shaft}}{\dot W_{shaft} + \dot W_{motor}}\]\[{\eta _{motor}}\left( \dot W_{shaft} + \dot W_{motor} \right) = \dot W_{shaft}\]\[\dot W_{motor} = \frac{\dot W_{shaft}}{\eta _{motor}} - \dot W_{shaft}\]
- mechanical_losses(shell_pressure='low:shell')[source]¶
Calculate the mechanical losses in the bearings
- Parameters:
shell_pressure (string, 'low', 'low:shell', 'mid', or 'high') – low uses the upstream pressure of the machine, low:shell uses the pressure after the inlet tube, mid uses the average of upstream and downstream pressures, high uses the pressure downstream of the machine
- Returns:
Wdot_losses – The total mechanical losses in kW
- Return type:
- multi_lump_OEB()[source]¶
Defines multi-lump temperatures energy balance calculations and returns a list of redisuals
Notes
Current example considers two lumps:
Tlumps[0] : Tshell
Tlumps[1] : Toil
- poly_intersection_with_cvs(x, y, N, multiple_solns='sum', CVcoords=<cyfunction CVcoords>)[source]¶
For a given polygon, determine the intersection area between a polygon and each of the control volumes in the compressor. This can be useful to calculate the port open area for the discharge port, injection ports, pressure measurement taps, etc.
- Parameters:
x (numpy-array-like) – X coordinates of the points
y (numpy-array-like) – Y coordinates of the points
N (int) – Number of elements in the crank angle array
multiple_solns (str, optional, one of 'sum','error','warning', default is sum) – What to do when there are multiple intersection polygons
CVcoords (function) – The function that can provide the x,y coordinates for a given control volume, by default scroll_geo.CVcoords
- Returns:
theta (numpy aray) – Crank angle array
area_dict (dict) – Dictionary with keys of keys of control volumes that have some intersection, values are areas at each crank angle in
theta
- post_cycle()[source]¶
This stuff all happens at the end of the cycle. It is a private method not meant to be called externally
The following things are done:
The boundary work is calculated
The flows are post-processed
The heat transfer is post-processed
The mass flow rate is calculated
The volumetric efficiency is calculated
The adiabatic efficiency is calculated
The isentropic power is calculated
The power input is calculated
- pre_run(N=40000)[source]¶
Intercepts the call to pre_run and does some scroll processing, then calls the base class function
- scroll_involute_axial_force(theta, p_backpressure=0)[source]¶
Calculate the axial force generated by the pressure distribution along the top of the scroll wrap. The force profile returned is the NET force obtained by subtracting the back pressure from the applied force
Pressure along inner and outer walls is considered to act over one-half of the thickness of the scroll wrap.
Notes
The following assumptions are employed:
Involute extended to the base circle to account for discharge region
Half of the width of the scroll is assumed to see the upstream pressure and the other half sees the downstream pressure
The length of an involute section can be given by
\[s = r_b\left(\frac{\phi_2^2-\phi_1^2}{2}-\phi_{0}(\phi_2-\phi_1)\right)\]- Returns:
F – Axial force matrix from the top of the scroll generated by each control volume [kN]
- Return type:
numpy array
- set_disc_geo(Type, r2=0.0, **kwargs)[source]¶
Set the discharge geometry for the scrolls
- Parameters:
Type – The type of
- set_scroll_geo(*args, **kwargs)[source]¶
Delegates to scroll_geo.set_scroll_geo to calculate the scroll geometry
- single_lump_OEB()[source]¶
Defines single-lump temperature energy balance calculations and returns a single redisual
Notes
- step_callback(t, h, Itheta)[source]¶
Here we test whether the control volumes need to be a) Merged b) Adjusted because you are at the discharge angle
- property theta_d¶
- upper_bearing(W)[source]¶
Moment balance around the upper bearing gives the force for the lower bearing. Torques need to balance around the upper bearing
- wrap_heat_transfer(**kwargs)[source]¶
This function evaluates the anti-derivative of the differential of wall heat transfer, and returns the amount of scroll-wall heat transfer in kW
- Parameters:
hc (float) – Heat transfer coefficient [kW/m2/K]
hs (float) – Scroll wrap height [m]
rb (float) – Base circle radius [m]
phi1 (float) – Larger involute angle [rad]
phi2 (float) – Smaller involute angle [rad]
phi0 (float) – Initial involute angle [rad]
T_scroll (float) – Lump temperature of the scroll wrap [K]
T_CV (float) – Temperature of the gas in the CV [K]
dT_dphi (float) – Derivative of the temperature along the scroll wrap [K/rad]
phim (float) – Mean involute angle of wrap used for heat transfer [rad]
Notes
phi1andphi2are defined such thatphi1is always the larger involute angle in value
PDSim.scroll.expander module¶
- class PDSim.scroll.expander.ScrollExpander(*args, **kwargs)[source]¶
Bases:
ScrollThe expander is just like the compressor, except that the volumes go backwards.
theta starts a revolution at 2*pi, and then decreases over one rotation to 0. Beta is equal to 2*pi-theta whc In this way, all the code for the compressor can be more readily used with the expander
- V_s1(beta, full_output=False)[source]¶
Wrapper around the Cython code for Vs1_calcs
theta: angle in range [0,2*pi]
- V_s2(beta, full_output=False)[source]¶
Wrapper around the Cython code for Vs1_calcs
theta: angle in range [0,2*pi]
- auto_add_CVs(inletState, outletState)[source]¶
Adds all the control volumes for the scroll expander.
- Parameters:
inletState – A
Stateinstance for the inlet to the scroll set. Can be approximateoutletState – A
Stateinstance for the outlet to the scroll set. Can be approximate
Notes
Uses the indices of
CV
Description
daDischarge Area
d1Discharge chamber on side 1
d2Discharge chamber on side 2
s1Suction chamber on side 1
s2Suction chamber on side 2
ssCentral suction chamber
sssMerged suction chamber
e1.iThe i-th expansion chamber on side 1 (i=1 for outermost chamber)
e2.iThe i-th expansion chamber on side 2 (i=1 for outermost chamber)
- lump_energy_balance_callback()[source]¶
The callback where the energy balance is carried out on the lumps
Notes
Derivation for electrical power of motor:
\[\eta _{motor} = \frac{\dot W_{shaft}}{\dot W_{shaft} + \dot W_{motor}}\]\[{\eta _{motor}}\left( \dot W_{shaft} + \dot W_{motor} \right) = \dot W_{shaft}\]\[\dot W_{motor} = \frac{\dot W_{shaft}}{\eta _{motor}} - \dot W_{shaft}\]
PDSim.scroll.plots module¶
- PDSim.scroll.plots.CoordsOrbScroll(theta, geo, shaveOn=True, just_involutes=False, Ndict={})[source]¶
- PDSim.scroll.plots.LoadGeo()[source]¶
Returns a class containing the default parameters for the scroll compressor
r_b
0.003522
phi_i0
0.19829
phi_is
4.7
phi_ie
15.5
phi_o0
-1.1248
phi_os
1.8
phi_oe
15.5
h
0.03289
disc_x0
-0.007
disc_y0
-0.0011
disc_R
0.0060198
- class PDSim.scroll.plots.OSCrossSectionPanel(parent, dictionary, phiv, h, w)[source]¶
Bases:
PanelA figure with the cross-section of the scroll wrap
- class PDSim.scroll.plots.PlotThread[source]¶
Bases:
TaskThread
- class PDSim.scroll.plots.ScrollAnimForm(geo=None, start=True, size=(400, 400), param_dict={}, disc_xy_coords=None)[source]¶
Bases:
Frame
- class PDSim.scroll.plots.TaskThread[source]¶
Bases:
ThreadThread that executes a task every N seconds
- run()[source]¶
Method representing the thread’s activity.
You may override this method in a subclass. The standard run() method invokes the callable object passed to the object’s constructor as the target argument, if any, with sequential and keyword arguments taken from the args and kwargs arguments, respectively.
- class PDSim.scroll.plots.geoVals(**kwargs)[source]¶
Bases:
objectA class which contains the fields related the scroll compressor geometry
- disc_R = 0.0060198¶
- disc_x0 = -0.007¶
- disc_y0 = -0.0011¶
- h = 0.03289¶
- phi_i0 = 0.19829¶
- phi_ie = 15.5¶
- phi_is = 4.7¶
- phi_o0 = -1.1248¶
- phi_oe = 15.5¶
- phi_os = 1.8¶
- rb = 0.003522¶
- PDSim.scroll.plots.overlay_injection_port(theta, geo, phi, ax, inner_outer, rport=None, offset=None)[source]¶
Plot the injection ports on an axis - no scroll wrap plot is generated. Also see plot_injection_ports()
- Parameters:
Notes
If you want symmetric injection ports, the ones on the inner involute should have a value of phi that is pi radians greater than those on the outer involute
- PDSim.scroll.plots.plotScrollSet(theta, geo=None, axis=None, fig=None, lw=None, OSColor=None, show=False, offsetScroll=False, **kwargs)[source]¶
The function that plots the scroll sets
- Parameters:
theta – float Crank angle in radians in the range 0 to \(2\pi\)
- Returns:
matplotlib polygon object for the orbiting scroll
- Return type:
OS
Optional Parameters
Variable
Description
fig
figure to plot on : default, make new figure
axis
axis to plot on : default pylab.gca()
geo
geoVals class with geometric parameters
discOn
plot the discharge port: True/[False]
OSColor
color of orbiting scroll: default ‘r’
lw
line width : default 1.0
discCurves
plot the discharge curves : True/[False]
shaveOn
shave the end of orb. scroll : True/[False]
saveCoords
save the coord. of the orb. scroll to file True/[False]
wallOn
plot the outer wall : [True] /False
offsetScroll
If true, scrolls are offset : True/[False]
- PDSim.scroll.plots.plot_injection_ports(theta, geo, phi, ax, inner_outer)[source]¶
Plot the injection ports
- Parameters:
Notes
If you want symmetric injection ports, the ones on the inner involute should have a value of phi that is pi radians greater than those on the outer involute
- PDSim.scroll.plots.setDiscGeo(geo, Type='Sanden', r2=0.001, **kwargs)[source]¶
Sets the discharge geometry for the compressor based on the arguments. Also sets the radius of the wall that contains the scroll set
- Parameters:
geo – geoVals class class containing the scroll compressor geometry
Type – string Type of discharge geometry, options are [‘Sanden’],’2Arc’,’ArcLineArc’
r2 – float or string Either the radius of the smaller arc as a float or ‘PMP’ for perfect meshing If Type is ‘Sanden’, this value is ignored
Keyword Arguments:
Value
Description
r1
the radius of the large arc for the arc-line-arc solution type
PDSim.scroll.scroll_geo module¶
- PDSim.scroll.scroll_geo.set_scroll_geo(Vdisp, Vratio, Thickness, OrbitingRadius, phi_i0=0.0, phi_os=0.3, phi_is=3.141592653589793, geo=None)[source]¶
Provide the following parameters. The rest will be calculated by the geometry code
Vdisp
Displacement in compressor mode [m^3]
Vratio
Volume ratio (compression chambers at discharge angle / displacement volume) [-]
Thickness
Thickness of scroll wrap [m]
OrbitingRadius
Orbiting radius of the orbiting scroll [m]
Optional parameters are
phi_i0 phi_os phi_is
PDSim.scroll.symm_scroll_geo module¶
- PDSim.scroll.symm_scroll_geo.Area_d_dd(double theta, geoVals geo) double¶
- PDSim.scroll.symm_scroll_geo.Area_s_s1_offset(double theta, geoVals geo) double¶
The area between the suction area and the s1 chamber when an offset scroll wrap is employed [\(m^2\)]
- PDSim.scroll.symm_scroll_geo.Area_s_sa(double theta, geoVals geo) double¶
The area between the suction area and the s1 chamber when an offset scroll wrap is not employed and the area between the suction area and the s2 chamber [\(m^2\)]
- PDSim.scroll.symm_scroll_geo.C1(double theta, int alpha, geoVals geo, bool poly=False) tuple¶
Volume terms for C1,alpha chamber
- Parameters:
- Returns:
values – A tuple with volume,derivative of volume and volume from polygon(if requested)
- Return type:
- PDSim.scroll.symm_scroll_geo.C1_forces(double theta, int alpha, geoVals geo, bool poly=False) dict¶
Force terms for C1,alpha chamber
- Parameters:
- Returns:
values – A dictionary with fields for the analytic and numerical solutions (if requested)
- Return type:
dictionary
- PDSim.scroll.symm_scroll_geo.C2(double theta, int alpha, geoVals geo, bool poly=False) tuple¶
Volume terms for C2,alpha chamber
- Parameters:
- Returns:
values – A tuple with volume,derivative of volume and volume from polygon(if requested)
- Return type:
- PDSim.scroll.symm_scroll_geo.C2_forces(double theta, int alpha, geoVals geo, bool poly=False) dict¶
Force terms for C2,alpha chamber
- Parameters:
- Returns:
values – A dictionary with fields for the analytic and numerical solutions (if requested)
- Return type:
dictionary
- PDSim.scroll.symm_scroll_geo.CVcoords(CVkey, geoVals geo, double theta)¶
Return a tuple of numpy arrays for x,y coordinates for the lines which determine the boundary of the control volume
- Returns:
x (numpy array) – X-coordinates of the outline of the control volume
y (numpy array) – Y-coordinates of the outline of the control volume
- PDSim.scroll.symm_scroll_geo.D1(double theta, geoVals geo, bool poly=False) tuple¶
Volume terms for D1
- Parameters:
theta (float) – The crank angle in the range [\(0,2\pi\)]
geo (geoVals instance) – The geometry class
poly (boolean, optional) – If true, also output the polygon calculations to the dict (SLOW!!)
- Returns:
values – A tuple with volume,derivative of volume and volume from polygon(if requested)
- Return type:
- PDSim.scroll.symm_scroll_geo.D2(double theta, geoVals geo, bool poly=False) tuple¶
Volume terms for D2 chamber
- Parameters:
theta (float) – The crank angle in the range [\(0,2\pi\)]
geo (geoVals instance) – The geometry class
poly (boolean, optional) – If true, also output the polygon calculations to the dict (SLOW!!)
- Returns:
values – A tuple with volume,derivative of volume and volume from polygon(if requested)
- Return type:
- PDSim.scroll.symm_scroll_geo.HT_angles(double theta, geoVals geo, key) HTAnglesClass¶
Return the heat transfer bounding angles for the given control volume
- Parameters:
theta (float) – Crank angle in the range [\(0,2\pi\)]
geo (geoVals instance)
key (string) – Key for the control volume following the scroll compressor naming conventions
- Returns:
angles – with the attributes: phi_1_i: maximum involute angle on the inner involute of the wrap that forms the outer wall of the CV
phi_2_i: minimum involute angle on the inner involute of the wrap that forms the outer wall of the CV
phi_1_o: maximum involute angle on the outer involute of the wrap that forms the inner wall of the CV
phi_2_o: minimum involute angle on the outer involute of the wrap that forms the inner wall of the CV
- Return type:
HTAngles Class
Notes
The keys s1, c1.x, and d1 have as their outer wrap the fixed scroll
The keys s2, c2.x, and d2 have as their outer wrap the orbiting scroll
“Minimum”, and “Maximum” refer to absolute values of the angles
- Raises:
If key is not valid, raises a KeyError –
- PDSim.scroll.symm_scroll_geo.S1(double theta, geoVals geo, bool poly=False, double theta_0_volume=1e-9, bool use_offset=True) tuple¶
Volume and derivative of volume of S1 chamber
- Parameters:
theta (float) – The crank angle in the range [\(0, 2\pi\)]
geo (geoVals instance) – The geometry class
poly (boolean) – If
True, also output the polygon calculation at the end of the tuple (SLOW!!)use_offset (boolean) – If
True, use the offset value from geo.phi_ie_offset, else, don’t use any offset
Notes
If the parameter
geo.phi_ie_offsetis greater than zero, the fixed scroll inner involute is extended by this amount. In general if an offset is used it it should be exactly \(\pi\) radians which will bring the two suction chambers together and allows for a single inlet port to the scroll set.- Returns:
V (float)
dVdTheta (float)
V_poly (float (only if
poly = True))
- PDSim.scroll.symm_scroll_geo.S1_forces(double theta, geoVals geo, bool poly=False, double theta_0_volume=1e-9, bool use_offset=True) dict¶
- PDSim.scroll.symm_scroll_geo.S2(double theta, geoVals geo, bool poly=False, double theta_0_volume=1e-9) tuple¶
Volume and derivative of volume of S2 chamber
- Parameters:
theta (float) – The crank angle in the range [\(0, 2\pi\)]
geo (geoVals instance) – The geometry class
poly (boolean) – If true, also output the polygon calculation at the end of the tuple (SLOW!!)
- Returns:
V (float)
dVdTheta (float)
V_poly (float (only if
poly = True))
- PDSim.scroll.symm_scroll_geo.S2_forces(double theta, geoVals geo, bool poly=False, double theta_0_volume=1e-9) dict¶
Force terms for S2 chamber
- Parameters:
theta (float) – The crank angle in the range [\(0,2\pi\)]
geo (geoVals instance) – The geometry class
poly (boolean, optional) – If true, also output the polygon calculations to the dict (SLOW!!)
- Returns:
values – A dictionary with fields for the analytic and numerical solutions (if requested)
- Return type:
dictionary
- PDSim.scroll.symm_scroll_geo.SA(double theta, geoVals geo, bool poly=False, bool use_offset=True, double Vremove=0) tuple¶
Volume and derivative of volume of SA chamber
- Parameters:
theta (float) – The crank angle in the range [\(0, 2\pi\)]
geo (geoVals instance) – The geometry class
poly (boolean) – If
True, also output the polygon calculation at the end of the tuple (SLOW!!)use_offset (boolean) – If
True, use the offset value from geo.phi_ie_offset, else, don’t use any offsetVremove (boolean) – Volume to remove from the control volume [\(m^3\)]
Notes
If the parameter
geo.phi_ie_offsetis greater than zero, the fixed scroll inner involute is extended by this amount. In general if an offset is used it it should be exactly \(\pi\) radians which will bring the two suction chambers together and allows for a single inlet port to the scroll set.- Returns:
V (float)
dVdTheta (float)
V_poly (float (only if
poly = True))
- PDSim.scroll.symm_scroll_geo.SA_forces(double theta, geoVals geo, bool poly=False, bool use_offset=False) dict¶
- PDSim.scroll.symm_scroll_geo.angle_difference(double angle1, double angle2)¶
- PDSim.scroll.symm_scroll_geo.fxA(double rb, double phi, double phi0) double¶
- PDSim.scroll.symm_scroll_geo.fyA(double rb, double phi, double phi0) double¶
- PDSim.scroll.symm_scroll_geo.getNc(double theta, geoVals geo, int path=1) int¶
The number of pairs of compression chambers in existence at a given crank angle
- Parameters:
theta – float The crank angle in radians.
geo – geoVals instance
path – int Which path to calculate the number of chambers for; 1: s1, c1.1… 2: s2, c2.1, …
- Returns:
- int
Number of pairs of compressions chambers
- Return type:
Nc
- PDSim.scroll.symm_scroll_geo.phi_d_dd(double theta, geoVals geo) double¶
At theta = theta_d, we know that phi_d_dd must be equal to phi_os+pi At theta = theta_d + DELTAtheta, we know that phi_d_dd must be equal to phi_is where DELTAtheta is given by DELTAtheta = phi_os+pi-phi_is
If phi_os+pi = phi_is, there is no offset in the starting angles and phi_d_dd is always equal to phi_is
We are going to assume that the angle varies linearly between theta = theta_d and theta = theta_d+DELTAtheta
This is a newer method than that used in the thesis of Bell (2011)
- PDSim.scroll.symm_scroll_geo.phi_s_sa(double theta, geoVals geo) double¶
- PDSim.scroll.symm_scroll_geo.plot_HT_angles(theta, geo, keys, involute)¶
Plot an involute bound angle graph for each CV for checking of heat transfer bounding angles purposes.
- PDSim.scroll.symm_scroll_geo.radial_leakage_area(double theta, geoVals geo, long key1Index, long key2Index, int location=comm.MID) double¶
Get the flow area of the flow path for a given radial flow pair
- Parameters:
theta (float) – crank angle in the range [0, \(2\pi\)]
geo (geoVals instance)
key1Index (integer)
key2Index (integer)
location (integer, one of UP,DOWN,MID, optional) – What part of the wrap is used to determine the area.
- Return type:
Area in [\(m^2\)]
- PDSim.scroll.symm_scroll_geo.radial_leakage_pairs(geo)¶
Returns a list of all possible pairings for the radial leakages
- Parameters:
None
- Returns:
A list of tuples with the entries of (
key1,``key2``) wherekey1andkey2are the keys for the control volumes
Notes
See page 125 of Bell, Ian, “Theoretical and Experimental Analysis of Liquid Flooded Compression in Scroll Compressors”, PhD. Thesis, Purdue University, http://docs.lib.purdue.edu/herrick/2/
Different analysis is used for 0, 1, >1 sets of compression chambers. But you know from the geometry the maximum number of pairs of compression chambers, and can therefore determine the possible pairings a priori.
- PDSim.scroll.symm_scroll_geo.setDiscGeo(geo, Type='Sanden', r2=0.001, **kwargs)¶
Sets the discharge geometry for the compressor based on the arguments. Also sets the radius of the wall that contains the scroll set
- Parameters:
geo – geoVals class class containing the scroll compressor geometry
Type – string Type of discharge geometry, options are [‘Sanden’],’2Arc’,’ArcLineArc’
r2 – float or string Either the radius of the smaller arc as a float or ‘PMP’ for perfect meshing If Type is ‘Sanden’, this value is ignored
Keyword Arguments:
Value
Description
r1
the radius of the large arc for the arc-line-arc solution type
- PDSim.scroll.symm_scroll_geo.theta_d(geoVals geo) double¶
Discharge angle
Optional Parameters
key
value
geo
The class that defines the geometry of the compressor.