/// <summary> /// This method calculates the equivalent mass matrix to be used in Finite Element Analysis. /// </summary> /// <param name="beam"></param> /// <param name="degreesOfFreedom"></param> /// <returns>The equivalent mass matrix.</returns> public async override Task <double[, ]> CalculateMass(BeamWithPiezoelectric <TProfile> beam, uint degreesOfFreedom) { double[,] mass = await this.CalculateStructureMass(beam, degreesOfFreedom).ConfigureAwait(false); uint matrixSize = degreesOfFreedom + beam.PiezoelectricDegreesOfFreedom; double[,] equivalentMass = new double[matrixSize, matrixSize]; for (uint i = 0; i < matrixSize; i++) { for (uint j = 0; j < matrixSize; j++) { if (i < degreesOfFreedom && j < degreesOfFreedom) { equivalentMass[i, j] = mass[i, j]; } else { equivalentMass[i, j] = 0; } } } return(equivalentMass); }
/// <summary> /// This method calculates the stiffness matrix of beam with piezoelectric plates. /// </summary> /// <param name="beam"></param> /// <param name="degreesOfFreedom"></param> /// <returns>The structure stiffness matrix.</returns> public async Task <double[, ]> CalculateStructureStiffness(BeamWithPiezoelectric <TProfile> beam, uint degreesOfFreedom) { double[,] stiffness = new double[degreesOfFreedom, degreesOfFreedom]; for (uint n = 0; n < beam.NumberOfElements; n++) { double elementLength = beam.Length / beam.NumberOfElements; double[,] piezoelectricElementStiffness = new double[Constant.DegreesOfFreedomElement, Constant.DegreesOfFreedomElement]; double[,] beamElementStiffness = await base.CalculateElementStiffness(beam.GeometricProperty.MomentOfInertia[n], beam.Material.YoungModulus, elementLength).ConfigureAwait(false); if (beam.ElementsWithPiezoelectric.Contains(n + 1)) { piezoelectricElementStiffness = await this.CalculatePiezoelectricElementStiffness(beam.ElasticityConstant, beam.PiezoelectricGeometricProperty.MomentOfInertia[n], elementLength).ConfigureAwait(false); } for (uint i = 2 * n; i < 2 * n + Constant.DegreesOfFreedomElement; i++) { for (uint j = 2 * n; j < 2 * n + Constant.DegreesOfFreedomElement; j++) { stiffness[i, j] += beamElementStiffness[i - 2 * n, j - 2 * n] + piezoelectricElementStiffness[i - 2 * n, j - 2 * n]; } } } return(stiffness); }
/// <summary> /// This method calculates the mass matrix of beam with piezoelectric plates. /// </summary> /// <param name="beam"></param> /// <param name="degreesOfFreedom"></param> /// <returns>The structure mass matrix.</returns> public async Task <double[, ]> CalculateStructureMass(BeamWithPiezoelectric <TProfile> beam, uint degreesOfFreedom) { double[,] mass = new double[degreesOfFreedom, degreesOfFreedom]; for (uint n = 0; n < beam.NumberOfElements; n++) { double elementLength = beam.Length / beam.NumberOfElements; double[,] elementBeamMass = await base.CalculateElementMass(beam.GeometricProperty.Area[n], beam.Material.SpecificMass, elementLength).ConfigureAwait(false); double[,] elementPiezoelectricMass = new double[Constant.DegreesOfFreedomElement, Constant.DegreesOfFreedomElement]; if (beam.ElementsWithPiezoelectric.Contains(n + 1)) { elementPiezoelectricMass = await base.CalculateElementMass(beam.PiezoelectricGeometricProperty.Area[n], beam.PiezoelectricSpecificMass, elementLength).ConfigureAwait(false); } for (uint i = 2 * n; i < 2 * n + Constant.DegreesOfFreedomElement; i++) { for (uint j = 2 * n; j < 2 * n + Constant.DegreesOfFreedomElement; j++) { mass[i, j] += elementPiezoelectricMass[i - 2 * n, j - 2 * n] + elementBeamMass[i - 2 * n, j - 2 * n]; } } } return(mass); }
/// <summary> /// This method calculates the element piezoelectric capacitance matrix. /// </summary> /// <param name="beam"></param> /// <param name="elementIndex"></param> /// <returns>The elementary piezoelectric capacitance matrix.</returns> public override Task <double[, ]> CalculateElementPiezoelectricCapacitance(BeamWithPiezoelectric <RectangularProfile> beam, uint elementIndex) { double elementLength = beam.Length / beam.NumberOfElements; double constant = -beam.DielectricConstant * beam.PiezoelectricGeometricProperty.Area[elementIndex] * elementLength / Math.Pow(beam.PiezoelectricProfile.Height, 2); double[,] piezoelectricCapacitance = new double[Constant.PiezoelectricDegreesOfFreedomElement, Constant.PiezoelectricDegreesOfFreedomElement]; piezoelectricCapacitance[0, 0] = constant; piezoelectricCapacitance[0, 1] = -constant; piezoelectricCapacitance[1, 0] = -constant; piezoelectricCapacitance[1, 1] = constant; return(Task.FromResult(piezoelectricCapacitance)); }
/// <summary> /// This method builds the boundary condition matrix and the number of true boundary conditions. /// </summary> /// <param name="beam"></param> /// <param name="degreesOfFreedom"></param> /// <returns>The boundary conditions matrix and the number of true boundary conditions.</returns> public async override Task <(bool[], uint)> CalculateBoundaryConditions(BeamWithPiezoelectric <TProfile> beam, uint degreesOfFreedom) { uint piezoelectricDegreesOfFreedom = beam.NumberOfElements + 1; // Creates the general boundary conditions vector with the piezoelectric all boundary conditions true. (bool[] boundaryCondition, uint numberOfTrueBoundaryConditions) = await base.CalculateBoundaryConditions(beam, degreesOfFreedom + piezoelectricDegreesOfFreedom).ConfigureAwait(false); // Sets the correct piezoelectric boundary conditions. foreach (KeyValuePair <uint, FasteningType> fastening in beam.Fastenings) { boundaryCondition[degreesOfFreedom + fastening.Key] = fastening.Value.AlowLinearDisplacement; if (fastening.Value.AlowLinearDisplacement == false) { numberOfTrueBoundaryConditions -= 1; } } return(boundaryCondition, numberOfTrueBoundaryConditions); }
/// <summary> /// This method calculates the equivalent stiffness matrix. /// </summary> /// <param name="beam"></param> /// <param name="degreesOfFreedom"></param> /// <returns>The equivalent stiffness matrix.</returns> public async override Task <double[, ]> CalculateStiffness(BeamWithPiezoelectric <TProfile> beam, uint degreesOfFreedom) { double[,] stiffness = await this.CalculateStructureStiffness(beam, degreesOfFreedom).ConfigureAwait(false); double[,] piezoelectricElectromechanicalCoupling = await this.CalculatePiezoelectricElectromechanicalCoupling(beam, degreesOfFreedom).ConfigureAwait(false); double[,] piezoelectricElectromechanicalCouplingTransposed = await piezoelectricElectromechanicalCoupling.TransposeMatrixAsync().ConfigureAwait(false); double[,] piezoelectricCapacitance = await this.CalculatePiezoelectricCapacitance(beam).ConfigureAwait(false); uint matrixSize = degreesOfFreedom + beam.PiezoelectricDegreesOfFreedom; double[,] equivalentStiffness = new double[matrixSize, matrixSize]; for (uint i = 0; i < matrixSize; i++) { for (uint j = 0; j < matrixSize; j++) { if (i < degreesOfFreedom && j < degreesOfFreedom) { equivalentStiffness[i, j] = stiffness[i, j]; } else if (i < degreesOfFreedom && j >= degreesOfFreedom) { equivalentStiffness[i, j] = piezoelectricElectromechanicalCoupling[i, j - degreesOfFreedom]; } else if (i >= degreesOfFreedom && j < degreesOfFreedom) { equivalentStiffness[i, j] = piezoelectricElectromechanicalCouplingTransposed[i - degreesOfFreedom, j]; } else if (i >= degreesOfFreedom && j >= degreesOfFreedom) { equivalentStiffness[i, j] = piezoelectricCapacitance[i - degreesOfFreedom, j - degreesOfFreedom]; } } } return(equivalentStiffness); }
/// <summary> /// This method calculates the piezoelectric capacitance matrix of beam with piezoelectric plates. /// </summary> /// <param name="beam"></param> /// <returns>The structure piezoelectric capacitance matrix.</returns> public async Task <double[, ]> CalculatePiezoelectricCapacitance(BeamWithPiezoelectric <TProfile> beam) { double[,] piezoelectricCapacitance = new double[beam.PiezoelectricDegreesOfFreedom, beam.PiezoelectricDegreesOfFreedom]; for (uint n = 0; n < beam.NumberOfElements; n++) { double[,] piezoelectricElementCapacitance = new double[Constant.PiezoelectricDegreesOfFreedomElement, Constant.PiezoelectricDegreesOfFreedomElement]; if (beam.ElementsWithPiezoelectric.Contains(n + 1)) { piezoelectricElementCapacitance = await this.CalculateElementPiezoelectricCapacitance(beam, elementIndex : n).ConfigureAwait(false); } for (uint i = n; i < n + Constant.PiezoelectricDegreesOfFreedomElement; i++) { for (uint j = n; j < n + Constant.PiezoelectricDegreesOfFreedomElement; j++) { piezoelectricCapacitance[i, j] += piezoelectricElementCapacitance[i - n, j - n]; } } } return(piezoelectricCapacitance); }
/// <summary> /// This method calculates the electromechanical coupling matrix of an element of beam with piezoelectric plates. /// </summary> /// <param name="beam"></param> /// <returns>The element's electromechanical coupling matrix.</returns> public override Task <double[, ]> CalculatePiezoelectricElementElectromechanicalCoupling(BeamWithPiezoelectric <RectangularProfile> beam) { double elementLength = beam.Length / beam.NumberOfElements; double[,] electromechanicalCoupling = new double[Constant.DegreesOfFreedomElement, Constant.PiezoelectricDegreesOfFreedomElement]; double constant = -(beam.DielectricPermissiveness * beam.PiezoelectricProfile.Width * elementLength / 2) * (2 * beam.Profile.Height + beam.PiezoelectricProfile.Height); electromechanicalCoupling[0, 0] = 0; electromechanicalCoupling[0, 1] = 0; electromechanicalCoupling[1, 0] = constant; electromechanicalCoupling[1, 1] = -constant; electromechanicalCoupling[2, 0] = 0; electromechanicalCoupling[2, 1] = 0; electromechanicalCoupling[3, 0] = -constant; electromechanicalCoupling[3, 1] = constant; //double constant = -(beam.DielectricPermissiveness * beam.PiezoelectricProfile.Width * elementLength / 2) * (2 * beam.Profile.Height * beam.PiezoelectricProfile.Height + Math.Pow(beam.PiezoelectricProfile.Height, 2)); //electromechanicalCoupling[0, 0] = 0; //electromechanicalCoupling[0, 1] = 0; //electromechanicalCoupling[1, 0] = -elementLength * constant; //electromechanicalCoupling[1, 1] = elementLength * constant; //electromechanicalCoupling[2, 0] = 0; //electromechanicalCoupling[2, 1] = elementLength * constant; //electromechanicalCoupling[3, 0] = elementLength * constant; //electromechanicalCoupling[3, 1] = -elementLength * constant; return(Task.FromResult(electromechanicalCoupling)); }
public RectangularBeamWithPiezoelectricMainMatrixTest() { this._numberOfPiezoelectricsPerElement = 2; // Area and Moment of Inertia to piezoelectric were calculate manualy. this._piezoelectricArea = this._numberOfPiezoelectricsPerElement * 6.675E-6; this._piezoelectricMomentOfInertia = 3.5701411E-11; this._precision = 1e-6; this._arrayOperation = new ArrayOperation(); this._operation = new RectangularBeamWithPiezoelectricMainMatrix(this._arrayOperation); this._elementLength = 0.5; this._beamWithPiezoelectric = new BeamWithPiezoelectric <RectangularProfile> { DielectricConstant = 7.33e-9, DielectricPermissiveness = 30.705, ElasticityConstant = 1.076e11, ElectricalCharge = new double[numberOfPiezoelectrics] { 0 }, ElementsWithPiezoelectric = new uint[numberOfPiezoelectrics] { 2 }, FirstFastening = new Pinned(), Forces = new double[degreesFreedomMaximum] { 0, 0, 100, 0, 0, 0 }, GeometricProperty = new GeometricProperty { // Beam profile: height = 3e-3, width = 25e-3. Area = new double[numberOfElements] { 7.5E-05, 7.5E-05 }, MomentOfInertia = new double[numberOfElements] { 5.625E-11, 5.625E-11 } }, LastFastening = new Pinned(), Length = this._elementLength * numberOfElements, Material = new Steel4130(), NumberOfElements = numberOfElements, NumberOfPiezoelectricPerElements = 2, PiezoelectricConstant = 190e-12, PiezoelectricGeometricProperty = new GeometricProperty { // Piezoelectric profile: height = 0.267e-3, width = 25e-3. Area = new double[numberOfElements] { 0, this._piezoelectricArea }, MomentOfInertia = new double[numberOfElements] { 0, this._piezoelectricMomentOfInertia } }, PiezoelectricProfile = new RectangularProfile { Height = 0.267e-3, Width = 25e-3 }, PiezoelectricSpecificMass = 7650, Profile = new RectangularProfile { Height = 3e-3, Width = 25e-3 }, PiezoelectricYoungModulus = 63e9 }; this._piezoelectricElementMassMatrix = new double[Constant.DegreesFreedomElement, Constant.DegreesFreedomElement] { { 0.018967, 0.001337, 0.006565, -0.000790 }, { 0.001337, 0.000122, 0.000790, -0.000091 }, { 0.006565, 0.000790, 0.018967, -0.001337 }, { -0.000790, -0.000091, -0.001337, 0.000122 } }; this._massMatrix = new double[degreesFreedomMaximum, degreesFreedomMaximum] { { 0.109339, 0.007710, 0.037848, -0.004556, 0.000000, 0.000000 }, { 0.007710, 0.000701, 0.004556, -0.000526, 0.000000, 0.000000 }, { 0.037848, 0.004556, 0.237645, 0.001337, 0.044414, -0.005346 }, { -0.004556, -0.000526, 0.001337, 0.001523, 0.005346, -0.000617 }, { 0.000000, 0.000000, 0.044414, 0.005346, 0.128306, -0.009047 }, { 0.000000, 0.000000, -0.005346, -0.000617, -0.009047, 0.000822 } }; this._piezoelectricElementStiffnessMatrix = new double[Constant.DegreesFreedomElement, Constant.DegreesFreedomElement] { { 368.781296, 92.195324, -368.781296, 92.195324 }, { 92.195324, 30.731775, -92.195324, 15.365887 }, { -368.781296, -92.195324, 368.781296, -92.195324 }, { 92.195324, 15.365887, -92.195324, 30.731775 } }; this._stiffnessMatrix = new double[degreesFreedomMaximum, degreesFreedomMaximum] { { 1080.000000, 270.000000, -1080.000000, 270.000000, 0.000000, 0.000000 }, { 270.000000, 90.000000, -270.000000, 45.000000, 0.000000, 0.000000 }, { -1080.000000, -270.000000, 2528.781296, 92.195324, -1448.781296, 362.195324 }, { 270.000000, 45.000000, 92.195324, 210.731775, -362.195324, 60.365887 }, { 0.000000, 0.000000, -1448.781296, -362.195324, 1448.781296, -362.195324 }, { 0.000000, 0.000000, 362.195324, 60.365887, -362.195324, 120.731775 } }; this._piezoelectricElementElectromechanicalCouplingMatrix = new double[Constant.DegreesFreedomElement, Constant.PiezoelectricDegreesFreedomElement] { { 0, 0 }, { 1.60557e-07, -1.60557e-07 }, { 0, -1.60557e-07 }, { -1.60557e-07, 1.60557e-07 } }; this._piezoelectricElectromechanicalCouplingMatrix = new double[degreesFreedomMaximum, piezoelectricDegreesFreedomMaximum] { { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 1.60557e-07, -1.60557e-07 }, { 0, 0, -1.60557e-07 }, { 0, -1.60557e-07, 1.60557e-07 } }; this._elementPiezoelectricCapacitanceMatrix = new double[Constant.PiezoelectricDegreesFreedomElement, Constant.PiezoelectricDegreesFreedomElement] { { -6.8633e-07, 6.8633e-07 }, { 6.8633e-07, -6.8633e-07 } }; this._piezoelectricCapacitanceMatrix = new double[piezoelectricDegreesFreedomMaximum, piezoelectricDegreesFreedomMaximum] { { 0, 0, 0 }, { 0, -6.8633e-07, 6.8633e-07 }, { 0, 6.8633e-07, -6.8633e-07 } }; this._equivalentMassMatrix = new double[degreesFreedomMaximum + piezoelectricDegreesFreedomMaximum, degreesFreedomMaximum + piezoelectricDegreesFreedomMaximum] { { 0.109339, 0.00770982, 0.0378482, -0.0045558, 0, 0, 0, 0, 0 }, { 0.00770982, 0.000700893, 0.0045558, -0.00052567, 0, 0, 0, 0, 0 }, { 0.0378482, 0.0045558, 0.237645, 0.00133738, 0.0444136, -0.00534608, 0, 0, 0 }, { -0.0045558, -0.00052567, 0.00133738, 0.00152337, 0.00534608, -0.000616855, 0, 0, 0 }, { 0, 0, 0.0444136, 0.00534608, 0.128306, -0.00904721, 0, 0, 0 }, { 0, 0, -0.00534608, -0.000616855, -0.00904721, 0.000822473, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0 } }; this._equivalentStiffnessMatrix = new double[degreesFreedomMaximum + piezoelectricDegreesFreedomMaximum, degreesFreedomMaximum + piezoelectricDegreesFreedomMaximum] { { 1080, 270, -1080, 270, 0, 0, 0, 0, 0 }, { 270, 90, -270, 45, 0, 0, 0, 0, 0 }, { -1080, -270, 2528.78, 92.1953, -1448.78, 362.195, 0, 0, 0 }, { 270, 45, 92.1953, 210.732, -362.195, 60.3659, 0, 1.60557e-07, -1.60557e-07 }, { 0, 0, -1448.78, -362.195, 1448.78, -362.195, 0, 0, -1.60557e-07 }, { 0, 0, 362.195, 60.3659, -362.195, 120.732, 0, -1.60557e-07, 1.60557e-07 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 1.60557e-07, 0, -1.60557e-07, 0, -6.8633e-07, 6.8633e-07 }, { 0, 0, 0, -1.60557e-07, -1.60557e-07, 1.60557e-07, 0, 6.8633e-07, -6.8633e-07 } }; this._damping = new double[degreesFreedomMaximum + piezoelectricDegreesFreedomMaximum, degreesFreedomMaximum + piezoelectricDegreesFreedomMaximum] { { 0.00108, 0.00027, -0.00108, 0.00027, 0, 0, 0, 0, 0 }, { 0.00027, 9e-05, -0.00027, 4.5e-05, 0, 0, 0, 0, 0 }, { -0.00108, -0.00027, 0.00252878, 9.21953e-05, -0.00144878, 0.000362195, 0, 0, 0 }, { 0.00027, 4.5e-05, 9.21953e-05, 0.000210732, -0.000362195, 6.03659e-05, 0, 1.60557e-13, -1.60557e-13 }, { 0, 0, -0.00144878, -0.000362195, 0.00144878, -0.000362195, 0, 0, -1.60557e-13 }, { 0, 0, 0.000362195, 6.03659e-05, -0.000362195, 0.000120732, 0, -1.60557e-13, 1.60557e-13 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 1.60557e-13, 0, -1.60557e-13, 0, -6.8633e-13, 6.8633e-13 }, { 0, 0, 0, -1.60557e-13, -1.60557e-13, 1.60557e-13, 0, 6.8633e-13, -6.8633e-13 } }; this._piezoelectricBoundaryConditions = new bool[degreesFreedomMaximum / 2] { false, true, true }; }
/// <summary> /// This method calculates the beam's force matrix. /// </summary> /// <param name="beam"></param> /// <returns>The structure force matrix.</returns> public override Task <double[]> CalculateForce(BeamWithPiezoelectric <TProfile> beam) => Task.FromResult(beam.Forces.CombineVectors(beam.ElectricalCharge));
/// <summary> /// This method calculates the electromechanical coupling matrix of an element of beam with piezoelectric plates. /// This method is not implemented. /// </summary> /// <param name="beam"></param> /// <returns>The element's electromechanical coupling matrix.</returns> public override Task <double[, ]> CalculatePiezoelectricElementElectromechanicalCoupling(BeamWithPiezoelectric <CircularProfile> beam) { throw new NotImplementedException(); }
/// <summary> /// This method calculates the element piezoelectric capacitance matrix. /// </summary> /// <param name="beam"></param> /// <param name="elementIndex"></param> /// <returns>The elementary piezoelectric capacitance matrix.</returns> public abstract Task <double[, ]> CalculateElementPiezoelectricCapacitance(BeamWithPiezoelectric <TProfile> beam, uint elementIndex);
/// <summary> /// This method calculates electromechanical coupling matrix of beam with piezoelectric plates. /// </summary> /// <param name="beam"></param> /// <param name="degreesOfFreedom"></param> /// <returns>The structure piezoelectric electromechanical coupling matrix.</returns> public async Task <double[, ]> CalculatePiezoelectricElectromechanicalCoupling(BeamWithPiezoelectric <TProfile> beam, uint degreesOfFreedom) { double[,] piezoelectricElectromechanicalCoupling = new double[degreesOfFreedom, beam.PiezoelectricDegreesOfFreedom]; for (uint n = 0; n < beam.NumberOfElements; n++) { double[,] piezoelectricElementElectromechanicalCoupling = new double[Constant.DegreesOfFreedomElement, Constant.PiezoelectricDegreesOfFreedomElement]; if (beam.ElementsWithPiezoelectric.Contains(n + 1)) { piezoelectricElementElectromechanicalCoupling = await this.CalculatePiezoelectricElementElectromechanicalCoupling(beam).ConfigureAwait(false); } for (uint i = 2 * n; i < 2 * n + Constant.DegreesOfFreedomElement; i++) { for (uint j = n; j < n + Constant.PiezoelectricDegreesOfFreedomElement; j++) { piezoelectricElectromechanicalCoupling[i, j] += piezoelectricElementElectromechanicalCoupling[i - 2 * n, j - n]; } } } return(piezoelectricElectromechanicalCoupling); }
/// <summary> /// This method calculates the electromechanical coupling matrix of an element of beam with piezoelectric plates. /// </summary> /// <param name="beam"></param> /// <returns>The element's electromechanical coupling matrix.</returns> public abstract Task <double[, ]> CalculatePiezoelectricElementElectromechanicalCoupling(BeamWithPiezoelectric <TProfile> beam);
/// <summary> /// This method creates a new instance of class <see cref="BeamWithPiezoelectric{TProfile}"/>. /// This is a step to create the input fot finite element analysis. /// </summary> /// <param name="request"></param> /// <param name="degreesOfFreedom"></param> /// <returns>A new instance of class <see cref="BeamWithPiezoelectric{TProfile}"/>.</returns> public override async Task <BeamWithPiezoelectric <TProfile> > BuildBeam(BeamWithPiezoelectricRequest <TProfile> request, uint degreesOfFreedom) { GeometricProperty geometricProperty = new GeometricProperty(); GeometricProperty piezoelectricGeometricProperty = new GeometricProperty(); uint numberOfPiezoelectricPerElements = PiezoelectricPositionFactory.Create(request.PiezoelectricPosition); uint[] elementsWithPiezoelectric = request.ElementsWithPiezoelectric ?? this.CreateVectorWithAllElements(request.NumberOfElements); // Calculating beam geometric properties. if (request.Profile.Area != null && request.Profile.MomentOfInertia != null) { geometricProperty.Area = await ArrayFactory.CreateVectorAsync(request.Profile.Area.Value, request.NumberOfElements).ConfigureAwait(false); geometricProperty.MomentOfInertia = await ArrayFactory.CreateVectorAsync(request.Profile.MomentOfInertia.Value, request.NumberOfElements).ConfigureAwait(false); } else { geometricProperty.Area = await this._geometricProperty.CalculateArea(request.Profile, request.NumberOfElements).ConfigureAwait(false); geometricProperty.MomentOfInertia = await this._geometricProperty.CalculateMomentOfInertia(request.Profile, request.NumberOfElements).ConfigureAwait(false); } // Calculating piezoelectric geometric properties. if (request.PiezoelectricProfile.Area != null && request.PiezoelectricProfile.MomentOfInertia != null) { double area = request.PiezoelectricProfile.Area.Value * numberOfPiezoelectricPerElements; double momentOfInertia = request.PiezoelectricProfile.MomentOfInertia.Value * numberOfPiezoelectricPerElements; piezoelectricGeometricProperty.Area = await ArrayFactory.CreateVectorAsync(area, request.NumberOfElements, elementsWithPiezoelectric).ConfigureAwait(false); piezoelectricGeometricProperty.MomentOfInertia = await ArrayFactory.CreateVectorAsync(momentOfInertia, request.NumberOfElements, elementsWithPiezoelectric).ConfigureAwait(false); } else { piezoelectricGeometricProperty.Area = await this._geometricProperty.CalculatePiezoelectricArea(request.PiezoelectricProfile, request.NumberOfElements, elementsWithPiezoelectric, numberOfPiezoelectricPerElements).ConfigureAwait(false); piezoelectricGeometricProperty.MomentOfInertia = await this._geometricProperty.CalculatePiezoelectricMomentOfInertia(request.PiezoelectricProfile, request.Profile, request.NumberOfElements, elementsWithPiezoelectric, numberOfPiezoelectricPerElements).ConfigureAwait(false); } var beam = new BeamWithPiezoelectric <TProfile>() { DielectricConstant = request.DielectricConstant, DielectricPermissiveness = request.DielectricPermissiveness, ElasticityConstant = request.ElasticityConstant, ElectricalCharge = new double[request.NumberOfElements + 1], ElementsWithPiezoelectric = elementsWithPiezoelectric, Fastenings = await this._mappingResolver.BuildFastenings(request.Fastenings).ConfigureAwait(false), Forces = await this._mappingResolver.BuildForceVector(request.Forces, degreesOfFreedom).ConfigureAwait(false), GeometricProperty = geometricProperty, Length = request.Length, Material = MaterialFactory.Create(request.Material), NumberOfElements = request.NumberOfElements, NumberOfPiezoelectricPerElements = numberOfPiezoelectricPerElements, PiezoelectricConstant = request.PiezoelectricConstant, PiezoelectricDegreesOfFreedom = request.NumberOfElements + 1, PiezoelectricGeometricProperty = piezoelectricGeometricProperty, PiezoelectricProfile = request.PiezoelectricProfile, PiezoelectricSpecificMass = request.PiezoelectricSpecificMass, PiezoelectricYoungModulus = request.PiezoelectricYoungModulus, Profile = request.Profile }; return(beam); }
public CalculateRectangularBeamWithPiezoelectricVibrationTest() { this._precision = 1e-16; this._beamProfile = new RectangularProfile { Height = 3e-3, Width = 25e-3 }; this._piezoelectricProfile = new RectangularProfile { Height = 0.267e-3, Width = 25e-3 }; this._numberOfPiezoelectricsPerElement = 2; // Area and Moment of Inertia to piezoelectric were calculate manualy. this._piezoelectricArea = this._numberOfPiezoelectricsPerElement * 6.675E-6; this._piezoelectricMomentOfInertia = 3.5701411E-11; this._arrayOperation = new ArrayOperation(); this._auxiliarOperation = new AuxiliarOperation(); this._newmarkMethod = new NewmarkMethod( this._arrayOperation, this._auxiliarOperation); this._mappingResolver = new MappingResolver(); this._profileValidator = new RectangularProfileValidator(); this._calculateGeometricProperty = new GeometricProperty(); this._piezoelectricProfileMapper = new PiezoelectricRectangularProfileMapper( this._arrayOperation, this._calculateGeometricProperty); this._profileMapper = new RectangularProfileMapper( this._arrayOperation, this._calculateGeometricProperty); this._mainMatrix = new RectangularBeamWithPiezoelectricMainMatrix(this._arrayOperation); this._operation = new CalculateRectangularBeamWithPiezoelectricVibration( this._newmarkMethod, this._mappingResolver, this._profileValidator, this._auxiliarOperation, this._profileMapper, this._piezoelectricProfileMapper, this._mainMatrix, this._arrayOperation); this._methodParameter = new NewmarkMethodParameter { InitialTime = 0, PeriodDivision = 100, NumberOfPeriods = 30, InitialAngularFrequency = 0.5 }; this._request = new BeamWithPiezoelectricRequest <RectangularProfile> { Author = "Teste", BeamData = new PiezoelectricRequestData <RectangularProfile> { DielectricConstant = 7.33e-9, DielectricPermissiveness = 30.705, ElasticityConstant = 1.076e11, ElectricalCharges = new List <ElectricalCharge>(), ElementsWithPiezoelectric = new uint[] { 2 }, FirstFastening = "Pinned", Forces = new List <Force> { new Force { NodePosition = 1, Value = 100 } }, LastFastening = "Pinned", Length = elementLength * numberOfElements, Material = "Steel4130", NumberOfElements = numberOfElements, PiezoelectricConstant = 190e-12, PiezoelectricPosition = "Up and down", PiezoelectricProfile = this._piezoelectricProfile, PiezoelectricSpecificMass = 7650, PiezoelectricYoungModulus = 63e9, Profile = this._beamProfile }, MethodParameterData = this._methodParameter }; this._beamWithPiezoelectic = new BeamWithPiezoelectric <RectangularProfile>() { DielectricConstant = 7.33e-9, DielectricPermissiveness = 30.705, ElasticityConstant = 1.076e11, ElectricalCharge = new double[piezoelectricDegreesFreedomMaximum] { 0, 0, 0 }, ElementsWithPiezoelectric = new uint[numberOfElementsWithPiezoelectrics] { 2 }, FirstFastening = new Pinned(), Forces = new double[degreesFreedomMaximum] { 0, 0, 100, 0, 0, 0 }, GeometricProperty = new GeometricProperty { // Beam profile: height = 3e-3, width = 25e-3. Area = new double[numberOfElements] { 7.5E-05, 7.5E-05 }, MomentOfInertia = new double[numberOfElements] { 5.625E-11, 5.625E-11 } }, LastFastening = new Pinned(), Length = elementLength * numberOfElements, Material = new Steel4130(), NumberOfElements = numberOfElements, NumberOfPiezoelectricPerElements = this._numberOfPiezoelectricsPerElement, PiezoelectricConstant = 190e-12, PiezoelectricGeometricProperty = new GeometricProperty { // Piezoelectric profile: height = 0.267e-3, width = 25e-3. Area = new double[numberOfElements] { 0, this._piezoelectricArea }, MomentOfInertia = new double[numberOfElements] { 0, this._piezoelectricMomentOfInertia } }, PiezoelectricProfile = this._piezoelectricProfile, PiezoelectricSpecificMass = 7650, Profile = this._beamProfile, PiezoelectricYoungModulus = 63e9 }; this._equivalentForce = new double[numberOfBoundaryConditionsTrue] { 0, 100, 0, 0, 0, 0 }; this._mass = new double[numberOfBoundaryConditionsTrue, numberOfBoundaryConditionsTrue] { { 0.000700893, 0.0045558, -0.00052567, 0, 0, 0 }, { 0.0045558, 0.237645, 0.00133738, -0.00534608, 0, 0 }, { -0.00052567, 0.00133738, 0.00152337, -0.000616855, 0, 0 }, { 0, -0.00534608, -0.000616855, 0.000822473, 0, 0 }, { 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0 } }; this._stiffness = new double[numberOfBoundaryConditionsTrue, numberOfBoundaryConditionsTrue] { { 90, -270, 45, 0, 0, 0 }, { -270, 2528.78, 92.1953, 362.195, 0, 0 }, { 45, 92.1953, 210.732, 60.3659, 1.60557e-07, -1.60557e-07 }, { 0, 362.195, 60.3659, 120.732, -1.60557e-07, 1.60557e-07 }, { 0, 0, 1.60557e-07, -1.60557e-07, -6.8633e-07, 6.8633e-07 }, { 0, 0, -1.60557e-07, 1.60557e-07, 6.8633e-07, -6.8633e-07 } }; this._damping = new double[numberOfBoundaryConditionsTrue, numberOfBoundaryConditionsTrue] { { 9e-05, -0.00027, 4.5e-05, 0, 0, 0 }, { -0.00027, 0.00252878, 9.21953e-05, 0.000362195, 0, 0 }, { 4.5e-05, 9.21953e-05, 0.000210732, 6.03659e-05, 1.60557e-13, -1.60557e-13 }, { 0, 0.000362195, 6.03659e-05, 0.000120732, -1.60557e-13, 1.60557e-13 }, { 0, 0, 1.60557e-13, -1.60557e-13, -6.8633e-13, 6.8633e-13 }, { 0, 0, -1.60557e-13, 1.60557e-13, 6.8633e-13, -6.8633e-13 } }; this._newmarkMethodInput = new NewmarkMethodInput { Parameter = this._methodParameter, NumberOfTrueBoundaryConditions = numberOfBoundaryConditionsTrue, Force = this._equivalentForce, Mass = this._mass, Stiffness = this._stiffness, Damping = this._damping }; }
/// <summary> /// This method calculates the element piezoelectric capacitance matrix. /// This method is not implemented. /// </summary> /// <param name="beam"></param> /// <param name="elementIndex"></param> /// <returns>The elementary piezoelectric capacitance matrix.</returns> public override Task <double[, ]> CalculateElementPiezoelectricCapacitance(BeamWithPiezoelectric <CircularProfile> beam, uint elementIndex) { throw new NotImplementedException(); }