Overview
This example models a portal frame with:- Two concrete walls modeled with Q6 membrane elements
- Three beam members connecting the walls horizontally
- Fixed supports at the base of both walls
- Lateral loads applied at wall joints
What are Membrane Elements?
Membrane elements are 2D finite elements used for plane stress analysis:- Model thin structures loaded in their plane
- Capture in-plane stress distribution
- No out-of-plane bending behavior
- Ideal for walls, plates, and thin shells under in-plane loading
Complete Example
Define geometric parameters
Set up the dimensional parameters for the structure:These parameters define:
- Material properties (E, v)
- Geometric dimensions (h, b, l)
- Section properties (t, sec)
- Loading magnitude (F)
Create model and define materials
Initialize the model and create material and section definitions:
- Material: Concrete with specified E and v
- vig40x40: Rectangular beam section (0.4m × 0.4m)
- muro: Shell/membrane section with 0.4m thickness
Create the nodal mesh
Define nodes for the two walls:This creates a 3-level portal frame structure with walls on each side.
Add membrane elements
Create Q6 quadrilateral membrane elements for the walls:
The
add_membrane_q6() method creates 6-node quadrilateral elements. Nodes are specified in counter-clockwise order: bottom-left, bottom-right, top-right, top-left.Add beam connectors
Connect the two walls with horizontal beams:These beams tie the two walls together at each level. Timoshenko beam theory accounts for shear deformation.
Alternatively, you could use Euler-Bernoulli beams with:
Apply boundary conditions
Fix the base nodes of both walls:All base nodes are fully restrained (x, y, and rotation).
Apply lateral loads
Create a load pattern and apply increasing lateral loads up the left wall:The lateral loads simulate wind or seismic loading, increasing with height.
Full Code
Membrane Element Types in milcapy
milcapy supports several membrane element formulations:Q6 Elements
6-node quadrilateral
- Standard element with mid-side nodes
- Good accuracy for most applications
- Used in this example
Q8 Elements
8-node quadrilateral
- Higher-order interpolation
- Better for curved boundaries
- Use
add_membrane_q8()
Q6i Elements
6-node with incompatible modes
- Enhanced accuracy for bending
- Reduces shear locking
- Use
add_membrane_q6i()
CST Elements
Constant strain triangle
- 3-node triangular element
- Simple but less accurate
- Use for irregular meshes
When to Use Membrane Elements
Appropriate for:
- Shear walls under lateral loads
- Deep beams with D/L > 1/4
- Thin plates under in-plane loading
- Plane stress/strain analysis
- Bracket and gusset plate analysis
Not appropriate for:
- Out-of-plane bending (use shell elements)
- Thick sections under pure bending (use beam elements)
- 3D stress states (use solid elements)
For structures with both in-plane and out-of-plane behavior, consider using shell elements which combine membrane and plate bending behavior.
Patch Test Validation
The membrane element formulations in milcapy pass standard patch tests, ensuring:- Constant strain states are exactly reproduced
- Element convergence with mesh refinement
- Proper rank of stiffness matrix
patch_test.py example in the source code for validation cases.
Advanced Topics
Mesh Refinement
Increase element density in high-stress regions for better accuracy
Mixed Formulations
Combine different element types in transition regions
Incompatible Modes
Use enhanced elements (Q6i, MQ6IMod) for improved bending behavior
Material Nonlinearity
Model concrete cracking and steel yielding
Next Steps
Portal Frame
Learn frame modeling with beam elements
Truss Analysis
Model axial-only structures
Shell Sections
View shell and membrane section API
Material Library
Explore material definitions and properties
