Beam Load Duration and Creep#
|
Designing a simply supported glulam floor beam acc. to EN 1995-1-1 with the Swedish National Annex, considering the load duration, the service class and creep:
Keywords:
timber design glulam load duration service class compression perpendicular to grain creep final deflection national annex |
Note
Reference: Swedish Wood - The Glulam Handbook, Volume 3 (2024), Example 1. The bending and compression stresses agree with the reference. The reference divides the compression perpendicular to the grain by the characteristic strength instead of the design strength; the corrected ratio is printed. For shear, the reference uses the reduced shear force and kcr = 0.86, RFEM the support shear force and kcr = 0.67. RFEM does not apply the size factor kh in bending, and its deflections include the shear deformation.
from dlubal.api import rfem, common
from math import inf
import pandas
# -------------------------------------------------------
# This example demonstrates the design of a simply supported glulam floor beam
# acc. to EN 1995-1-1 with the Swedish National Annex (SS-EN 1995-1-1, EKS):
# bending, shear, compression perpendicular to the grain at the supports, the
# instantaneous deflection and the final deflection including creep (k_def).
#
# Reference:
# Swedish Wood - The Glulam Handbook, Volume 3 (Edition 1:2024), Example 1, pp. 81-84.
#
# GL30c 90 x 360 mm, simply supported, span 6.0 m, bearing length 100 mm,
# beam spacing 0.9 m, lateral-torsional buckling prevented by the floor.
# Service class 1, imposed load of medium-term duration (k_mod = 0.8).
# g_k = 0.20 + 0.45 = 0.65 kN/m, q_k = 1.80 kN/m.
# ULS acc. to the Swedish rules (safety class 3): 1.2 G + 1.5 Q = 3.48 kN/m.
# SLS: k_def = 0.6, psi_2 = 0.3.
#
# Expected deviations from the reference:
# - Compression perpendicular to the grain: the reference divides by f_c,90,k = 2.5 MPa
# instead of f_c,90,d = 1.6 MPa (k_mod = 0.8, gamma_M = 1.25); the corrected ratio is 0.32.
# - Shear: the reference uses the shear force reduced at the distance h from the support
# (9.01 kN) and k_cr = 0.86 (3.0 / f_v,k acc. to EKS). RFEM uses the support shear
# force and k_cr = 0.67.
# - Bending: the reference applies the size factor k_h = 1.05, RFEM does not.
# - Deflections: RFEM includes the shear deformation, the reference neglects it and uses
# g_k,2 = 0.5 kN/m in the SLS.
# -------------------------------------------------------
SPAN = 6.0 # m
BEARING_LENGTH = 0.10 # m
G_K = 0.20e3 + 0.45e3 # N/m, self-weight of the beam and the floor
Q_K = 1.80e3 # N/m, imposed load (2.0 kN/m2 x 0.9 m)
PSI_2 = 0.3 # imposed load category A
K_DEF = 0.6 # glulam, service class 1
K_C_90 = 1.75 # glulam, bearing length l <= 400 mm (EN 1995-1-1, 6.1.5(4))
# Results published in the reference: (value, unit, caption)
REFERENCE = {
"sigma_c_90_d": (0.89, "MPa", "Compression perp. stress sigma_c,90,d"),
"eta_c_90": (0.32, "-", "Compression perp. ratio (corrected, see above)"),
"tau_d": (0.42, "MPa", "Shear stress tau (ref.: reduced V = 9.01 kN)"),
"eta_v": (0.22, "-", "Shear ratio"),
"sigma_m_y_d": (8.06, "MPa", "Bending stress sigma_m,d"),
"eta_m": (0.40, "-", "Bending ratio (with k_h = 1.05)"),
"w_inst": (9.1, "mm", "Instantaneous deflection w_inst"),
"w_fin": (11.7, "mm", "Final deflection w_fin"),
}
def define_structure() -> list:
return [
rfem.structure_core.Material(
no=1,
name="GL30c",
),
rfem.structure_core.CrossSection(
no=1,
name="R_M1 90/360",
material=1,
),
rfem.structure_core.Node(no=1),
rfem.structure_core.Node(no=2, coordinate_1=SPAN),
rfem.structure_core.Line(no=1, definition_nodes=[1, 2]),
rfem.structure_core.Member(no=1, line=1, cross_section_start=1),
rfem.types_for_nodes.NodalSupport(
no=1,
nodes=[1],
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,
nodes=[2],
spring=common.Vector3d(x=0, y=inf, z=inf),
rotational_restraint=common.Vector3d(x=inf, y=0, z=0),
),
]
def define_loading() -> list:
# The load duration class of each load case determines k_mod; a load combination
# takes the shortest duration of its load cases (here medium-term, k_mod = 0.8).
#
# Serviceability acc. to the Swedish rules:
# - Characteristic: instantaneous deflection w_inst of G + Q.
# - Quasi-permanent: final deflection w_fin acc. to EN 1995-1-1, 2.3.2.2. RFEM evaluates
# it from a load combination with the creep factors (1 + k_def) and (1 + psi_2 k_def),
# the same factors the combination wizard generates for SS EN 1995-1-1.
return [
rfem.loading.StaticAnalysisSettings(no=1),
rfem.loading.LoadCase(
no=1,
name="Permanent",
static_analysis_settings=1,
self_weight_active=False,
action_category=rfem.loading.LoadCase.ACTION_CATEGORY_PERMANENT_G,
load_duration=rfem.loading.LoadCase.LOAD_DURATION_PERMANENT,
),
rfem.loading.LoadCase(
no=2,
name="Imposed",
static_analysis_settings=1,
action_category=rfem.loading.LoadCase.ACTION_CATEGORY_IMPOSED_LOADS_CATEGORY_A_DOMESTIC_RESIDENTIAL_AREAS_QI_A,
load_duration=rfem.loading.LoadCase.LOAD_DURATION_MEDIUM_TERM,
),
rfem.loading.DesignSituation(
no=1,
design_situation_type=rfem.loading.DesignSituation.DESIGN_SITUATION_TYPE_STR_PERMANENT_AND_TRANSIENT_6_10,
),
rfem.loading.DesignSituation(
no=2,
design_situation_type=rfem.loading.DesignSituation.DESIGN_SITUATION_TYPE_SLS_CHARACTERISTIC,
),
rfem.loading.DesignSituation(
no=3,
design_situation_type=rfem.loading.DesignSituation.DESIGN_SITUATION_TYPE_SLS_QUASI_PERMANENT,
),
rfem.loading.LoadCombination(
no=1,
name="ULS 1.2 G + 1.5 Q",
design_situation=1,
static_analysis_settings=1,
combination_rule_str="1.2*LC1 + 1.5*LC2",
),
rfem.loading.LoadCombination(
no=2,
name="SLS w_inst: G + Q",
design_situation=2,
static_analysis_settings=1,
combination_rule_str="LC1 + LC2",
),
rfem.loading.LoadCombination(
no=3,
name="SLS w_fin: (1 + k_def) G + (1 + psi_2 k_def) Q",
design_situation=3,
static_analysis_settings=1,
combination_rule_str=f"{1 + K_DEF:.2f}*LC1 + {1 + PSI_2 * K_DEF:.2f}*LC2",
),
rfem.loads.MemberLoad(
no=1,
load_case=1,
members=[1],
load_distribution=rfem.loads.MemberLoad.LOAD_DISTRIBUTION_UNIFORM,
magnitude=G_K,
),
rfem.loads.MemberLoad(
no=1,
load_case=2,
members=[1],
load_distribution=rfem.loads.MemberLoad.LOAD_DISTRIBUTION_UNIFORM,
magnitude=Q_K,
),
]
def define_timber_design() -> list:
# The floor boards prevent lateral-torsional buckling, so no effective lengths are
# assigned and RFEM performs the cross-section checks only.
return [
rfem.timber_design_objects.TimberDesignUlsConfiguration(
no=1,
assigned_to_all_members=True,
),
rfem.timber_design_objects.TimberDesignSlsConfiguration(
no=1,
assigned_to_all_members=True,
),
rfem.timber_design.TimberServiceClass(
no=1,
members=[1],
service_class=rfem.timber_design.TimberServiceClass.SERVICE_CLASS_1,
),
# Bearing length and factor k_c,90 for the check of compression perpendicular to the grain
rfem.types_for_members.DesignSupport(
no=1,
type=rfem.types_for_members.DesignSupport.TYPE_TIMBER,
assigned_to_members=[1],
assigned_to_nodes=[1, 2],
support_width_z=BEARING_LENGTH,
timber_factor_of_compression_z=K_C_90,
),
]
def get_check_values(rfem_app: rfem.Application, design_ratios_df: pandas.DataFrame, check_type: str) -> dict:
"""
Returns the full-precision SI values of the section 'Design Check Values' of the governing
design check of the given type as a dictionary {key: value}. Keys that occur more than once
in that section (for example the design strength) keep their last value.
"""
rows = design_ratios_df[design_ratios_df["design_check_type"] == check_type]
governing = rows.loc[rows["design_ratio"].idxmax()]
details_df = rfem_app.get_results(
results_type=rfem.results.TIMBER_DESIGN_DESIGN_CHECK_DETAILS,
filters=[
rfem.results.ResultsFilter(
column_id="design_check_details_id",
filter_expression=str(governing["design_check_details_id"]),
)
],
).data
start = details_df.index[details_df["key"] == "design_check_values"][0]
values = {}
for _, row in details_df.loc[start:].dropna(subset=["key"]).iterrows():
try:
values[row["key"]] = float(row["value_si"])
except ValueError:
pass # group rows and text values
return values
# -------------------------------------------------------
# MAIN SCRIPT
# -------------------------------------------------------
with rfem.Application() as rfem_app:
rfem_app.create_model(name="timber_design_beam_load_duration_creep")
base_data = rfem_app.get_base_data()
base_data.addons.timber_design_active = True
base_data.standards.timber_design_standard = rfem.BaseData.Standards.TIMBER_DESIGN_NATIONAL_ANNEX_AND_EDITION_EN_1995_SS_2018_02_STANDARD
# Timber design requires the combination standard "EN 1990 | Base + Timber". The standard is
# only applied together with its standard group; without the group it is silently ignored.
base_data.standards.combination_wizard_standard_group = rfem.BaseData.Standards.COMBINATION_WIZARD_EN_1990_BASE___TIMBER_STANDARD_GROUP
base_data.standards.combination_wizard_standard = rfem.BaseData.Standards.COMBINATION_WIZARD_NATIONAL_ANNEX_AND_EDITION_EN_1990_BASE_TIMBER_SS_2019_01_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_timber_design()
)
# If the input is incomplete (for example a missing service class), the calculation only
# reports a general message; the plausibility check names the object and the input field.
calculation_info = rfem_app.calculate_all(skip_warnings=True)
if not calculation_info.succeeded:
plausibility = rfem_app.plausibility_check(
type=common.PlausibilityCheckType.PLAUSIBILITY_CHECK_PLAUSIBILITY_CHECK,
skip_warnings=False,
)
raise RuntimeError(f"Calculation failed: {plausibility.message}\n{plausibility.data}")
design_ratios_df = rfem_app.get_results(
results_type=rfem.results.TIMBER_DESIGN_MEMBERS_DESIGN_RATIOS,
).data
summary = design_ratios_df.sort_values("design_ratio", ascending=False).drop_duplicates("design_check_type")
print("\nGoverning design ratios per check type:")
print(summary[["design_check_type", "loading", "design_ratio", "location_x", "design_check_description"]].to_string(index=False))
compression = get_check_values(rfem_app, design_ratios_df, "SP1400.00") # Compression perpendicular to grain at design support
shear = get_check_values(rfem_app, design_ratios_df, "SP3100.00") # Shear in z-axis
bending = get_check_values(rfem_app, design_ratios_df, "SP4100.00") # Bending about y-axis
w_inst = get_check_values(rfem_app, design_ratios_df, "SE1200.01") # Characteristic deflection
w_fin = get_check_values(rfem_app, design_ratios_df, "SE1200.02") # Quasi-permanent deflection
rfem_values = {
"sigma_c_90_d": abs(compression["sigma_c_90_d"]) / 1e6,
"eta_c_90": compression["eta"],
"tau_d": abs(shear["tau_xz"]) / 1e6, # shear stress without k_cr (tau_xz_d includes k_cr)
"eta_v": shear["eta"],
"sigma_m_y_d": abs(bending["sigma_m_y_d"]) / 1e6,
"eta_m": bending["eta"],
"w_inst": w_inst["w_inst_z"] * 1e3,
"w_fin": w_fin["w_fin_z"] * 1e3,
}
print(f"\nk_c,90 = {compression['k_c_90']:.2f}, k_cr = {shear['k_cr']:.2f}, k_mod = {bending['k_mod']:.2f}")
print(f"\n{'Quantity':<50}{'RFEM':>8}{'Reference':>11}")
for key, (ref_value, unit, caption) in REFERENCE.items():
print(f"{caption + ' [' + unit + ']':<50}{rfem_values[key]:>8.2f}{ref_value:>11.2f}")
using System.Globalization;
using Google.Protobuf;
using Microsoft.Data.Analysis;
using Common = Dlubal.Api.Common;
using Rfem = Dlubal.Api.Rfem;
// -------------------------------------------------------
// This example demonstrates the design of a simply supported glulam floor beam
// acc. to EN 1995-1-1 with the Swedish National Annex (SS-EN 1995-1-1, EKS):
// bending, shear, compression perpendicular to the grain at the supports, the
// instantaneous deflection and the final deflection including creep (k_def).
//
// Reference:
// Swedish Wood - The Glulam Handbook, Volume 3 (Edition 1:2024), Example 1, pp. 81-84.
//
// GL30c 90 x 360 mm, simply supported, span 6.0 m, bearing length 100 mm,
// beam spacing 0.9 m, lateral-torsional buckling prevented by the floor.
// Service class 1, imposed load of medium-term duration (k_mod = 0.8).
// g_k = 0.20 + 0.45 = 0.65 kN/m, q_k = 1.80 kN/m.
// ULS acc. to the Swedish rules (safety class 3): 1.2 G + 1.5 Q = 3.48 kN/m.
// SLS: k_def = 0.6, psi_2 = 0.3.
//
// Expected deviations from the reference:
// - Compression perpendicular to the grain: the reference divides by f_c,90,k = 2.5 MPa
// instead of f_c,90,d = 1.6 MPa (k_mod = 0.8, gamma_M = 1.25); the corrected ratio is 0.32.
// - Shear: the reference uses the shear force reduced at the distance h from the support
// (9.01 kN) and k_cr = 0.86 (3.0 / f_v,k acc. to EKS). RFEM uses the support shear
// force and k_cr = 0.67.
// - Bending: the reference applies the size factor k_h = 1.05, RFEM does not.
// - Deflections: RFEM includes the shear deformation, the reference neglects it and uses
// g_k,2 = 0.5 kN/m in the SLS.
// -------------------------------------------------------
const double SPAN = 6.0; // m
const double BEARING_LENGTH = 0.10; // m
const double G_K = 0.20e3 + 0.45e3; // N/m, self-weight of the beam and the floor
const double Q_K = 1.80e3; // N/m, imposed load (2.0 kN/m2 x 0.9 m)
const double PSI_2 = 0.3; // imposed load category A
const double K_DEF = 0.6; // glulam, service class 1
const double K_C_90 = 1.75; // glulam, bearing length l <= 400 mm (EN 1995-1-1, 6.1.5(4))
// Results published in the reference: key -> (value, unit, caption)
var REFERENCE = new List<(string Key, double Value, string Unit, string Caption)>
{
("sigma_c_90_d", 0.89, "MPa", "Compression perp. stress sigma_c,90,d"),
("eta_c_90", 0.32, "-", "Compression perp. ratio (corrected, see above)"),
("tau_d", 0.42, "MPa", "Shear stress tau (ref.: reduced V = 9.01 kN)"),
("eta_v", 0.22, "-", "Shear ratio"),
("sigma_m_y_d", 8.06, "MPa", "Bending stress sigma_m,d"),
("eta_m", 0.40, "-", "Bending ratio (with k_h = 1.05)"),
("w_inst", 9.1, "mm", "Instantaneous deflection w_inst"),
("w_fin", 11.7, "mm", "Final deflection w_fin"),
};
static List<IMessage> DefineStructure()
{
return new List<IMessage>
{
new Rfem.StructureCore.Material
{
No = 1,
Name = "GL30c",
},
new Rfem.StructureCore.CrossSection
{
No = 1,
Name = "R_M1 90/360",
Material = 1,
},
new Rfem.StructureCore.Node { No = 1 },
new Rfem.StructureCore.Node { No = 2, Coordinate1 = SPAN },
new Rfem.StructureCore.Line { No = 1, DefinitionNodes = { 1, 2 } },
new Rfem.StructureCore.Member { No = 1, Line = 1, CrossSectionStart = 1 },
new Rfem.TypesForNodes.NodalSupport
{
No = 1,
Nodes = { 1 },
SpringX = double.PositiveInfinity,
SpringY = double.PositiveInfinity,
SpringZ = double.PositiveInfinity,
RotationalRestraintX = double.PositiveInfinity,
RotationalRestraintY = 0,
RotationalRestraintZ = 0,
},
new Rfem.TypesForNodes.NodalSupport
{
No = 2,
Nodes = { 2 },
SpringX = 0,
SpringY = double.PositiveInfinity,
SpringZ = double.PositiveInfinity,
RotationalRestraintX = double.PositiveInfinity,
RotationalRestraintY = 0,
RotationalRestraintZ = 0,
},
};
}
static List<IMessage> DefineLoading()
{
// The load duration class of each load case determines k_mod; a load combination
// takes the shortest duration of its load cases (here medium-term, k_mod = 0.8).
//
// Serviceability acc. to the Swedish rules:
// - Characteristic: instantaneous deflection w_inst of G + Q.
// - Quasi-permanent: final deflection w_fin acc. to EN 1995-1-1, 2.3.2.2. RFEM evaluates
// it from a load combination with the creep factors (1 + k_def) and (1 + psi_2 k_def),
// the same factors the combination wizard generates for SS EN 1995-1-1.
return new List<IMessage>
{
new Rfem.Loading.StaticAnalysisSettings { No = 1 },
new Rfem.Loading.LoadCase
{
No = 1,
Name = "Permanent",
StaticAnalysisSettings = 1,
SelfWeightActive = false,
ActionCategory = Rfem.Loading.LoadCase.Types.ActionCategory.PermanentG,
LoadDuration = Rfem.Loading.LoadCase.Types.LoadDuration.Permanent,
},
new Rfem.Loading.LoadCase
{
No = 2,
Name = "Imposed",
StaticAnalysisSettings = 1,
ActionCategory = Rfem.Loading.LoadCase.Types.ActionCategory.ImposedLoadsCategoryADomesticResidentialAreasQiA,
LoadDuration = Rfem.Loading.LoadCase.Types.LoadDuration.MediumTerm,
},
new Rfem.Loading.DesignSituation
{
No = 1,
DesignSituationType = Rfem.Loading.DesignSituation.Types.DesignSituationType.StrPermanentAndTransient610,
},
new Rfem.Loading.DesignSituation
{
No = 2,
DesignSituationType = Rfem.Loading.DesignSituation.Types.DesignSituationType.SlsCharacteristic,
},
new Rfem.Loading.DesignSituation
{
No = 3,
DesignSituationType = Rfem.Loading.DesignSituation.Types.DesignSituationType.SlsQuasiPermanent,
},
new Rfem.Loading.LoadCombination
{
No = 1,
Name = "ULS 1.2 G + 1.5 Q",
DesignSituation = 1,
StaticAnalysisSettings = 1,
CombinationRuleStr = "1.2*LC1 + 1.5*LC2",
},
new Rfem.Loading.LoadCombination
{
No = 2,
Name = "SLS w_inst: G + Q",
DesignSituation = 2,
StaticAnalysisSettings = 1,
CombinationRuleStr = "LC1 + LC2",
},
new Rfem.Loading.LoadCombination
{
No = 3,
Name = "SLS w_fin: (1 + k_def) G + (1 + psi_2 k_def) Q",
DesignSituation = 3,
StaticAnalysisSettings = 1,
CombinationRuleStr = string.Format(CultureInfo.InvariantCulture,
"{0:F2}*LC1 + {1:F2}*LC2", 1 + K_DEF, 1 + PSI_2 * K_DEF),
},
new Rfem.Loads.MemberLoad
{
No = 1,
LoadCase = 1,
Members = { 1 },
LoadDistribution = Rfem.Loads.MemberLoad.Types.LoadDistribution.Uniform,
Magnitude = G_K,
},
new Rfem.Loads.MemberLoad
{
No = 1,
LoadCase = 2,
Members = { 1 },
LoadDistribution = Rfem.Loads.MemberLoad.Types.LoadDistribution.Uniform,
Magnitude = Q_K,
},
};
}
static List<IMessage> DefineTimberDesign()
{
// The floor boards prevent lateral-torsional buckling, so no effective lengths are
// assigned and RFEM performs the cross-section checks only.
return new List<IMessage>
{
new Rfem.TimberDesignObjects.TimberDesignUlsConfiguration
{
No = 1,
AssignedToAllMembers = true,
},
new Rfem.TimberDesignObjects.TimberDesignSlsConfiguration
{
No = 1,
AssignedToAllMembers = true,
},
new Rfem.TimberDesign.TimberServiceClass
{
No = 1,
Members = { 1 },
ServiceClass = Rfem.TimberDesign.TimberServiceClass.Types.ServiceClass._1,
},
// Bearing length and factor k_c,90 for the check of compression perpendicular to the grain
new Rfem.TypesForMembers.DesignSupport
{
No = 1,
Type = Rfem.TypesForMembers.DesignSupport.Types.Type.Timber,
AssignedToMembers = { 1 },
AssignedToNodes = { 1, 2 },
SupportWidthZ = BEARING_LENGTH,
TimberFactorOfCompressionZ = K_C_90,
},
};
}
static double ToDouble(object? cell) => Convert.ToDouble(cell, CultureInfo.InvariantCulture);
static string ToText(object? cell) => cell?.ToString() ?? string.Empty;
// Returns the full-precision SI values of the section 'Design Check Values' of the governing
// design check of the given type as a dictionary {key: value}. Keys that occur more than once
// in that section (for example the design strength) keep their last value.
static Dictionary<string, double> GetCheckValues(ApplicationRfem rfemApp, DataFrame designRatios, string checkType)
{
var governing = designRatios.Rows
.Where(row => ToText(row["design_check_type"]) == checkType)
.OrderByDescending(row => ToDouble(row["design_ratio"]))
.First();
Common.Table details = rfemApp.get_results(
resultsType: Rfem.Results.ResultsType.TimberDesignDesignCheckDetails,
filters: new List<Rfem.Results.ResultsFilter>
{
new Rfem.Results.ResultsFilter
{
ColumnId = "design_check_details_id",
FilterExpression = ToText(governing["design_check_details_id"]),
},
}
);
var values = new Dictionary<string, double>();
foreach (var row in details.Data.Rows
.SkipWhile(row => ToText(row["key"]) != "design_check_values")
.Where(row => row["key"] != null))
{
try
{
values[ToText(row["key"])] = ToDouble(row["value_si"]);
}
catch (Exception ex) when (ex is FormatException || ex is InvalidCastException)
{
// group rows and text values
}
}
return values;
}
// -------------------------------------------------------
// MAIN SCRIPT
// -------------------------------------------------------
ApplicationRfem? rfemApp = null;
try
{
rfemApp = new ApplicationRfem();
rfemApp.create_model(name: "timber_design_beam_load_duration_creep");
var baseData = rfemApp.get_base_data();
baseData.Addons.TimberDesignActive = true;
baseData.Standards.TimberDesignStandard = Rfem.BaseData.Types.Standards.Types.TimberDesignStandard.TimberDesignNationalAnnexAndEditionEn1995Ss201802Standard;
// Timber design requires the combination standard "EN 1990 | Base + Timber". The standard is
// only applied together with its standard group; without the group it is silently ignored.
baseData.Standards.CombinationWizardStandardGroup = Rfem.BaseData.Types.Standards.Types.CombinationWizardStandardGroup.CombinationWizardEn1990BaseTimberStandardGroup;
baseData.Standards.CombinationWizardStandard = Rfem.BaseData.Types.Standards.Types.CombinationWizardStandard.CombinationWizardNationalAnnexAndEditionEn1990BaseTimberSs201901Standard;
rfemApp.set_base_data(baseData: baseData);
rfemApp.delete_all_objects();
rfemApp.create_object_list(
DefineStructure()
.Concat(DefineLoading())
.Concat(DefineTimberDesign())
.ToList()
);
// If the input is incomplete (for example a missing service class), the calculation only
// reports a general message; the plausibility check names the object and the input field.
var calculationInfo = rfemApp.calculate_all(skipWarnings: true);
if (!calculationInfo.Succeeded)
{
var plausibility = rfemApp.plausibility_check(
type: Common.PlausibilityCheckType.PlausibilityCheckPlausibilityCheck,
skipWarnings: false
);
throw new Exception($"Calculation failed: {plausibility.Message}\n{plausibility.Data}");
}
Common.Table designRatios = rfemApp.get_results(
resultsType: Rfem.Results.ResultsType.TimberDesignMembersDesignRatios
);
Console.WriteLine("\nGoverning design ratios per check type:");
foreach (var row in designRatios.Data.Rows
.GroupBy(row => ToText(row["design_check_type"]))
.Select(group => group.OrderByDescending(row => ToDouble(row["design_ratio"])).First())
.OrderByDescending(row => ToDouble(row["design_ratio"])))
{
Console.WriteLine(string.Format(CultureInfo.InvariantCulture, "{0,-12}{1,-6}{2,8:F3}{3,8:F3} {4}",
row["design_check_type"], row["loading"], ToDouble(row["design_ratio"]),
ToDouble(row["location_x"]), row["design_check_description"]));
}
var compression = GetCheckValues(rfemApp, designRatios.Data, "SP1400.00"); // Compression perpendicular to grain at design support
var shear = GetCheckValues(rfemApp, designRatios.Data, "SP3100.00"); // Shear in z-axis
var bending = GetCheckValues(rfemApp, designRatios.Data, "SP4100.00"); // Bending about y-axis
var wInst = GetCheckValues(rfemApp, designRatios.Data, "SE1200.01"); // Characteristic deflection
var wFin = GetCheckValues(rfemApp, designRatios.Data, "SE1200.02"); // Quasi-permanent deflection
var rfemValues = new Dictionary<string, double>
{
["sigma_c_90_d"] = Math.Abs(compression["sigma_c_90_d"]) / 1e6,
["eta_c_90"] = compression["eta"],
["tau_d"] = Math.Abs(shear["tau_xz"]) / 1e6, // shear stress without k_cr (tau_xz_d includes k_cr)
["eta_v"] = shear["eta"],
["sigma_m_y_d"] = Math.Abs(bending["sigma_m_y_d"]) / 1e6,
["eta_m"] = bending["eta"],
["w_inst"] = wInst["w_inst_z"] * 1e3,
["w_fin"] = wFin["w_fin_z"] * 1e3,
};
Console.WriteLine(string.Format(CultureInfo.InvariantCulture, "\nk_c,90 = {0:F2}, k_cr = {1:F2}, k_mod = {2:F2}",
compression["k_c_90"], shear["k_cr"], bending["k_mod"]));
Console.WriteLine($"\n{"Quantity",-50}{"RFEM",8}{"Reference",11}");
foreach (var (key, refValue, unit, caption) in REFERENCE)
{
Console.WriteLine(string.Format(CultureInfo.InvariantCulture,
"{0,-50}{1,8:F2}{2,11:F2}", $"{caption} [{unit}]", rfemValues[key], refValue));
}
}
catch (Exception ex)
{
Console.WriteLine($"Error: {ex.Message}");
}
finally
{
if (rfemApp != null) rfemApp.close_connection();
}