Deflection Creep Shrinkage#
|
Checking the long-term deflection of a reinforced concrete slab strip acc. to EN 1992-1-1, 7.4.3, with the direct deformation analysis including creep and shrinkage:
Keywords:
deflection creep shrinkage time-dependent properties cracked section serviceability verification example |
Note
Reference: Dlubal Knowledge Base article 001935, creep coefficient φ = 2.0 and shrinkage strain εcs = -0.5 ‰. The results of RFEM agree with the reference within 1 %.
from dlubal.api import rfem, common
from math import inf, exp, sqrt
import pandas
# -------------------------------------------------------
# This example demonstrates the serviceability check of the long-term deflection of a
# reinforced concrete slab strip acc. to EN 1992-1-1, 7.4.3, with the direct deformation
# analysis of the Concrete Design add-on: cracked and uncracked stiffness, tension
# stiffening (distribution coefficient zeta), creep and shrinkage of the concrete.
#
# Reference:
# Dlubal Knowledge Base article 001935 - Direct Deformation Analysis of Reinforced Concrete
# Beams Considering Long-Term Effects of Creep and Shrinkage (2025).
#
# Simply supported slab strip b/h = 1000/200 mm, span 4.21 m, C20/25, B500A,
# bottom reinforcement 7 bars 9 mm = 4.45 cm2 (d1 = 30 mm), no top reinforcement.
# Quasi-permanent load 6.5 + 0.3 x 2.0 + 1.0 x 1.25 = 8.35 kN/m (M = 18.50 kNm).
# Creep coefficient phi = 2.0, total shrinkage strain eps_cs = -0.5 permille.
# Deflection limit L/250 = 16.8 mm.
#
# Creep and shrinkage are entered in the advanced time-dependent properties of the
# cross-section through the basic values phi_0, eps_cd0 and eps_ca. RFEM evaluates them at
# the age of concrete of the serviceability configuration (50 years by default), so the basic
# values are chosen with the time functions of EN 1992-1-1, Annex B and 3.1.4 such that
# phi(t, t0) = 2.0 and eps_cs(t) = -0.5 permille at that age.
# -------------------------------------------------------
SPAN = 4.21 # m
WIDTH, HEIGHT = 1.0, 0.20 # m
BAR_COUNT, BAR_DIAMETER = 7, 0.009
D1 = 0.030 # m, axis distance of the bottom bars
Q_QP = 8.35e3 # N/m, quasi-permanent load
PHI = 2.0 # creep coefficient at the considered time
EPS_CS = -0.5e-3 # total shrinkage strain at the considered time
# Time functions (EN 1992-1-1, Annex B.1 and 3.1.4) for the default ages of RFEM:
# t_s = 3 days (end of curing), t_0 = 28 days (loading), t = 50 years, RH = 50 %, C20/25.
T_S, T_0, T = 3.0, 28.0, 50 * 365.25 # days
H_0 = 2 * WIDTH * HEIGHT / (2 * (WIDTH + HEIGHT)) * 1e3 # mm, notional size (all faces drying)
BETA_H = min(1.5 * (1 + (0.012 * 50)**18) * H_0 + 250, 1500)
BETA_C = ((T - T_0) / (BETA_H + T - T_0))**0.3 # development of creep
BETA_DS = (T - T_S) / ((T - T_S) + 0.04 * sqrt(H_0**3)) # development of drying shrinkage
K_H = 1.0 - 0.15 * (H_0 - 100) / 100 # Table 3.3, 100 mm < h0 < 200 mm
PHI_0 = PHI / BETA_C
EPS_CD0 = EPS_CS / (K_H * BETA_DS) # autogenous shrinkage set to zero
# Results published in the reference
REFERENCE = {
"x_II": (46.8, "mm", "Depth of compression zone x_II"),
"zeta": (0.757, "-", "Distribution coefficient zeta"),
"u_z": (19.4, "mm", "Long-term deflection u_z"),
"eta": (1.155, "-", "Design ratio u_z / (L/250)"),
}
def define_structure() -> list:
return [
rfem.structure_core.Material(no=1, name="C20/25"),
rfem.structure_core.Material(no=2, name="B500A"),
rfem.structure_core.CrossSection(
no=1,
name=f"R_M1 {WIDTH * 1e3:.0f}/{HEIGHT * 1e3:.0f}",
material=1,
advanced_time_dependent_properties_of_concrete_enabled=True,
creep_enabled=True,
shrinkage_enabled=True,
# Range and resolution of the time functions (not preset when the option is enabled via the API)
function_data_maximum_age_of_concrete=T * 86400, # s (SI unit of time)
function_data_number_of_steps=100,
),
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,
concrete_durability_top=1,
concrete_durability_bottom=1,
concrete_durability_left=1,
concrete_durability_right=1,
concrete_cover_user_defined_enabled=True,
concrete_cover=D1 - BAR_DIAMETER / 2,
concrete_longitudinal_reinforcement_items=rfem.structure_core.Member.ConcreteLongitudinalReinforcementItemsTable(
rows=[
rfem.structure_core.Member.ConcreteLongitudinalReinforcementItemsRow(
rebar_type=rfem.structure_core.Member.ConcreteLongitudinalReinforcementItemsRow.REBAR_TYPE_UNSYMMETRICAL,
material=2,
bar_count_unsymmetrical_top_side=0,
bar_count_unsymmetrical_at_side=0,
bar_count_unsymmetrical_bottom_side=BAR_COUNT,
bar_diameter_unsymmetrical_bottom_side=BAR_DIAMETER,
# Bars placed from the section surface: without this, RFEM places them
# inside an assumed stirrup and the effective depth is 10 mm smaller.
additional_offset_type=rfem.structure_core.Member.ConcreteLongitudinalReinforcementItemsRow.ADDITIONAL_OFFSET_TYPE_FROM_SECTION_SURFACE,
additional_offset_top_side=D1 - BAR_DIAMETER / 2,
additional_offset_bottom_side=D1 - BAR_DIAMETER / 2,
additional_offset_left_side=D1 - BAR_DIAMETER / 2,
additional_offset_right_side=D1 - BAR_DIAMETER / 2,
span_position_definition_format=rfem.structure_core.Member.ConcreteLongitudinalReinforcementItemsRow.SPAN_POSITION_DEFINITION_FORMAT_RELATIVE,
span_start_relative=0.0,
span_end_relative=1.0,
),
]
),
),
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 reference gives the quasi-permanent load directly (self-weight included).
return [
rfem.loading.StaticAnalysisSettings(no=1),
rfem.loading.LoadCase(
no=1,
name="Quasi-permanent load",
static_analysis_settings=1,
self_weight_active=False,
),
rfem.loading.DesignSituation(
no=1,
design_situation_type=rfem.loading.DesignSituation.DESIGN_SITUATION_TYPE_SLS_QUASI_PERMANENT,
),
rfem.loading.LoadCombination(
no=1,
name="Quasi-permanent",
design_situation=1,
static_analysis_settings=1,
combination_rule_str="LC1",
),
rfem.loads.MemberLoad(
no=1,
load_case=1,
members=[1],
load_distribution=rfem.loads.MemberLoad.LOAD_DISTRIBUTION_UNIFORM,
magnitude=Q_QP,
),
]
def define_concrete_design() -> list:
return [
rfem.concrete_design_objects.ConcreteDesignSlsConfiguration(
no=1,
assigned_to_all_members=True,
),
# Closed interior spaces (XC1)
rfem.reinforcement.ConcreteDurability(
no=1,
members=[1],
corrosion_induced_by_carbonation_enabled=True,
corrosion_induced_by_carbonation=rfem.reinforcement.ConcreteDurability.CORROSION_INDUCED_BY_CARBONATION_DRY_OR_PERMANENTLY_WET,
),
# Supports of the deflection check (reference length L = span)
rfem.types_for_members.DesignSupport(
no=1,
type=rfem.types_for_members.DesignSupport.TYPE_CONCRETE,
assigned_to_members=[1],
assigned_to_nodes=[1, 2],
consider_in_deflection_design_z=True,
consider_in_deflection_design_y=False,
),
]
def set_time_dependent_properties(rfem_app: rfem.Application) -> None:
"""
Enters user-defined basic values of creep and shrinkage in the advanced time-dependent
properties of the cross-section. The values of this tree are stored as text in SI units.
"""
cross_section = rfem_app.get_object(rfem.structure_core.CrossSection(no=1))
tree = cross_section.time_dependent_properties
values = {
"user_defined_basic_values": "true",
"phi_0": str(PHI_0),
"epsilon_cd0": str(EPS_CD0),
"epsilon_ca_": "0",
}
def update(rows):
for row in rows:
if row.key in values:
row.value = values[row.key]
update(row.rows)
update(tree.rows)
rfem_app.update_object(
rfem.structure_core.CrossSection(no=1, time_dependent_properties=tree)
)
# Read back the values evaluated by RFEM at the considered age of concrete
cross_section = rfem_app.get_object(rfem.structure_core.CrossSection(no=1))
def find(rows, key):
for row in rows:
if row.key == key:
return row.value
found = find(row.rows, key)
if found is not None:
return found
print(f"phi_0 = {find(cross_section.time_dependent_properties.rows, 'phi_0')}, "
f"eps_cd0 = {find(cross_section.time_dependent_properties.rows, 'epsilon_cd0')}")
print(f"phi(t,t0) = {find(cross_section.time_dependent_properties.rows, 'phi_t_t_0_')}, "
f"eps_cs(t) = {find(cross_section.time_dependent_properties.rows, 'epsilon_cs_t')}")
# -------------------------------------------------------
# MAIN SCRIPT
# -------------------------------------------------------
with rfem.Application() as rfem_app:
rfem_app.create_model(name="concrete_design_deflection_creep_shrinkage")
base_data = rfem_app.get_base_data()
base_data.addons.concrete_design_active = True
base_data.standards.concrete_design_standard = rfem.BaseData.Standards.CONCRETE_DESIGN_NATIONAL_ANNEX_AND_EDITION_EN_1992_CEN_2014_11_STANDARD
rfem_app.set_base_data(base_data=base_data)
rfem_app.delete_all_objects()
rfem_app.create_object_list(
objs=
define_concrete_design() +
define_structure() +
define_loading()
)
set_time_dependent_properties(rfem_app)
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.CONCRETE_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", "design_ratio", "location_x", "design_check_description"]].to_string(index=False))
# Deflection check acc. to 7.4.3(3) at mid-span
check_type = "SE0400.00"
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.CONCRETE_DESIGN_DESIGN_CHECK_DETAILS,
filters=[rfem.results.ResultsFilter(column_id="design_check_details_id", filter_expression=str(governing["design_check_details_id"]))],
).data
def value(key: str) -> float:
return float(details_df.loc[details_df["key"] == key, "value_si"].values[0])
print(f"\n{check_type} | {governing['design_check_description']} | x = {governing['location_x']} m")
print(f"d = {value('d_def_z_bottom') * 1e3:.0f} mm, I_I = {value('i_y_i') * 1e8:.0f} cm4, I_II = {value('i_y_ii') * 1e8:.0f} cm4, "
f"N_sh = {value('n_sh') / 1e3:.2f} kN, kappa_I = {value('kappa_y_i') * 1e3:.1f}, kappa_II = {value('kappa_y_ii') * 1e3:.1f}, "
f"kappa_f = {value('kappa_y_f') * 1e3:.1f} mrad/m")
rfem_values = {
"x_II": value("x_ii") * 1e3,
"zeta": value("zeta_d"),
"u_z": value("u_z") * 1e3,
"eta": value("eta"),
}
print(f"\n{'Quantity':<36}{'RFEM':>9}{'Reference':>11}{'Deviation':>11}")
for key, (ref_value, unit, caption) in REFERENCE.items():
deviation = (rfem_values[key] - ref_value) / ref_value * 100
print(f"{caption + ' [' + unit + ']':<36}{rfem_values[key]:>9.3f}{ref_value:>11.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 serviceability check of the long-term deflection of a
// reinforced concrete slab strip acc. to EN 1992-1-1, 7.4.3, with the direct deformation
// analysis of the Concrete Design add-on: cracked and uncracked stiffness, tension
// stiffening (distribution coefficient zeta), creep and shrinkage of the concrete.
//
// Reference:
// Dlubal Knowledge Base article 001935 - Direct Deformation Analysis of Reinforced Concrete
// Beams Considering Long-Term Effects of Creep and Shrinkage (2025).
//
// Simply supported slab strip b/h = 1000/200 mm, span 4.21 m, C20/25, B500A,
// bottom reinforcement 7 bars 9 mm = 4.45 cm2 (d1 = 30 mm), no top reinforcement.
// Quasi-permanent load 6.5 + 0.3 x 2.0 + 1.0 x 1.25 = 8.35 kN/m (M = 18.50 kNm).
// Creep coefficient phi = 2.0, total shrinkage strain eps_cs = -0.5 permille.
// Deflection limit L/250 = 16.8 mm.
//
// Creep and shrinkage are entered in the advanced time-dependent properties of the
// cross-section through the basic values phi_0, eps_cd0 and eps_ca. RFEM evaluates them at
// the age of concrete of the serviceability configuration (50 years by default), so the basic
// values are chosen with the time functions of EN 1992-1-1, Annex B and 3.1.4 such that
// phi(t, t0) = 2.0 and eps_cs(t) = -0.5 permille at that age.
// -------------------------------------------------------
const double SPAN = 4.21; // m
const double WIDTH = 1.0, HEIGHT = 0.20; // m
const int BAR_COUNT = 7;
const double BAR_DIAMETER = 0.009;
const double D1 = 0.030; // m, axis distance of the bottom bars
const double Q_QP = 8.35e3; // N/m, quasi-permanent load
const double PHI = 2.0; // creep coefficient at the considered time
const double EPS_CS = -0.5e-3; // total shrinkage strain at the considered time
// Time functions (EN 1992-1-1, Annex B.1 and 3.1.4) for the default ages of RFEM:
// t_s = 3 days (end of curing), t_0 = 28 days (loading), t = 50 years, RH = 50 %, C20/25.
const double T_S = 3.0, T_0 = 28.0, T = 50 * 365.25; // days
const double H_0 = 2 * WIDTH * HEIGHT / (2 * (WIDTH + HEIGHT)) * 1e3; // mm, notional size (all faces drying)
double BETA_H = Math.Min(1.5 * (1 + Math.Pow(0.012 * 50, 18)) * H_0 + 250, 1500);
double BETA_C = Math.Pow((T - T_0) / (BETA_H + T - T_0), 0.3); // development of creep
double BETA_DS = (T - T_S) / ((T - T_S) + 0.04 * Math.Sqrt(Math.Pow(H_0, 3))); // development of drying shrinkage
const double K_H = 1.0 - 0.15 * (H_0 - 100) / 100; // Table 3.3, 100 mm < h0 < 200 mm
double PHI_0 = PHI / BETA_C;
double EPS_CD0 = EPS_CS / (K_H * BETA_DS); // autogenous shrinkage set to zero
// Results published in the reference: key -> (value, unit, caption)
var REFERENCE = new List<(string Key, double Value, string Unit, string Caption)>
{
("x_II", 46.8, "mm", "Depth of compression zone x_II"),
("zeta", 0.757, "-", "Distribution coefficient zeta"),
("u_z", 19.4, "mm", "Long-term deflection u_z"),
("eta", 1.155, "-", "Design ratio u_z / (L/250)"),
};
static List<IMessage> DefineStructure()
{
return new List<IMessage>
{
new Rfem.StructureCore.Material { No = 1, Name = "C20/25" },
new Rfem.StructureCore.Material { No = 2, Name = "B500A" },
new Rfem.StructureCore.CrossSection
{
No = 1,
Name = string.Format(CultureInfo.InvariantCulture, "R_M1 {0:F0}/{1:F0}", WIDTH * 1e3, HEIGHT * 1e3),
Material = 1,
AdvancedTimeDependentPropertiesOfConcreteEnabled = true,
CreepEnabled = true,
ShrinkageEnabled = true,
// Range and resolution of the time functions (not preset when the option is enabled via the API)
FunctionDataMaximumAgeOfConcrete = T * 86400, // s (SI unit of time)
FunctionDataNumberOfSteps = 100,
},
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,
ConcreteDurabilityTop = 1,
ConcreteDurabilityBottom = 1,
ConcreteDurabilityLeft = 1,
ConcreteDurabilityRight = 1,
ConcreteCoverUserDefinedEnabled = true,
ConcreteCover = D1 - BAR_DIAMETER / 2,
ConcreteLongitudinalReinforcementItems = new Rfem.StructureCore.Member.Types.ConcreteLongitudinalReinforcementItemsTable
{
Rows =
{
new Rfem.StructureCore.Member.Types.ConcreteLongitudinalReinforcementItemsRow
{
RebarType = Rfem.StructureCore.Member.Types.ConcreteLongitudinalReinforcementItemsRow.Types.RebarType.Unsymmetrical,
Material = 2,
BarCountUnsymmetricalTopSide = 0,
BarCountUnsymmetricalAtSide = 0,
BarCountUnsymmetricalBottomSide = BAR_COUNT,
BarDiameterUnsymmetricalBottomSide = BAR_DIAMETER,
// Bars placed from the section surface: without this, RFEM places them
// inside an assumed stirrup and the effective depth is 10 mm smaller.
AdditionalOffsetType = Rfem.StructureCore.Member.Types.ConcreteLongitudinalReinforcementItemsRow.Types.AdditionalOffsetType.FromSectionSurface,
AdditionalOffsetTopSide = D1 - BAR_DIAMETER / 2,
AdditionalOffsetBottomSide = D1 - BAR_DIAMETER / 2,
AdditionalOffsetLeftSide = D1 - BAR_DIAMETER / 2,
AdditionalOffsetRightSide = D1 - BAR_DIAMETER / 2,
SpanPositionDefinitionFormat = Rfem.StructureCore.Member.Types.ConcreteLongitudinalReinforcementItemsRow.Types.SpanPositionDefinitionFormat.Relative,
SpanStartRelative = 0.0,
SpanEndRelative = 1.0,
},
},
},
},
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 reference gives the quasi-permanent load directly (self-weight included).
return new List<IMessage>
{
new Rfem.Loading.StaticAnalysisSettings { No = 1 },
new Rfem.Loading.LoadCase
{
No = 1,
Name = "Quasi-permanent load",
StaticAnalysisSettings = 1,
SelfWeightActive = false,
},
new Rfem.Loading.DesignSituation
{
No = 1,
DesignSituationType = Rfem.Loading.DesignSituation.Types.DesignSituationType.SlsQuasiPermanent,
},
new Rfem.Loading.LoadCombination
{
No = 1,
Name = "Quasi-permanent",
DesignSituation = 1,
StaticAnalysisSettings = 1,
CombinationRuleStr = "LC1",
},
new Rfem.Loads.MemberLoad
{
No = 1,
LoadCase = 1,
Members = { 1 },
LoadDistribution = Rfem.Loads.MemberLoad.Types.LoadDistribution.Uniform,
Magnitude = Q_QP,
},
};
}
static List<IMessage> DefineConcreteDesign()
{
return new List<IMessage>
{
new Rfem.ConcreteDesignObjects.ConcreteDesignSlsConfiguration
{
No = 1,
AssignedToAllMembers = true,
},
// Closed interior spaces (XC1)
new Rfem.Reinforcement.ConcreteDurability
{
No = 1,
Members = { 1 },
CorrosionInducedByCarbonationEnabled = true,
CorrosionInducedByCarbonation = Rfem.Reinforcement.ConcreteDurability.Types.CorrosionInducedByCarbonation.DryOrPermanentlyWet,
},
// Supports of the deflection check (reference length L = span)
new Rfem.TypesForMembers.DesignSupport
{
No = 1,
Type = Rfem.TypesForMembers.DesignSupport.Types.Type.Concrete,
AssignedToMembers = { 1 },
AssignedToNodes = { 1, 2 },
ConsiderInDeflectionDesignZ = true,
ConsiderInDeflectionDesignY = false,
},
};
}
// Enters user-defined basic values of creep and shrinkage in the advanced time-dependent
// properties of the cross-section. The values of this tree are stored as text in SI units.
void SetTimeDependentProperties(ApplicationRfem rfemApp)
{
var crossSection = rfemApp.get_object<Rfem.StructureCore.CrossSection>(new Rfem.StructureCore.CrossSection { No = 1 });
var tree = crossSection.TimeDependentProperties;
var values = new Dictionary<string, string>
{
["user_defined_basic_values"] = "true",
["phi_0"] = PHI_0.ToString(CultureInfo.InvariantCulture),
["epsilon_cd0"] = EPS_CD0.ToString(CultureInfo.InvariantCulture),
["epsilon_ca_"] = "0",
};
void Update(IEnumerable<Rfem.StructureCore.CrossSection.Types.TimeDependentPropertiesTreeTableRow> rows)
{
foreach (var row in rows)
{
if (values.TryGetValue(row.Key, out string? value))
{
row.Value = value;
}
Update(row.Rows);
}
}
Update(tree.Rows);
rfemApp.update_object(
new Rfem.StructureCore.CrossSection { No = 1, TimeDependentProperties = tree }
);
// Read back the values evaluated by RFEM at the considered age of concrete
crossSection = rfemApp.get_object<Rfem.StructureCore.CrossSection>(new Rfem.StructureCore.CrossSection { No = 1 });
static string? Find(IEnumerable<Rfem.StructureCore.CrossSection.Types.TimeDependentPropertiesTreeTableRow> rows, string key)
{
foreach (var row in rows)
{
if (row.Key == key)
{
return row.Value;
}
string? found = Find(row.Rows, key);
if (found != null)
{
return found;
}
}
return null;
}
Console.WriteLine($"phi_0 = {Find(crossSection.TimeDependentProperties.Rows, "phi_0")}, "
+ $"eps_cd0 = {Find(crossSection.TimeDependentProperties.Rows, "epsilon_cd0")}");
Console.WriteLine($"phi(t,t0) = {Find(crossSection.TimeDependentProperties.Rows, "phi_t_t_0_")}, "
+ $"eps_cs(t) = {Find(crossSection.TimeDependentProperties.Rows, "epsilon_cs_t")}");
}
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();
rfemApp.create_model(name: "concrete_design_deflection_creep_shrinkage");
var baseData = rfemApp.get_base_data();
baseData.Addons.ConcreteDesignActive = true;
baseData.Standards.ConcreteDesignStandard = Rfem.BaseData.Types.Standards.Types.ConcreteDesignStandard.ConcreteDesignNationalAnnexAndEditionEn1992Cen201411Standard;
rfemApp.set_base_data(baseData: baseData);
rfemApp.delete_all_objects();
rfemApp.create_object_list(
DefineConcreteDesign()
.Concat(DefineStructure())
.Concat(DefineLoading())
.ToList()
);
SetTimeDependentProperties(rfemApp);
var calculationInfo = rfemApp.calculate_all(skipWarnings: true);
if (!calculationInfo.Succeeded)
{
var plausibility = rfemApp.plausibility_check(
type: Common.PlausibilityCheckType.PlausibilityCheckPlausibilityCheck,
skipWarnings: false
);
throw new InvalidOperationException($"Calculation failed: {plausibility.Message}\n{plausibility.Data}");
}
DataFrame designRatios = rfemApp.get_results(
resultsType: Rfem.Results.ResultsType.ConcreteDesignMembersDesignRatios
).Data;
Console.WriteLine("\nGoverning design ratios per check type:");
Console.WriteLine($"{"design_check_type",17}{"design_ratio",13}{"location_x",11} {"design_check_description"}");
foreach (var row in designRatios.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,17}{1,13:G6}{2,11:G6} {3}",
row["design_check_type"], ToDouble(row["design_ratio"]), ToDouble(row["location_x"]), row["design_check_description"]));
}
// Deflection check acc. to 7.4.3(3) at mid-span
string checkType = "SE0400.00";
var governing = designRatios.Rows
.Where(row => ToText(row["design_check_type"]) == checkType)
.OrderByDescending(row => ToDouble(row["design_ratio"]))
.First();
DataFrame details = rfemApp.get_results(
resultsType: Rfem.Results.ResultsType.ConcreteDesignDesignCheckDetails,
filters: new List<Rfem.Results.ResultsFilter>
{
new Rfem.Results.ResultsFilter { ColumnId = "design_check_details_id", FilterExpression = ToText(governing["design_check_details_id"]) },
}
).Data;
double Value(string key)
{
return ToDouble(details.Rows.First(row => ToText(row["key"]) == key)["value_si"]);
}
Console.WriteLine(string.Format(CultureInfo.InvariantCulture, "\n{0} | {1} | x = {2} m",
checkType, governing["design_check_description"], governing["location_x"]));
Console.WriteLine(string.Format(CultureInfo.InvariantCulture,
"d = {0:F0} mm, I_I = {1:F0} cm4, I_II = {2:F0} cm4, "
+ "N_sh = {3:F2} kN, kappa_I = {4:F1}, kappa_II = {5:F1}, "
+ "kappa_f = {6:F1} mrad/m",
Value("d_def_z_bottom") * 1e3, Value("i_y_i") * 1e8, Value("i_y_ii") * 1e8,
Value("n_sh") / 1e3, Value("kappa_y_i") * 1e3, Value("kappa_y_ii") * 1e3,
Value("kappa_y_f") * 1e3));
var rfemValues = new Dictionary<string, double>
{
["x_II"] = Value("x_ii") * 1e3,
["zeta"] = Value("zeta_d"),
["u_z"] = Value("u_z") * 1e3,
["eta"] = Value("eta"),
};
Console.WriteLine($"\n{"Quantity",-36}{"RFEM",9}{"Reference",11}{"Deviation",11}");
foreach (var (key, refValue, unit, caption) in REFERENCE)
{
double deviation = (rfemValues[key] - refValue) / refValue * 100;
Console.WriteLine(string.Format(CultureInfo.InvariantCulture,
"{0,-36}{1,9:F3}{2,11: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();
}