Boundary Conditions#
|
Defining the boundary conditions of the Steel Design add-on for the 2D general method acc. to EN 1993-1-1, 6.3.4, and checking their effect on lateral-torsional buckling against a hand calculation:
Keywords:
boundary conditions general method lateral-torsional buckling lateral restraint fork support critical moment verification example |
Note
Reference: hand calculation acc. to EN 1993-1-1, 6.3.4 and 6.3.2.3, included in the script. Under a uniform moment every segment between two fork supports buckles like a simply supported beam of its own length, so Mcr follows exactly from the formula with C1 = 1. All compared values agree.
The structural model has no supports at the quarter points. The restraints act only in the design, so both beams carry the same internal forces, and the design ratio drops from 0.90 to 0.39 because of the boundary conditions alone. Each node of the boundary conditions needs its own row in the table of nodal supports.
The equivalent member method with effective lengths is shown in Beam Lateral-Torsional Buckling, the choice between the two methods in Stability Methods.
from dlubal.api import rfem, common
from math import inf, pi, sqrt
import pandas
# -------------------------------------------------------
# This example demonstrates the boundary conditions of the Steel Design add-on, which
# define the supports of a member for the 2D general method acc. to EN 1993-1-1, 6.3.4
# (CEN, recommended values), and their effect on lateral-torsional buckling.
#
# Two identical simply supported beams carry the same uniform bending moment. Both have
# fork supports at their ends. Beam 1 is in addition held laterally and against torsion
# at the quarter points, by intermediate nodal supports of its boundary conditions only:
# the structural model has no supports there, so the internal forces of both beams are
# the same and the design ratios differ only because of the boundary conditions.
#
# Beams:
# IPE 300, S235, span L = 8.0 m, uniform moment M_Ed = 55 kNm (equal and opposite end
# moments), no axial force.
#
# Reference:
# Hand calculation acc. to EN 1993-1-1, 6.3.4 and 6.3.2.3. Under a uniform moment every
# segment between two fork supports buckles like a simply supported beam of its own
# length, so the elastic critical moment of both beams follows exactly from
# M_cr = pi^2 E I_z / L^2 * sqrt(I_w / I_z + L^2 G I_t / (pi^2 E I_z)) (C1 = 1),
# with L = 2.0 m for beam 1 and L = 8.0 m for beam 2. The section properties are those
# of the IPE 300 in the RFEM cross-section library.
# -------------------------------------------------------
SPAN = 8.0 # m
M_ED = 55e3 # Nm, uniform design moment
BEAM_RESTRAINED = 1 # held at the quarter points by its boundary conditions
BEAM_UNRESTRAINED = 2 # fork supports at its ends only
# -------------------------------------------------------
# Hand calculation acc. to EN 1993-1-1
# -------------------------------------------------------
E, G = 210000e6, 80769.2e6 # Pa
F_Y = 235e6 # Pa
GAMMA_M1 = 1.0
I_Z = 604.0e-8 # m4, IPE 300
I_T = 19.90e-8 # m4
I_W = 126000e-12 # m6
W_PL_Y = 628.51e-6 # m3
def hand_calculation(segment_length: float) -> dict:
"""
Returns the general method acc. to 6.3.4 for a beam under uniform moment whose
segments between fork supports have the given length.
"""
# Elastic critical moment of a segment with fork supports at both ends, C1 = 1
m_cr = pi**2 * E * I_Z / segment_length**2 * sqrt(I_W / I_Z + segment_length**2 * G * I_T / (pi**2 * E * I_Z))
alpha_ult_k = W_PL_Y * F_Y / M_ED # 6.3.4(2), class 1 section, plastic resistance
alpha_cr_op = m_cr / M_ED
lambda_op = sqrt(alpha_ult_k / alpha_cr_op) # Eq. (6.64)
# chi_op = chi_LT acc. to 6.3.2.3 for rolled sections: h/b = 2 -> buckling curve b
alpha_lt, lambda_lt_0, beta = 0.34, 0.4, 0.75
phi_lt = 0.5 * (1 + alpha_lt * (lambda_op - lambda_lt_0) + beta * lambda_op**2)
chi_lt = min(1 / (phi_lt + sqrt(phi_lt**2 - beta * lambda_op**2)), 1.0, 1 / lambda_op**2)
# Results of the hand calculation: key -> (value, unit, caption)
return {
"m_cr": (m_cr / 1e3, "kNm", "Elastic critical moment M_cr = alpha_cr,op M_Ed"),
"alpha_cr_op": (alpha_cr_op, "-", "Load amplifier alpha_cr,op"),
"alpha_ult_k": (alpha_ult_k, "-", "Load amplifier alpha_ult,k"),
"lambda_op": (lambda_op, "-", "Slenderness lambda_op, Eq. (6.64)"),
"phi_lt": (phi_lt, "-", "Phi_LT, 6.3.2.3"),
"chi_lt": (chi_lt, "-", "Reduction factor chi_op = chi_LT"),
"eta": (GAMMA_M1 / (chi_lt * alpha_ult_k), "-", "Design ratio, Eq. (6.63)"),
}
def define_structure() -> list:
# Beam 1 along y = 0 with nodes on the member at its quarter points, beam 2 along y = 3 m
quarter_points = [
rfem.structure_core.Node(
no=no,
type=rfem.structure_core.Node.TYPE_ON_MEMBER,
on_member_reference_member=BEAM_RESTRAINED,
distance_from_start_absolute=distance,
)
for no, distance in ((5, SPAN / 4), (6, SPAN / 2), (7, 3 * SPAN / 4))
]
return [
rfem.structure_core.Material(no=1, name="S235"),
rfem.structure_core.CrossSection(no=1, name="IPE 300", material=1),
rfem.structure_core.Node(no=1, coordinate_1=0.0, coordinate_2=0.0),
rfem.structure_core.Node(no=2, coordinate_1=SPAN, coordinate_2=0.0),
rfem.structure_core.Node(no=3, coordinate_1=0.0, coordinate_2=3.0),
rfem.structure_core.Node(no=4, coordinate_1=SPAN, coordinate_2=3.0),
rfem.structure_core.Line(no=1, definition_nodes=[1, 2]),
rfem.structure_core.Line(no=2, definition_nodes=[3, 4]),
rfem.structure_core.Member(no=BEAM_RESTRAINED, line=1, cross_section_start=1),
rfem.structure_core.Member(no=BEAM_UNRESTRAINED, line=2, cross_section_start=1),
*quarter_points,
# Fork supports at the beam ends: supported in all directions (hinged at one end,
# sliding at the other) and restrained against torsion
rfem.types_for_nodes.NodalSupport(
no=1,
user_defined_name_enabled=True,
name="Fork support, hinged",
nodes=[1, 3],
spring=common.Vector3d(x=inf, y=inf, z=inf),
rotational_restraint=common.Vector3d(x=inf, y=0, z=0),
),
rfem.types_for_nodes.NodalSupport(
no=2,
user_defined_name_enabled=True,
name="Fork support, sliding",
nodes=[2, 4],
spring=common.Vector3d(x=0, y=inf, z=inf),
rotational_restraint=common.Vector3d(x=inf, y=0, z=0),
),
]
def define_loading() -> list:
# Equal and opposite moments about the global Y-axis at the beam ends produce a
# uniform bending moment M_y along both beams.
return [
rfem.loading.StaticAnalysisSettings(no=1),
rfem.loading.LoadCase(
no=1,
name="Design load",
static_analysis_settings=1,
self_weight_active=False,
),
rfem.loading.DesignSituation(
no=1,
design_situation_type=rfem.loading.DesignSituation.DESIGN_SITUATION_TYPE_STR_PERMANENT_AND_TRANSIENT_6_10,
),
rfem.loading.LoadCombination(
no=1,
name="Design load",
design_situation=1,
static_analysis_settings=1,
combination_rule_str="LC1",
),
rfem.loads.NodalLoad(
no=1,
load_case=1,
nodes=[1, 3],
load_type=rfem.loads.NodalLoad.LOAD_TYPE_MOMENT,
load_direction=rfem.loads.NodalLoad.LOAD_DIRECTION_GLOBAL_Y_OR_USER_DEFINED_V_TRUE_LENGTH,
moment_magnitude=M_ED,
),
rfem.loads.NodalLoad(
no=2,
load_case=1,
nodes=[2, 4],
load_type=rfem.loads.NodalLoad.LOAD_TYPE_MOMENT,
load_direction=rfem.loads.NodalLoad.LOAD_DIRECTION_GLOBAL_Y_OR_USER_DEFINED_V_TRUE_LENGTH,
moment_magnitude=-M_ED,
),
]
def define_steel_design() -> list:
fork = rfem.steel_design.SteelBoundaryConditions.NodalSupportsRow.SUPPORT_TYPE_FIXED_IN_Y_AND_TORSION
def nodal_support(no: int, node: int):
# One row per node: a row that lists several nodes is stored with the first one only
return rfem.steel_design.SteelBoundaryConditions.NodalSupportsRow(no=no, nodes=[node], support_type=fork)
return [
rfem.steel_design_objects.SteelDesignUlsConfiguration(
no=1,
assigned_to_all_members=True,
),
# Boundary conditions assign the 2D general method acc. to 6.3.4 to a member.
# Beam 1: fork supports at both ends and at the intermediate nodes (quarter points)
rfem.steel_design.SteelBoundaryConditions(
no=1,
user_defined_name_enabled=True,
name="Fork supports at the quarter points",
members=[BEAM_RESTRAINED],
definition_type=rfem.steel_design.SteelBoundaryConditions.DEFINITION_TYPE_2D,
intermediate_nodes=True,
nodal_supports=rfem.steel_design.SteelBoundaryConditions.NodalSupportsTable(
rows=[nodal_support(i + 1, node) for i, node in enumerate([1, 5, 6, 7, 2])],
),
),
# Beam 2: fork supports at both ends only (the default rows)
rfem.steel_design.SteelBoundaryConditions(
no=2,
user_defined_name_enabled=True,
name="Fork supports at the ends",
members=[BEAM_UNRESTRAINED],
definition_type=rfem.steel_design.SteelBoundaryConditions.DEFINITION_TYPE_2D,
),
]
# -------------------------------------------------------
# MAIN SCRIPT
# -------------------------------------------------------
with rfem.Application() as rfem_app:
rfem_app.create_model(name="steel_design_boundary_conditions")
base_data = rfem_app.get_base_data()
base_data.addons.steel_design_active = True
base_data.standards.steel_design_standard = rfem.BaseData.Standards.STEEL_DESIGN_NATIONAL_ANNEX_AND_EDITION_EN_1993_CEN_2015_06_STANDARD
rfem_app.set_base_data(base_data=base_data)
rfem_app.delete_all_objects()
rfem_app.create_object_list(
objs=
define_structure() +
define_loading() +
define_steel_design()
)
calculation_info = rfem_app.calculate_all(skip_warnings=True)
if not calculation_info.succeeded:
raise RuntimeError(f"Calculation failed: {calculation_info.message}")
# The nodal supports of the boundary conditions as RFEM stores them
for no in (1, 2):
boundary_conditions = rfem_app.get_object(rfem.steel_design.SteelBoundaryConditions(no=no))
nodes = [list(row.nodes) for row in boundary_conditions.nodal_supports.rows]
print(f"Boundary conditions {no} | {boundary_conditions.name} | members {list(boundary_conditions.members)} | nodal supports at nodes {nodes}")
# Design ratios of both beams: SP4100.03 cross-section resistance (identical),
# ST4100.01 general method acc. to 6.3.4
design_ratios_df = rfem_app.get_results(
results_type=rfem.results.STEEL_DESIGN_MEMBERS_DESIGN_RATIOS_BY_MEMBER,
).data
print("\nDesign ratios:")
print(design_ratios_df[["member_no", "design_check_type", "design_ratio", "design_check_description"]].to_string(index=False))
for member_no, segment_length in ((BEAM_RESTRAINED, SPAN / 4), (BEAM_UNRESTRAINED, SPAN)):
check = design_ratios_df[
(design_ratios_df["member_no"] == member_no) & (design_ratios_df["design_check_type"] == "ST4100.01")
].iloc[0]
details_df = rfem_app.get_results(
results_type=rfem.results.STEEL_DESIGN_DESIGN_CHECK_DETAILS,
filters=[
rfem.results.ResultsFilter(
column_id="design_check_details_id",
filter_expression=str(check["design_check_details_id"]),
)
],
).data
def value(key: str) -> float:
return float(details_df.loc[details_df["key"] == key, "value_si"].values[0])
rfem_values = {
"m_cr": value("alpha_cr_op") * M_ED / 1e3,
"alpha_cr_op": value("alpha_cr_op"),
"alpha_ult_k": value("alpha_ult_k"),
"lambda_op": value("lambdaand_773_op"),
"phi_lt": value("phi_lt"),
"chi_lt": value("chi_op"),
"eta": float(check["design_ratio"]),
}
print(f"\nBeam {member_no} | segments of {segment_length:.1f} m | comparison with the hand calculation:")
print(f"{'Quantity':<52}{'RFEM':>10}{'Hand calc.':>12}{'Deviation':>11}")
for key, (ref_value, unit, caption) in hand_calculation(segment_length).items():
deviation = (rfem_values[key] - ref_value) / ref_value * 100
print(f"{caption + ' [' + unit + ']':<52}{rfem_values[key]:>10.3f}{ref_value:>12.3f}{deviation:>10.1f}%")
using System.Globalization;
using Google.Protobuf;
using Microsoft.Data.Analysis;
using Common = Dlubal.Api.Common;
using Rfem = Dlubal.Api.Rfem;
// -------------------------------------------------------
// This example demonstrates the boundary conditions of the Steel Design add-on, which
// define the supports of a member for the 2D general method acc. to EN 1993-1-1, 6.3.4
// (CEN, recommended values), and their effect on lateral-torsional buckling.
//
// Two identical simply supported beams carry the same uniform bending moment. Both have
// fork supports at their ends. Beam 1 is in addition held laterally and against torsion
// at the quarter points, by intermediate nodal supports of its boundary conditions only:
// the structural model has no supports there, so the internal forces of both beams are
// the same and the design ratios differ only because of the boundary conditions.
//
// Beams:
// IPE 300, S235, span L = 8.0 m, uniform moment M_Ed = 55 kNm (equal and opposite end
// moments), no axial force.
//
// Reference:
// Hand calculation acc. to EN 1993-1-1, 6.3.4 and 6.3.2.3. Under a uniform moment every
// segment between two fork supports buckles like a simply supported beam of its own
// length, so the elastic critical moment of both beams follows exactly from
// M_cr = pi^2 E I_z / L^2 * sqrt(I_w / I_z + L^2 G I_t / (pi^2 E I_z)) (C1 = 1),
// with L = 2.0 m for beam 1 and L = 8.0 m for beam 2. The section properties are those
// of the IPE 300 in the RFEM cross-section library.
// -------------------------------------------------------
const double SPAN = 8.0; // m
const double M_ED = 55e3; // Nm, uniform design moment
const int BEAM_RESTRAINED = 1; // held at the quarter points by its boundary conditions
const int BEAM_UNRESTRAINED = 2; // fork supports at its ends only
// -------------------------------------------------------
// Hand calculation acc. to EN 1993-1-1
// -------------------------------------------------------
const double E = 210000e6, G = 80769.2e6; // Pa
const double F_Y = 235e6; // Pa
const double GAMMA_M1 = 1.0;
const double I_Z = 604.0e-8; // m4, IPE 300
const double I_T = 19.90e-8; // m4
const double I_W = 126000e-12; // m6
const double W_PL_Y = 628.51e-6; // m3
// Returns the general method acc. to 6.3.4 for a beam under uniform moment whose
// segments between fork supports have the given length.
static List<(string Key, double Value, string Unit, string Caption)> HandCalculation(double segmentLength)
{
// Elastic critical moment of a segment with fork supports at both ends, C1 = 1
double mCr = Math.PI * Math.PI * E * I_Z / (segmentLength * segmentLength)
* Math.Sqrt(I_W / I_Z + segmentLength * segmentLength * G * I_T / (Math.PI * Math.PI * E * I_Z));
double alphaUltK = W_PL_Y * F_Y / M_ED; // 6.3.4(2), class 1 section, plastic resistance
double alphaCrOp = mCr / M_ED;
double lambdaOp = Math.Sqrt(alphaUltK / alphaCrOp); // Eq. (6.64)
// chi_op = chi_LT acc. to 6.3.2.3 for rolled sections: h/b = 2 -> buckling curve b
const double alphaLt = 0.34, lambdaLt0 = 0.4, beta = 0.75;
double phiLt = 0.5 * (1 + alphaLt * (lambdaOp - lambdaLt0) + beta * lambdaOp * lambdaOp);
double chiLt = Math.Min(Math.Min(1 / (phiLt + Math.Sqrt(phiLt * phiLt - beta * lambdaOp * lambdaOp)), 1.0), 1 / (lambdaOp * lambdaOp));
// Results of the hand calculation: key -> (value, unit, caption)
return new List<(string Key, double Value, string Unit, string Caption)>
{
("m_cr", mCr / 1e3, "kNm", "Elastic critical moment M_cr = alpha_cr,op M_Ed"),
("alpha_cr_op", alphaCrOp, "-", "Load amplifier alpha_cr,op"),
("alpha_ult_k", alphaUltK, "-", "Load amplifier alpha_ult,k"),
("lambda_op", lambdaOp, "-", "Slenderness lambda_op, Eq. (6.64)"),
("phi_lt", phiLt, "-", "Phi_LT, 6.3.2.3"),
("chi_lt", chiLt, "-", "Reduction factor chi_op = chi_LT"),
("eta", GAMMA_M1 / (chiLt * alphaUltK), "-", "Design ratio, Eq. (6.63)"),
};
}
static List<IMessage> DefineStructure()
{
var objects = new List<IMessage>
{
new Rfem.StructureCore.Material { No = 1, Name = "S235" },
new Rfem.StructureCore.CrossSection { No = 1, Name = "IPE 300", Material = 1 },
// Beam 1 along y = 0, beam 2 along y = 3 m
new Rfem.StructureCore.Node { No = 1, Coordinate1 = 0.0, Coordinate2 = 0.0 },
new Rfem.StructureCore.Node { No = 2, Coordinate1 = SPAN, Coordinate2 = 0.0 },
new Rfem.StructureCore.Node { No = 3, Coordinate1 = 0.0, Coordinate2 = 3.0 },
new Rfem.StructureCore.Node { No = 4, Coordinate1 = SPAN, Coordinate2 = 3.0 },
new Rfem.StructureCore.Line { No = 1, DefinitionNodes = { 1, 2 } },
new Rfem.StructureCore.Line { No = 2, DefinitionNodes = { 3, 4 } },
new Rfem.StructureCore.Member { No = BEAM_RESTRAINED, Line = 1, CrossSectionStart = 1 },
new Rfem.StructureCore.Member { No = BEAM_UNRESTRAINED, Line = 2, CrossSectionStart = 1 },
};
// Nodes on beam 1 at its quarter points
foreach (var (no, distance) in new[] { (5, SPAN / 4), (6, SPAN / 2), (7, 3 * SPAN / 4) })
{
objects.Add(new Rfem.StructureCore.Node
{
No = no,
Type = Rfem.StructureCore.Node.Types.Type.OnMember,
OnMemberReferenceMember = BEAM_RESTRAINED,
DistanceFromStartAbsolute = distance,
});
}
// Fork supports at the beam ends: supported in all directions (hinged at one end,
// sliding at the other) and restrained against torsion
objects.Add(new Rfem.TypesForNodes.NodalSupport
{
No = 1,
UserDefinedNameEnabled = true,
Name = "Fork support, hinged",
Nodes = { 1, 3 },
SpringX = double.PositiveInfinity,
SpringY = double.PositiveInfinity,
SpringZ = double.PositiveInfinity,
RotationalRestraintX = double.PositiveInfinity,
RotationalRestraintY = 0,
RotationalRestraintZ = 0,
});
objects.Add(new Rfem.TypesForNodes.NodalSupport
{
No = 2,
UserDefinedNameEnabled = true,
Name = "Fork support, sliding",
Nodes = { 2, 4 },
SpringX = 0,
SpringY = double.PositiveInfinity,
SpringZ = double.PositiveInfinity,
RotationalRestraintX = double.PositiveInfinity,
RotationalRestraintY = 0,
RotationalRestraintZ = 0,
});
return objects;
}
static List<IMessage> DefineLoading()
{
// Equal and opposite moments about the global Y-axis at the beam ends produce a
// uniform bending moment M_y along both beams.
return new List<IMessage>
{
new Rfem.Loading.StaticAnalysisSettings { No = 1 },
new Rfem.Loading.LoadCase
{
No = 1,
Name = "Design load",
StaticAnalysisSettings = 1,
SelfWeightActive = false,
},
new Rfem.Loading.DesignSituation
{
No = 1,
DesignSituationType = Rfem.Loading.DesignSituation.Types.DesignSituationType.StrPermanentAndTransient610,
},
new Rfem.Loading.LoadCombination
{
No = 1,
Name = "Design load",
DesignSituation = 1,
StaticAnalysisSettings = 1,
CombinationRuleStr = "LC1",
},
new Rfem.Loads.NodalLoad
{
No = 1,
LoadCase = 1,
Nodes = { 1, 3 },
LoadType = Rfem.Loads.NodalLoad.Types.LoadType.Moment,
LoadDirection = Rfem.Loads.NodalLoad.Types.LoadDirection.GlobalYOrUserDefinedVTrueLength,
MomentMagnitude = M_ED,
},
new Rfem.Loads.NodalLoad
{
No = 2,
LoadCase = 1,
Nodes = { 2, 4 },
LoadType = Rfem.Loads.NodalLoad.Types.LoadType.Moment,
LoadDirection = Rfem.Loads.NodalLoad.Types.LoadDirection.GlobalYOrUserDefinedVTrueLength,
MomentMagnitude = -M_ED,
},
};
}
static List<IMessage> DefineSteelDesign()
{
// Beam 1: fork supports at both ends and at the intermediate nodes (quarter points).
// One row per node: a row that lists several nodes is stored with the first one only.
var quarterPoints = new Rfem.SteelDesign.SteelBoundaryConditions.Types.NodalSupportsTable();
int rowNo = 1;
foreach (int node in new[] { 1, 5, 6, 7, 2 })
{
quarterPoints.Rows.Add(new Rfem.SteelDesign.SteelBoundaryConditions.Types.NodalSupportsRow
{
No = rowNo++,
Nodes = { node },
SupportType = Rfem.SteelDesign.SteelBoundaryConditions.Types.NodalSupportsRow.Types.SupportType.FixedInYAndTorsion,
});
}
return new List<IMessage>
{
new Rfem.SteelDesignObjects.SteelDesignUlsConfiguration
{
No = 1,
AssignedToAllMembers = true,
},
// Boundary conditions assign the 2D general method acc. to 6.3.4 to a member
new Rfem.SteelDesign.SteelBoundaryConditions
{
No = 1,
UserDefinedNameEnabled = true,
Name = "Fork supports at the quarter points",
Members = { BEAM_RESTRAINED },
DefinitionType = Rfem.SteelDesign.SteelBoundaryConditions.Types.DefinitionType._2D,
IntermediateNodes = true,
NodalSupports = quarterPoints,
},
// Beam 2: fork supports at both ends only (the default rows)
new Rfem.SteelDesign.SteelBoundaryConditions
{
No = 2,
UserDefinedNameEnabled = true,
Name = "Fork supports at the ends",
Members = { BEAM_UNRESTRAINED },
DefinitionType = Rfem.SteelDesign.SteelBoundaryConditions.Types.DefinitionType._2D,
},
};
}
static double ToDouble(object? cell) => Convert.ToDouble(cell, CultureInfo.InvariantCulture);
static string ToText(object? cell) => cell?.ToString() ?? string.Empty;
// -------------------------------------------------------
// MAIN SCRIPT
// -------------------------------------------------------
ApplicationRfem? rfemApp = null;
try
{
rfemApp = new ApplicationRfem();
ApplicationRfem app = rfemApp;
app.create_model(name: "steel_design_boundary_conditions");
var baseData = app.get_base_data();
baseData.Addons.SteelDesignActive = true;
baseData.Standards.SteelDesignStandard = Rfem.BaseData.Types.Standards.Types.SteelDesignStandard.SteelDesignNationalAnnexAndEditionEn1993Cen201506Standard;
app.set_base_data(baseData: baseData);
app.delete_all_objects();
app.create_object_list(
DefineStructure()
.Concat(DefineLoading())
.Concat(DefineSteelDesign())
.ToList()
);
var calculationInfo = app.calculate_all(skipWarnings: true);
if (!calculationInfo.Succeeded)
{
throw new InvalidOperationException($"Calculation failed: {calculationInfo.Message}");
}
// The nodal supports of the boundary conditions as RFEM stores them
foreach (int no in new[] { 1, 2 })
{
var boundaryConditions = app.get_object<Rfem.SteelDesign.SteelBoundaryConditions>(
new Rfem.SteelDesign.SteelBoundaryConditions { No = no }
);
string nodes = string.Join(", ", boundaryConditions.NodalSupports.Rows.Select(row => $"[{string.Join(", ", row.Nodes)}]"));
Console.WriteLine($"Boundary conditions {no} | {boundaryConditions.Name} | members [{string.Join(", ", boundaryConditions.Members)}] | nodal supports at nodes [{nodes}]");
}
// Design ratios of both beams: SP4100.03 cross-section resistance (identical),
// ST4100.01 general method acc. to 6.3.4
DataFrame designRatios = app.get_results(
resultsType: Rfem.Results.ResultsType.SteelDesignMembersDesignRatiosByMember
).Data;
Console.WriteLine("\nDesign ratios:");
foreach (var row in designRatios.Rows)
{
Console.WriteLine(string.Format(CultureInfo.InvariantCulture, "{0,10}{1,18}{2,14:F6} {3}",
row["member_no"], row["design_check_type"], ToDouble(row["design_ratio"]), row["design_check_description"]));
}
foreach (var (memberNo, segmentLength) in new[] { (BEAM_RESTRAINED, SPAN / 4), (BEAM_UNRESTRAINED, SPAN) })
{
var check = designRatios.Rows.First(row => ToText(row["member_no"]) == memberNo.ToString(CultureInfo.InvariantCulture)
&& ToText(row["design_check_type"]) == "ST4100.01");
DataFrame details = app.get_results(
resultsType: Rfem.Results.ResultsType.SteelDesignDesignCheckDetails,
filters: new List<Rfem.Results.ResultsFilter>
{
new Rfem.Results.ResultsFilter { ColumnId = "design_check_details_id", FilterExpression = ToText(check["design_check_details_id"]) },
}
).Data;
double Value(string key) => ToDouble(details.Rows.First(row => ToText(row["key"]) == key)["value_si"]);
var rfemValues = new Dictionary<string, double>
{
["m_cr"] = Value("alpha_cr_op") * M_ED / 1e3,
["alpha_cr_op"] = Value("alpha_cr_op"),
["alpha_ult_k"] = Value("alpha_ult_k"),
["lambda_op"] = Value("lambdaand_773_op"),
["phi_lt"] = Value("phi_lt"),
["chi_lt"] = Value("chi_op"),
["eta"] = ToDouble(check["design_ratio"]),
};
Console.WriteLine(string.Format(CultureInfo.InvariantCulture,
"\nBeam {0} | segments of {1:F1} m | comparison with the hand calculation:", memberNo, segmentLength));
Console.WriteLine($"{"Quantity",-52}{"RFEM",10}{"Hand calc.",12}{"Deviation",11}");
foreach (var (key, refValue, unit, caption) in HandCalculation(segmentLength))
{
double deviation = (rfemValues[key] - refValue) / refValue * 100;
Console.WriteLine(string.Format(CultureInfo.InvariantCulture,
"{0,-52}{1,10:F3}{2,12:F3}{3,10:F1}%", $"{caption} [{unit}]", rfemValues[key], refValue, deviation));
}
}
}
catch (Exception ex)
{
Console.WriteLine($"Error: {ex.Message}");
}
finally
{
if (rfemApp != null) rfemApp.close_connection();
}