Skip to content

Commit

Permalink
torsion constant and polar area moment misunderstanding fix (issue 38)
Browse files Browse the repository at this point in the history
  • Loading branch information
epsi1on committed Apr 29, 2020
1 parent bfe3942 commit 9de5042
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ public static _1DCrossSectionGeometricProperties Calculate(PointYZ[] points,bool
buf.Qy = 0;
buf.Qz = 0;
}

buf.J = buf.Iy + buf.Iz;//we assume torsion constant equal to polar area moment, but this is only right for
}

return buf;
Expand All @@ -107,6 +109,7 @@ public static _1DCrossSectionGeometricProperties Calculate(PointYZ[] points,bool
private double _az;
private double _iy;
private double _iz;
private double _j;
private double _qy;
private double _qz;
private double _iyz;
Expand Down Expand Up @@ -189,7 +192,7 @@ public double Iz
/// </value>
/// <remarks>
/// /
/// Iy= | Z . dA
/// Qy= | Z . dA
/// /A
/// </remarks>
public double Qy
Expand All @@ -206,7 +209,7 @@ public double Qy
/// </value>
/// <remarks>
/// /
/// Iz= | Y . dA
/// Qz= | Y . dA
/// /A
/// </remarks>
public double Qz
Expand All @@ -223,10 +226,10 @@ public double Qz
/// </value>
/// <remarks>
/// / /
/// J= | ρ². dA = | (y²+z²).dA = <see cref="Iy"/> + <see cref="Iz"/>
/// Jx = | ρ². dA = | (y²+z²).dA = <see cref="Iy"/> + <see cref="Iz"/>
/// /A /A
/// </remarks>
public double J
public double Jx
{
get { return _iy + _iz; }
}
Expand All @@ -247,5 +250,21 @@ public double Iyz
get { return _iyz; }
set { _iyz = value; }
}


/// <summary>
/// Gets the torsional constant.
/// </summary>
/// <value>
/// Torsion Constant which is involved in the relationship between angle of twist and applied torque
/// </value>
/// <remarks>
/// Note that polar moment of area is not same as torsional constant J. have a look at issue #38 in github or https://en.wikipedia.org/wiki/Torsion_constant#cite_note-1
/// </remarks>
public double J
{
get { return _j; }
set { _j = value; }
}
}
}
41 changes: 40 additions & 1 deletion BriefFiniteElementNet/Sections/UniformGeometric1DSection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,17 @@ public class UniformGeometric1DSection : Base1DSection
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
info.AddValue("_geometry", _geometry);
info.AddValue("_jOverride", _jOverride);
info.AddValue("_resetCentroid", _resetCentroid);

base.GetObjectData(info, context);
}

protected UniformGeometric1DSection(SerializationInfo info, StreamingContext context) : base(info, context)
{
_geometry = (PointYZ[])info.GetValue("_geometry", typeof(PointYZ[]));
_jOverride = (double)info.GetValue("_jOverride", typeof(double));
_resetCentroid = (bool)info.GetValue("_resetCentroid", typeof(bool));
}

public UniformGeometric1DSection()
Expand All @@ -38,6 +42,12 @@ public UniformGeometric1DSection(PointYZ[] geometry)
_geometry = geometry;
}

public UniformGeometric1DSection(PointYZ[] geometry,double jOverride)
{
_geometry = geometry;
_jOverride = jOverride;
}

PointYZ[] _geometry;

/// <summary>
Expand Down Expand Up @@ -70,11 +80,40 @@ public bool ResetCentroid
}
}

/// <summary>
/// Gets or sets the overrided value for torsion constant J.
/// </summary>
/// <remarks>
/// As there is no (simple) analytic solution to find torsion constant for non circular sections, this should be manually set.
/// If <see cref="JOverride"/> is set to positive value, then value is used in torsion stiffness matrix.
/// if <see cref="JOverride"/> is set to zero (by default) or negative value, then polar moment of area is used in torsion stiffness matrix.
/// </remarks>
public double JOverride
{
get
{
return _jOverride;
}

set
{
_jOverride = value;
}
}

private bool _resetCentroid = true;
private double _jOverride;

public override _1DCrossSectionGeometricProperties GetCrossSectionPropertiesAt(double xi)
{
return _1DCrossSectionGeometricProperties.Calculate(this.Geometry,this._resetCentroid);
var buf = _1DCrossSectionGeometricProperties.Calculate(this.Geometry, this._resetCentroid);

if (_jOverride > 0)
buf.J = _jOverride;
else
buf.J = buf.Jx;

return buf;
}


Expand Down
20 changes: 11 additions & 9 deletions BriefFiniteElementNet/Sections/UniformParametric1DSection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public override void GetObjectData(SerializationInfo info, StreamingContext cont
info.AddValue("_iz", _iz);
info.AddValue("_ay", _ay);
info.AddValue("_az", _az);
info.AddValue("_j", _j);

base.GetObjectData(info, context);

Expand All @@ -36,6 +37,7 @@ protected UniformParametric1DSection(SerializationInfo info, StreamingContext co
_iz = info.GetDouble("_iz");
_ay = info.GetDouble("_ay");
_az = info.GetDouble("_az");
_j = info.GetDouble("_j");
}

public UniformParametric1DSection()
Expand All @@ -49,12 +51,12 @@ public UniformParametric1DSection()
/// <param name="iy">The Second Moment of Area of section regard to Z axis.</param>
/// <param name="iz">The Second Moment of Area of section regard to Y axis.</param>
/// <param name="j">The polar moment of inertial.</param>\
[Obsolete("param J not being used. use UniformParametric1DSection(double a, double iy, double iz) instead")]
public UniformParametric1DSection(double a, double iy, double iz, double j)
{
_a = a;
_iy = iy;
_iz = iz;
_j = j;
}

/// <summary>
Expand Down Expand Up @@ -84,6 +86,7 @@ public UniformParametric1DSection(double a)
private double _az;
private double _iy;
private double _iz;
private double _j;

/// <summary>
/// Gets or sets a.
Expand Down Expand Up @@ -156,23 +159,20 @@ public double Iz
}

/// <summary>
/// Gets the polar moment of inertia (J).
/// Gets the torsional constant.
/// </summary>
/// <value>
/// The polar moment of inertial.
/// Torsion Constant which is involved in the relationship between angle of twist and applied torque
/// </value>
/// <remarks>
/// this is read only property, to change it set either <see cref="Iy"/> or <see cref="Iz"/> as J=Iy+Iz
/// / /
/// J= | ρ². dA = | (y²+z²).dA = <see cref="Iy"/> + <see cref="Iz"/>
/// /A /A
/// Note that polar moment of area is not same as torsional constant J. have a look at issue #38 in github or https://en.wikipedia.org/wiki/Torsion_constant#cite_note-1
/// </remarks>
public double J
{
get { return _iy + _iz; }
get { return _j; }
set { _j = value; }
}


public override _1DCrossSectionGeometricProperties GetCrossSectionPropertiesAt(double xi)
{
var buf = new _1DCrossSectionGeometricProperties();
Expand All @@ -182,6 +182,8 @@ public override _1DCrossSectionGeometricProperties GetCrossSectionPropertiesAt(d
buf.Az = this._az;
buf.Iy = this._iy;
buf.Iz = this._iz;
buf.J = this.J;


return buf;
}
Expand Down

0 comments on commit 9de5042

Please sign in to comment.