Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding push capability for orthotropic materials #372

Merged
merged 6 commits into from
May 25, 2020
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 30 additions & 2 deletions Robot_Adapter/Convert/ToRobot/Properties/Material.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
* along with this code. If not, see <https://www.gnu.org/licenses/lgpl-3.0.html>.
*/


using System;
using BH.oM.Physical.Materials;
using BH.oM.Structure.MaterialFragments;
using BH.Engine.Structure;
Expand Down Expand Up @@ -48,10 +50,36 @@ public static void ToRobot(IRobotMaterialData materialData, IMaterialFragment ma
materialData.Kirchoff = isotropic.ShearModulus();
materialData.DumpCoef = isotropic.DampingRatio;
}
else if (material is Timber)
{
Timber timber = material as Timber;
materialData.E = timber.YoungsModulus.X;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested single warning message, replacing the warnings below.:

                     Engine.Reflection.Compute.RecordWarning("Due to limitations in the Material model for orthotropic Timber materials in Robot, the following assumptions have been made when converting the BHoM material to Robot:\n" +
                                                        "- Youngs modulus has been set to the x-component of the vector in the BHoM material.\n" +
                                                        "- Youngs modulus transversal has been set to the average of the y and z-component of the vector in the BHoM material\n" +
                                                        "- The ShearModulus (G) has been set to the average value of all components of the vector in the BHoM material\n" +
                                                        "- The Thermal Expansion Coefficient has been set to the x-component of the vector in the BHoM material\n" +
                                                        "- Poissons Ratio is ignored for timber materials.");

Engine.Reflection.Compute.RecordWarning("Young's modulus in Y and Z axis are ignored due to Robot definition limitation");
materialData.E_Trans = Math.Abs((timber.YoungsModulus.Y+timber.YoungsModulus.Z)/2);
Engine.Reflection.Compute.RecordWarning("Young transverse modulue (timber) is an average between Y and Z axis due to Robot definition limitation");
materialData.RO = timber.Density * Engine.Robot.Query.RobotGravityConstant;
materialData.Kirchoff = timber.ShearModulus.X;//Since shear modulus is expressed as shear stress over shear strain, longitudinal value is used as it is likely used for cross section analysis.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would change this to the average value of the vector in BHoM

Engine.Reflection.Compute.RecordWarning("Shear modulus in Y and Z axis are ignored due to Robot definition limitation");
materialData.LX = timber.ThermalExpansionCoeff.X;//Value in X axis. Longitudinal expansion for bar element is likely of interets.
Engine.Reflection.Compute.RecordWarning("Thermal Expansion Coefficient in Y and Z axis are ignored due to Robot definition limitation");
materialData.NU = timber.PoissonsRatio.X;//Poisson ratio in X axis. Longitudinal defomation under axial loading is likely of interests.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can actually not be set through the UI in robot, so would completely skip setting this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've deleted the PoissonsRatio for Timber material because as you mentioned it is not a component for Robot Timber material. I think thermalExpansionCoeff is steel worth keeping thought?

Engine.Reflection.Compute.RecordWarning("Poisson ratio in Y and Z axis are ignored due to Robot definition limitation");
materialData.DumpCoef = timber.DampingRatio;

}
else
{
Engine.Reflection.Compute.RecordWarning("Robot_Toolkit does currently only suport Isotropic material. No structural properties for material with name " + material.Name + " have been pushed");
return;
IOrthotropic orthotropic = material as IOrthotropic;
materialData.E = orthotropic.YoungsModulus.X;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missed copying in this warning as well:

                Engine.Reflection.Compute.RecordWarning("Robot does not support generic orthotropic materials. Material pushed will be treated as an isotropic material, only taking the x-component of the values into acount.\n" +
                                                        "This means the y and z-components of the vectors for YoungsModulus, ShearModulus, PoissonsRatio and ThermalExpansionCoeff will be ignored.");

Engine.Reflection.Compute.RecordWarning("Young's modulus in Y and Z axis are ignored due to Robot definition limitation");
materialData.NU = orthotropic.PoissonsRatio.X;//Poisson ratio in X axis. Longitudinal defomation under axial loading is likely of interests.
Engine.Reflection.Compute.RecordWarning("Poisson ratio in Y and Z axis are ignored due to Robot definition limitation");
materialData.RO = orthotropic.Density * Engine.Robot.Query.RobotGravityConstant;
materialData.LX = orthotropic.ThermalExpansionCoeff.X;//Value in X axis. Longitudinal expansion for bar element is likely of interets.
Engine.Reflection.Compute.RecordWarning("Thermal Expansion Coefficient in Y and Z axis are ignored due to Robot definition limitation");
materialData.Kirchoff = orthotropic.ShearModulus.X;//Since shear modulus is expressed as shear stress over shear strain, longitudinal value is used as it is likely used for cross section analysis.
materialData.DumpCoef = orthotropic.DampingRatio;
materialData.Type = IRobotMaterialType.I_MT_OTHER;
}
}

Expand Down