private double TransformJacobian(SurfaceIntegrationPoint surfaceIntegrationPoint, RealPoint singularPoint, RealPoint corner1, RealPoint corner2)
        {
            double dL1_dfi1, dL2_dfi1, dL3_dfi1, dL4_dfi1;
            double dL1_dfi2, dL2_dfi2, dL3_dfi2, dL4_dfi2;
            double dv_dfi1, dw_dfi1, dv_dfi2, dw_dfi2;
            double Jacobian_tmp;

            dL1_dfi1 = -0.25 * (1 - surfaceIntegrationPoint.QuadraturePointPosition.w);
            dL2_dfi1 = 0.25 * (1 - surfaceIntegrationPoint.QuadraturePointPosition.w);
            dL3_dfi1 = 0.25 * (1 + surfaceIntegrationPoint.QuadraturePointPosition.w);
            dL4_dfi1 = -0.25 * (1 + surfaceIntegrationPoint.QuadraturePointPosition.w);

            dL1_dfi2 = -0.25 * (1 - surfaceIntegrationPoint.QuadraturePointPosition.v);
            dL2_dfi2 = -0.25 * (1 + surfaceIntegrationPoint.QuadraturePointPosition.v);
            dL3_dfi2 = 0.25 * (1 + surfaceIntegrationPoint.QuadraturePointPosition.v);
            dL4_dfi2 = 0.25 * (1 - surfaceIntegrationPoint.QuadraturePointPosition.v);

            dv_dfi1 = dL1_dfi1 * singularPoint.x + dL2_dfi1 * corner1.x + dL3_dfi1 * corner2.x + dL4_dfi1 * singularPoint.x;
            dw_dfi1 = dL1_dfi1 * singularPoint.y + dL2_dfi1 * corner1.y + dL3_dfi1 * corner2.y + dL4_dfi1 * singularPoint.y;
            dv_dfi2 = dL1_dfi2 * singularPoint.x + dL2_dfi2 * corner1.x + dL3_dfi2 * corner2.x + dL4_dfi2 * singularPoint.x;
            dw_dfi2 = dL1_dfi2 * singularPoint.y + dL2_dfi2 * corner1.y + dL3_dfi2 * corner2.y + dL4_dfi2 * singularPoint.y;

            Jacobian_tmp = dv_dfi1 * dw_dfi2 - dw_dfi1 * dv_dfi2;

            return(Jacobian_tmp);
        }
        public double GetTemperatureFromSurfaceIntegrationPointConstants(SurfaceIntegrationPoint point)
        {
            double result = 0.0;

            int j = 0;

            foreach (var area in this.Areas)
            {
                foreach (var segment in area.Segments)
                {
                    foreach (var collPoint in segment.CollocationPoints)
                    {
                        result += -point.FunctionqConstantValue[j] * segment.TemperatureBoundaryCondition.BoundaryConditionVector[collPoint.Index] + point.FunctionTConstantValue[j] * segment.HeatFluxBoundaryCondition.BoundaryConditionVector[collPoint.Index];
                        j++;
                    }
                }
            }
            int k = 0;

            foreach (var area in this.Areas)
            {
                //To tradycyjnie
                result += InitialCondition.CalculateValue(area, point.RealPosition);

                //To w przypadku przechowywania parametrów
                //foreach (var surface in this.Surfaces)
                //{
                //    foreach (var surfaceIntegrationPoint in surface.SurfaceIntegrationPoints)
                //    {
                //        value += point.InitialConditionConstantValues[k] * surfaceIntegrationPoint.TemperatureValue;
                //        k++;
                //    }
                //}

                if (area.configurationData.addHeatSource)
                {
                    if (area.configurationData.isHeatSourceTimeDependent)
                    {
                        var subAreaIntegrationHelper = new SubAreaIntegrationHelper(4, area.Surfaces.Select(x => x.SurfaceShape).ToList());

                        result += HeatSource.CalculateValue(area, point.RealPosition, subAreaIntegrationHelper);
                    }
                    else
                    {
                        result += point.HeatSourceConstantValue;
                    }
                }
            }

            return(result);
        }
        private double TransformPositionForCollocationPoint(SurfaceIntegrationPoint surfaceIntegrationPoint, double _v1, double _v2, double _v3, double _v4)
        {
            double L1, L2, L3, L4;
            double v_tmp;

            L1 = 0.25 * (1 - surfaceIntegrationPoint.QuadraturePointPosition.v) * (1 - surfaceIntegrationPoint.QuadraturePointPosition.w);
            L2 = 0.25 * (1 + surfaceIntegrationPoint.QuadraturePointPosition.v) * (1 - surfaceIntegrationPoint.QuadraturePointPosition.w);
            L3 = 0.25 * (1 + surfaceIntegrationPoint.QuadraturePointPosition.v) * (1 + surfaceIntegrationPoint.QuadraturePointPosition.w);
            L4 = 0.25 * (1 - surfaceIntegrationPoint.QuadraturePointPosition.v) * (1 + surfaceIntegrationPoint.QuadraturePointPosition.w);

            v_tmp = L1 * _v1 + L2 * _v2 + L3 * _v3 + L4 * _v4;

            return(v_tmp);
        }
        public SurfaceIntegrationPoint TransformIntegrationPoint(int surfaceIndex, int subAreaIndex, int boundarySegmentIndex, SurfaceIntegrationPoint surfaceIntegrationPoint, RealPoint singularPoint)
        {
            var cornerOne = this.CornerOnePoint(surfaceIndex, subAreaIndex, boundarySegmentIndex);
            var cornerTwo = this.CornerTwoPoint(surfaceIndex, subAreaIndex, boundarySegmentIndex);

            double w = this.TransformPositionForCollocationPoint(surfaceIntegrationPoint, singularPoint.x, cornerOne.x, cornerTwo.x, singularPoint.x);
            double v = this.TransformPositionForCollocationPoint(surfaceIntegrationPoint, singularPoint.y, cornerOne.y, cornerTwo.y, singularPoint.y);
            double J = this.TransformJacobian(surfaceIntegrationPoint, singularPoint, cornerOne, cornerTwo);

            var newSurfaceIntegrationPoint = new SurfaceIntegrationPoint(new ParametricPoint(v, w), surfaceIntegrationPoint.QuadratureValue, this.SurfaceShapes[surfaceIndex]);

            newSurfaceIntegrationPoint.Jacobian *= J;

            return(newSurfaceIntegrationPoint);
        }
Beispiel #5
0
        private List <SurfaceIntegrationPoint> calculateRegularSurfaceIntegrationPoints(int regularSurfaceIntegrationPointsCount_v, int regularSurfaceIntegrationPointsCount_w, double temperatureValue, ConfigurationData configurationData)
        {
            var surfaceIntegrationPoints = new List <SurfaceIntegrationPoint>();
            //var diffusionCoefficientTimeValue = configurationData.GetDiffusionCoefficient(temperatureValue);

            var gaussQuadrature_v = new GaussQuadrature(regularSurfaceIntegrationPointsCount_v);
            var gaussQuadrature_w = new GaussQuadrature(regularSurfaceIntegrationPointsCount_w);

            for (int indexv = 0; indexv < regularSurfaceIntegrationPointsCount_v; indexv++)
            {
                for (int indexw = 0; indexw < regularSurfaceIntegrationPointsCount_w; indexw++)
                {
                    var SurfaceIntegrationPoint = new SurfaceIntegrationPoint(new int[] { indexv, indexw }, new ParametricPoint(gaussQuadrature_v.xi[indexv], gaussQuadrature_w.xi[indexw]), 0.0, 1.0, new ParametricPoint(gaussQuadrature_v.Ai[indexv], gaussQuadrature_w.Ai[indexw]), temperatureValue, this.SurfaceShape);
                    //SurfaceIntegrationPoint.diffusionCoefficientTimeValue = diffusionCoefficientTimeValue;
                    surfaceIntegrationPoints.Add(SurfaceIntegrationPoint);
                }
            }

            return(surfaceIntegrationPoints);
        }
        public static double CalculateSiglePointFunctionValue(RealPoint point, double denominator1, double denominator2, SurfaceIntegrationPoint surfaceIntegrationPoint)
        {
            double lambda1 = point.x - surfaceIntegrationPoint.RealPosition.x;
            double lambda2 = point.y - surfaceIntegrationPoint.RealPosition.y;

            double r2 = (double)(lambda1 * lambda1 + lambda2 * lambda2);
            double a  = (double)r2 / denominator1;

            double value = (double)(surfaceIntegrationPoint.QuadratureValue.v
                                    * surfaceIntegrationPoint.QuadratureValue.w
                                    * surfaceIntegrationPoint.Jacobian
                                    * (FunctionEi.calculate(a) / denominator2));

            return(value);
        }