public Berechnung(FEModell m) { modell = m; if (modell == null) { throw new BerechnungAusnahme("Modelleingabedaten noch nicht eingelesen"); } // set System Indices var k = 0; foreach (var item in modell.Knoten) { node = item.Value; k = node.SetSystemIndices(k); } SetReferences(m); }
public void SolveEquations() { if (!decomposed) { profileSolver = new ProfillöserStatus( systemEquations.Matrix, systemEquations.Vector, systemEquations.Primal, systemEquations.Dual, systemEquations.Status, systemEquations.Profile); profileSolver.Decompose(); decomposed = true; } profileSolver.Solve(); // ... save system unknowns (primal values) foreach (var item in modell.Knoten) { node = item.Value; var index = node.SystemIndices; node.NodalDof = new double[node.NumberOfNodalDof]; for (var i = 0; i < node.NodalDof.Length; i++) { node.NodalDof[i] = systemEquations.Primal[index[i]]; } } // ... save dual values var reactions = systemEquations.Dual; foreach (var support in modell.Randbedingungen.Select(item => item.Value)) { node = support.Node; var index = node.SystemIndices; var supportReaction = new double[node.NumberOfNodalDof]; for (var i = 0; i < supportReaction.Length; i++) { supportReaction[i] = reactions[index[i]]; } node.Reactions = supportReaction; } modell.Solved = true; }
// 2nd order time integration *********************************************************************************************** public void TimeIntegration2NdOrder() { var dt = modell.Zeitintegration.Dt; if (dt == 0) { throw new BerechnungAusnahme("Zeitschrittintervall nicht definiert"); } var tmax = modell.Zeitintegration.Tmax; var nSteps = (int)(tmax / dt) + 1; var method = modell.Zeitintegration.Method; var parameter1 = modell.Zeitintegration.Parameter1; var parameter2 = modell.Zeitintegration.Parameter2; var anregung = new double[nSteps + 1][]; for (var i = 0; i < (nSteps + 1); i++) { anregung[i] = new double[dimension]; } // ... Compute diagonal mass matrix .............................. if (!diagonalMatrix) { ComputeDiagonalMatrix(); } // ... Compute diagonal damping matrix .............................. // ... if "damping" contains modal damping ratios, the damping matrix // ... may be evaluated by a sum over "n" modes considered C&P p.198, 13-37 // ... M*(SUM(((2*(xi)n*(omega)n )/(M)n))*phi(n)*(phi)nT)*M // ... where M is the mass matrix, (xi)n the modal damping ratio, // ... (omega(n) eigenfrequency, (M)n modal masses and phi the eigenvectors var dampingMatrix = ComputeDampingMatrix(); // ... compute time dependent forcing function and boundary conditions Compute2NdOrderForcingFunction(dt, anregung); var displacement = new double[nSteps][]; for (var k = 0; k < nSteps; k++) { displacement[k] = new double[dimension]; } var velocity = new double[2][]; for (var k = 0; k < 2; k++) { velocity[k] = new double[dimension]; } Set2NdOrderInitialConditions(displacement, velocity); SetDynamicStatusVector(); if (decomposed) { ReComputeSystemMatrix(); decomposed = false; } var timeIntegration = new Zeitintegration2OrdnungStatus(systemEquations, dampingMatrix, dt, method, parameter1, parameter2, displacement, velocity, anregung); timeIntegration.Perform(); // save nodal time histories foreach (var item2 in modell.Knoten) { node = item2.Value; var index = item2.Value.SystemIndices; var ndof = node.NumberOfNodalDof; node.NodalVariables = new double[ndof][]; for (var i = 0; i < ndof; i++) { node.NodalVariables[i] = new double[nSteps]; } node.NodalDerivatives = new double[ndof][]; for (var i = 0; i < ndof; i++) { node.NodalDerivatives[i] = new double[nSteps]; } // displacement[nSteps][index], velocity[2][index], NodalVariables[index][nSteps] for (var i = 0; i < node.NumberOfNodalDof; i++) { if (systemEquations.Status[index[i]]) { continue; } for (var k = 0; k < nSteps; k++) { node.NodalVariables[i][k] = timeIntegration.displacement[k][index[i]]; node.NodalDerivatives[i][k] = timeIntegration.acceleration[k][index[i]]; } } } modell.Timeint = true; _ = MessageBox.Show("Zeitverlaufberechnung 2. Ordnung erfolgreich durchgeführt", "TimeIntegration2ndOrder"); }
// 1st order time integration *********************************************************************************************** public void TimeIntegration1StOrder() { // ... Compute specific heat matrix .............................. if (!diagonalMatrix) { ComputeDiagonalMatrix(); } _ = systemEquations.DiagonalMatrix; var dt = modell.Zeitintegration.Dt; if (dt == 0) { throw new BerechnungAusnahme("Abbruch: Zeitschrittintervall nicht definiert."); } var tmax = modell.Zeitintegration.Tmax; var alfa = modell.Zeitintegration.Parameter1; var nSteps = (int)(tmax / dt) + 1; var forceFunction = new double[nSteps][]; for (var k = 0; k < nSteps; k++) { forceFunction[k] = new double[dimension]; } var temperature = new double[nSteps][]; for (var i = 0; i < nSteps; i++) { temperature[i] = new double[dimension]; } Set1StOrderInitialConditions(temperature); SetInstationaryStatusVector(); // ... compute time dependent forcing function and boundary conditions Compute1StOrderForcingFunction(dt, forceFunction); Compute1StOrderBoundaryConditions(dt, temperature); // ... system matrix needs to be recomputed if it is decomposed if (decomposed) { ReComputeSystemMatrix(); decomposed = false; } var timeIntegration = new Zeitintegration1OrdnungStatus( systemEquations, forceFunction, dt, alfa, temperature); timeIntegration.Perform(); // save nodal time histories foreach (var item in modell.Knoten) { node = item.Value; var index = item.Value.SystemIndices[0]; node.NodalVariables = new double[1][]; node.NodalVariables[0] = new double[nSteps]; node.NodalDerivatives = new double[1][]; node.NodalDerivatives[0] = new double[nSteps]; // temperature[nSteps][index], NodalVariables[index][nSteps] for (var k = 0; k < nSteps; k++) { node.NodalVariables[0][k] = temperature[k][index]; node.NodalDerivatives[0][k] = timeIntegration.Tdot[k][index]; } } modell.Timeint = true; }