flange - standardized parametric flanges
Flanges are mechanical components used in piping systems to connect pipes, valves, and equipment. They provide a secure and leak-tight connection by bolting two flange faces together. Flanges allow for easy assembly and disassembly, enabling maintenance and modifications in the system. They are available in various materials, sizes, and pressure ratings to suit different applications. Flanges also provide flexibility by allowing different types of connections, such as welding, threaded, or flanged connections. They play a critical role in industries like oil and gas, chemical, and power generation, ensuring the safe and efficient operation of piping systems by facilitating proper alignment, support, and sealing of the connected components.
from build123d import *
from bd_warehouse.flange import SlipOnFlange, WeldNeckFlange
flange1 = SlipOnFlange(nps="8", flange_class=150)
flange2 = WeldNeckFlange(nps="12", flange_class=300, face_type="Ring")
There are two required and one optional parameters used to define a flange: nps,
flange_class, and face_type.
nps
See Pipe NPS for a description of the Nominal Pipe Size.
flange_class
Flange class refers to the pressure-temperature rating assigned to a flange based on its design and construction. It represents the maximum pressure and temperature at which the flange can safely operate without failure. Flange classes are defined by various standards, such as ASME B16.5 or API 6A, and are typically identified by a numerical value (e.g., Class 150, Class 300, etc.). Each flange class has specific requirements for materials, dimensions, and performance, ensuring that the flange can withstand the specified pressure and temperature conditions. Flange class selection is crucial for maintaining the integrity and safety of a piping system by ensuring that the flange can handle the intended service conditions.
- FlangeClass
alias of
Literal[150, 300, 400, 600, 900, 1500, 2500]
face_type
The face of a flange refers to the surface where two flanges come into contact with each other during the connection. There are several different types of flange faces, each serving a specific purpose. These include:
Flat Face (FF): The flange faces are flat and parallel to each other. It is typically used in low-pressure applications where leakage prevention is not a significant concern.
Raised Face (RF): The flange faces have a raised portion around the perimeter. The raised face provides a compression seal when the flanges are bolted together, improving the sealing capability.
Lap Joint (LJ): The flange faces have a flat surface, and a separate lap joint stub end is used between the flanges. It allows easy alignment and rotation of the flanges during assembly.
Ring Type Joint (RTJ): The flange faces have grooves to accommodate a metallic ring gasket. It is commonly used in high-pressure and high-temperature applications, providing excellent sealing performance.
Tongue and Groove: The flange faces have a tongue-like projection on one flange and a corresponding groove on the other flange. It ensures proper alignment and prevents movement or rotation between the flanges.
The selection of the flange face type depends on the specific application, pressure, temperature, and sealing requirements of the piping system. Different flange faces offer varying levels of sealing capability and ease of assembly, allowing engineers and designers to choose the most suitable option for their intended purpose.
- FaceType
alias of
Literal[‘Flat’, ‘Raised’, ‘Ring’, ‘Tongue’, ‘Groove’, ‘Male’, ‘Female’]
Joints
All flanges are created with two RigidJoint: pipe and face. These joints
are positioned in the center of the flange and oriented such that they can be easily
connected to pipes and each other. For example:
inlet_flange = WeldNeckFlange(nps="12", flange_class=300, face_type="Ring")
outlet_flange = SlipOnFlange(nps="12", flange_class=300)
pipe = Pipe(
nps="12",
material="steel",
identifier="40",
path=Edge.make_line((0, 0, 0), (6 * FT, 0, 0)),
)
pipe.joints["inlet"].connect_to(inlet_flange.joints["pipe"])
pipe.joints["outlet"].connect_to(outlet_flange.joints["pipe"])
Flange Types
- class BlindFlange(nps: ~typing.Literal['1/2', '3/4', '1', '1 1/4', '1 1/2', '2', '2 1/2', '3', '4', '5', '6', '8', '10', '12', '14', '16', '18', '20', '22', '24'], flange_class: ~typing.Literal[150, 300, 400, 600, 900, 1500, 2500], face_type: ~typing.Literal['Flat', 'Raised', 'Ring', 'Tongue', 'Groove', 'Male', 'Female'] = 'Raised', rotation: ~build123d.geometry.Rotation | tuple[float, float, float] = (0, 0, 0), align: ~build123d.build_enums.Align | tuple[~build123d.build_enums.Align, ~build123d.build_enums.Align, ~build123d.build_enums.Align] = (<Align.CENTER>, <Align.CENTER>, <Align.MIN>), mode: ~build123d.build_enums.Mode = <Mode.ADD>)[source]
Blind Flange: A blind flange is a solid disk with no bore and is used to close off the end of a pipe or vessel. It is commonly used to isolate or terminate piping systems.
- Parameters:
nps (Nps) – nominal pipe size
flange_class (FlangeClass) – class
face_type (FaceType, optional) – face options. Defaults to “Raised”.
rotation (RotationLike, optional) – object rotation. Defaults to (0, 0, 0).
align (Union[Align, tuple[Align, Align, Align]], optional) – object alignment. Defaults to ( Align.CENTER, Align.CENTER, Align.MIN, ).
mode (Mode, optional) – combination mode. Defaults to Mode.ADD.
- Joints:
“face” (Rigid): attachment point on the flange face for other flanges
- od
Outside diameter
- thickness
Overall thickness
- class LappedFlange(nps: ~typing.Literal['1/2', '3/4', '1', '1 1/4', '1 1/2', '2', '2 1/2', '3', '4', '5', '6', '8', '10', '12', '14', '16', '18', '20', '22', '24'], flange_class: ~typing.Literal[150, 300, 400, 600, 900, 1500, 2500], rotation: ~build123d.geometry.Rotation | tuple[float, float, float] = (0, 0, 0), align: ~build123d.build_enums.Align | tuple[~build123d.build_enums.Align, ~build123d.build_enums.Align, ~build123d.build_enums.Align] = (<Align.CENTER>, <Align.CENTER>, <Align.MIN>), mode: ~build123d.build_enums.Mode = <Mode.ADD>)[source]
Lap Joint: The flange faces have a flat surface, and a separate lap joint stub end is used between the flanges. It allows easy alignment and rotation of the flanges during assembly.
A lapped flange, also known as a lap joint flange, is a type of flange connection that consists of two components: a stub end and a lapped flange. The lapped flange has a flat face, while the stub end is a short piece of pipe with a welded-on collar.
The lapped flange connection works by sliding the stub end into the lapped flange, with the flange face of the stub end resting against the back face of the lapped flange. The two components are then bolted together, securing the joint.
The key feature of a lapped flange connection is that the actual sealing is achieved by a separate gasket placed between the back face of the lapped flange and the flange face of the stub end. The gasket provides the sealing action, while the bolting maintains the necessary pressure to compress the gasket and create a leak-tight connection.
The lapped flange connection offers several advantages, including easy alignment during installation, rotational flexibility, and the ability to easily disconnect and reconnect the joint without disturbing the alignment. It is commonly used in low-pressure and non-critical applications where frequent assembly and disassembly are required.
However, it is important to note that lapped flange connections are not suitable for high-pressure or high-temperature applications that require a higher level of sealing integrity. In such cases, alternative flange types, such as raised face or ring type joint flanges, are typically used.
- Parameters:
nps (Nps) – nominal pipe size
flange_class (FlangeClass) – class
face_type (FaceType, optional) – face options. Defaults to “Raised”.
rotation (RotationLike, optional) – object rotation. Defaults to (0, 0, 0).
align (Union[Align, tuple[Align, Align, Align]], optional) – object alignment. Defaults to ( Align.CENTER, Align.CENTER, Align.MIN, ).
mode (Mode, optional) – combination mode. Defaults to Mode.ADD.
- Joints:
“pipe” (Rigid): attachment point for pipe attached to flange “face” (Rigid): attachment point on the flange face for other flanges
- id
Inside diameter
- od
Outside diameter
- thickness
Overall thickness
- class LappedFlangeStub(nps: ~typing.Literal['1/2', '3/4', '1', '1 1/4', '1 1/2', '2', '2 1/2', '3', '4', '5', '6', '8', '10', '12', '14', '16', '18', '20', '22', '24'], material: ~typing.Literal['abs', 'copper', 'iron', 'pvc', 'stainless', 'steel'], pipe_identifier: ~typing.Literal['K', 'L', 'M', 'STD', 'XS', 'XXS', '5S', '10', '10S', '20', '30', '40', '40S', '60', '80', '80S', '100', '120', '140', '160'], stub_length: float, face_type: ~typing.Literal['Flat', 'Raised', 'Ring', 'Tongue', 'Groove', 'Male', 'Female'] = 'Raised', rotation: ~build123d.geometry.Rotation | tuple[float, float, float] = (0, 0, 0), align: ~build123d.build_enums.Align | tuple[~build123d.build_enums.Align, ~build123d.build_enums.Align, ~build123d.build_enums.Align] = (<Align.CENTER>, <Align.CENTER>, <Align.MIN>), mode: ~build123d.build_enums.Mode = <Mode.ADD>)[source]
The stub component of a Lapped Flange. The stub is welded to the pipe allowing the Lapped Flange to rotate freely around the stub.
- Parameters:
nps (Nps) – stub pipe size
material (Material) – pipe material
pipe_identifier (Identifier) – pipe identifier or schedule
stub_length (float) – end to end length
face_type (FaceType, optional) – face options. Defaults to “Raised”.
rotation (RotationLike, optional) – object rotation. Defaults to (0, 0, 0).
align (Union[Align, tuple[Align, Align, Align]], optional) – object alignment. Defaults to ( Align.CENTER, Align.CENTER, Align.MIN, ).
mode (Mode, optional) – combination mode. Defaults to Mode.ADD.
- class SlipOnFlange(nps: ~typing.Literal['1/2', '3/4', '1', '1 1/4', '1 1/2', '2', '2 1/2', '3', '4', '5', '6', '8', '10', '12', '14', '16', '18', '20', '22', '24'], flange_class: ~typing.Literal[150, 300, 400, 600, 900, 1500, 2500], face_type: ~typing.Literal['Flat', 'Raised', 'Ring', 'Tongue', 'Groove', 'Male', 'Female'] = 'Raised', rotation: ~build123d.geometry.Rotation | tuple[float, float, float] = (0, 0, 0), align: ~build123d.build_enums.Align | tuple[~build123d.build_enums.Align, ~build123d.build_enums.Align, ~build123d.build_enums.Align] = (<Align.CENTER>, <Align.CENTER>, <Align.MIN>), mode: ~build123d.build_enums.Mode = <Mode.ADD>)[source]
Slip-On Flange: A slip-on flange has a flat face and is intended to slide over the pipe and then be welded in place. It is commonly used for low-pressure applications and non-critical systems.
ASME B16.5 does not provide specific guidelines on the amount of space to be left for welding when inserting a pipe into a slip-on flange. However, industry best practices generally recommend leaving a gap or space of approximately 1/16 inch (1.6 mm) between the end of the pipe and the inside face of the slip-on flange.
This gap allows room for the welding process, specifically for the weld bead that will be deposited to join the pipe and the flange. The gap provides a sufficient area for proper fusion and penetration during the welding process. It also helps prevent excessive buildup of weld material that could interfere with the proper fit-up and alignment of the pipe and flange.
When creating pipe terminated with a slip-on flange, the pipe should be 1/16 inch shorter (for each end) than the desired end to end length.
- Parameters:
nps (Nps) – nominal pipe size
flange_class (FlangeClass) – class
face_type (FaceType, optional) – face options. Defaults to “Raised”.
rotation (RotationLike, optional) – object rotation. Defaults to (0, 0, 0).
align (Union[Align, tuple[Align, Align, Align]], optional) – object alignment. Defaults to ( Align.CENTER, Align.CENTER, Align.MIN, ).
mode (Mode, optional) – combination mode. Defaults to Mode.ADD.
- Joints:
“pipe” (Rigid): attachment point for pipe attached to flange “face” (Rigid): attachment point on the flange face for other flanges
- id
Inside diameter
- od
Outside diameter
- thickness
Overall thickness
- class SocketWeldFlange(nps: ~typing.Literal['1/2', '3/4', '1', '1 1/4', '1 1/2', '2', '2 1/2', '3', '4', '5', '6', '8', '10', '12', '14', '16', '18', '20', '22', '24'], flange_class: ~typing.Literal[150, 300, 400, 600, 900, 1500, 2500], face_type: ~typing.Literal['Flat', 'Raised', 'Ring', 'Tongue', 'Groove', 'Male', 'Female'] = 'Raised', rotation: ~build123d.geometry.Rotation | tuple[float, float, float] = (0, 0, 0), align: ~build123d.build_enums.Align | tuple[~build123d.build_enums.Align, ~build123d.build_enums.Align, ~build123d.build_enums.Align] = (<Align.CENTER>, <Align.CENTER>, <Align.MIN>), mode: ~build123d.build_enums.Mode = <Mode.ADD>)[source]
Socket Weld Flange: Socket weld flanges have a socket-like end that is welded to the pipe. They are used for small-diameter and high-pressure piping systems.
- Parameters:
nps (Nps) – nominal pipe size
flange_class (FlangeClass) – class
face_type (FaceType, optional) – face options. Defaults to “Raised”.
rotation (RotationLike, optional) – object rotation. Defaults to (0, 0, 0).
align (Union[Align, tuple[Align, Align, Align]], optional) – object alignment. Defaults to ( Align.CENTER, Align.CENTER, Align.MIN, ).
mode (Mode, optional) – combination mode. Defaults to Mode.ADD.
- Joints:
“pipe” (Rigid): attachment point for pipe attached to flange “face” (Rigid): attachment point on the flange face for other flanges
- id
Inside diameter
- od
Outside diameter
- thickness
Overall thickness
- class WeldNeckFlange(nps: ~typing.Literal['1/2', '3/4', '1', '1 1/4', '1 1/2', '2', '2 1/2', '3', '4', '5', '6', '8', '10', '12', '14', '16', '18', '20', '22', '24'], flange_class: ~typing.Literal[150, 300, 400, 600, 900, 1500, 2500], face_type: ~typing.Literal['Flat', 'Raised', 'Ring', 'Tongue', 'Groove', 'Male', 'Female'] = 'Raised', rotation: ~build123d.geometry.Rotation | tuple[float, float, float] = (0, 0, 0), align: ~build123d.build_enums.Align | tuple[~build123d.build_enums.Align, ~build123d.build_enums.Align, ~build123d.build_enums.Align] = (<Align.CENTER>, <Align.CENTER>, <Align.MIN>), mode: ~build123d.build_enums.Mode = <Mode.ADD>)[source]
Weld Neck Flange
Weld Neck Flange: This type of flange is designed with a tapered hub and a neck that provides reinforcement and better structural integrity. It is typically used in high-pressure and high-temperature applications.
The overall thickness of the flange is stored in the .thickness instance variable. When sizing a pipe for a given overall length, reduce the pipe length by this value for each end with this flange type.
- Parameters:
nps (Nps) – nominal pipe size
flange_class (FlangeClass) – class
face_type (FaceType, optional) – face options. Defaults to “Raised”.
rotation (RotationLike, optional) – object rotation. Defaults to (0, 0, 0).
align (Union[Align, tuple[Align, Align, Align]], optional) – object alignment. Defaults to ( Align.CENTER, Align.CENTER, Align.MIN, ).
mode (Mode, optional) – combination mode. Defaults to Mode.ADD.
- Joints:
“pipe” (Rigid): attachment point for pipe attached to flange “face” (Rigid): attachment point on the flange face for other flanges
- id
Inside diameter
- od
Outside diameter
- thickness
Overall thickness
Specifications
The flanges created by this package are based off the following standards:
ASME B16.5 is a standard issued by the American Society of Mechanical Engineers (ASME) that provides specifications for pipe flanges and flanged fittings. It covers a wide range of flange types, sizes, materials, and pressure ratings. ASME B16.5 establishes the dimensions, tolerances, and technical requirements for flanges used in various industries, including oil and gas, chemical, and power generation. The standard ensures the compatibility, integrity, and performance of flanged connections, facilitating proper alignment, sealing, and strength of the joint. It serves as a reference for manufacturers, engineers, and designers in the selection, design, and installation of flanges, promoting safe and reliable operation of piping systems.