コード例 #1
0
 public double BoundaryEdgeForm(ref CommonParamsBnd inp, double[] _uA, double[,] _Grad_uA, double _vA, double[] _Grad_vA)
 {
     return(this.BorderEdgeFlux(ref inp, _uA) * _vA);
 }
コード例 #2
0
ファイル: XLaplace.cs プロジェクト: xyuan/BoSSS
 public override double BoundaryEdgeForm(ref CommonParamsBnd inp, double[] _uA, double[,] _Grad_uA, double _vA, double[] _Grad_vA)
 {
     return(base.BoundaryEdgeForm(ref inp, _uA, _Grad_uA, _vA, _Grad_vA));
 }
コード例 #3
0
        /// <summary>
        /// Calculating the integral of the boundary edge part
        /// </summary>
        public double BoundaryEdgeForm(ref CommonParamsBnd inp, double[] Uin, double[,] _Grad_uA, double Vin, double[] _Grad_vA)
        {
            double res = 0;
            IncompressibleBcType edgType = m_BcMap.EdgeTag2Type[inp.EdgeTag];

            double n1 = 0;
            double n2 = 0;

            double Vel1 = 0;
            double Vel2 = 0;

            double VelocityX = VelFunction[inp.EdgeTag, 0](inp.X, inp.time);
            double VelocityY = VelFunction[inp.EdgeTag, 1](inp.X, inp.time);

            switch (Component)
            {
            case 0:
                n1   = inp.Normal[0];
                n2   = inp.Normal[0];
                Vel1 = VelocityX;
                Vel2 = VelocityX;
                break;

            case 1:
                n1   = inp.Normal[1];
                n2   = inp.Normal[0];
                Vel1 = VelocityX;
                Vel2 = VelocityY;
                break;

            case 2:
                n1   = inp.Normal[1];
                n2   = inp.Normal[1];
                Vel1 = VelocityY;
                Vel2 = VelocityY;
                break;

            default:
                throw new NotImplementedException();
            }

            switch (edgType)
            {
            case IncompressibleBcType.Outflow:
            case IncompressibleBcType.Pressure_Outlet:

                // Atmospheric outlet/pressure outflow: hom. Neumann
                res += Uin[0] * n1 + Uin[1] * n2;
                break;

            case IncompressibleBcType.FreeSlip:

                //Free slip wall for symmetry line
                switch (Component)
                {
                case 0:
                    res -= Uin[0] * n1 + Uin[1] * n2;
                    //res += 2 * Uin[0] * inp.Normale[0] * inp.Normale[0] * inp.Normale[0] + 2 * Uin[2] * inp.Normale[0] * inp.Normale[1] * inp.Normale[0];
                    //res = 0;// (Uin[0]+VelocityX) * inp.Normale[0] * inp.Normale[0] * inp.Normale[0] + (Uin[2]+VelocityY) * inp.Normale[0] * inp.Normale[1] * inp.Normale[0];
                    break;

                case 1:
                    res += Uin[0] * n1 + Uin[1] * n2;
                    //res += 0.5 * ((Uin[0] + Vel1) * n1 + (Uin[1] + Vel2) * n2);
                    //res += 2 * Uin[0] * inp.Normale[1] * inp.Normale[0] * inp.Normale[0] + 2 * Uin[1] * inp.Normale[1] * inp.Normale[1] * inp.Normale[0];
                    //res = 0;// (Uin[0] + VelocityX) * inp.Normale[1] * inp.Normale[0] * inp.Normale[0] + (Uin[1] + VelocityY) * inp.Normale[1] * inp.Normale[1] * inp.Normale[0];
                    break;

                case 2:
                    res -= Uin[0] * n1 + Uin[1] * n2;
                    //res += 2 * Uin[2] * inp.Normale[1] * inp.Normale[0] * inp.Normale[1] + 2 * Uin[0] * inp.Normale[1] * inp.Normale[1] * inp.Normale[1];
                    //res = 0;// (Uin[2] + VelocityY) * inp.Normale[1] * inp.Normale[0] * inp.Normale[1] + (Uin[0] + VelocityX) * inp.Normale[1] * inp.Normale[1] * inp.Normale[1];
                    break;

                default:
                    throw new NotImplementedException();
                }

                break;

            case IncompressibleBcType.Velocity_Inlet:
            case IncompressibleBcType.Wall:

                // Dirichlet value for Velocity
                // ============================
                //if (Component == 1) {
                res += 0.5 * ((Uin[0] + Vel1) * n1 + (Uin[1] + Vel2) * n2);
                //res += Vel1 * n1 + Vel2 * n2;// + Vel1 * n2 + Vel2 * n1;
                //}
                //else {

                //    res += 0.5 * ((Uin[0] + Vel1) * n1 + (Uin[1] + Vel2) * n2);
                //    //res += Vel1 * n1 + Vel2 * n2;
                //}

                break;

            default:
                throw new NotImplementedException("unsupported/unknown b.c. - missing implementation;");
            }

            return(-2 * m_ViscosityNonNewton * 0.5 * res * Vin);
        }
コード例 #4
0
 /// <summary>
 ///   BoundaryEdgeForm, depending on your physical problem you need to override this with BoundaryEdgeFormDirichlet or BoundaryEdgeFormNeumann.
 /// </summary>
 public abstract double BoundaryEdgeForm(ref CommonParamsBnd inp, double[] _uA, double[,] _Grad_uA, double _vA, double[] _Grad_vA);
コード例 #5
0
ファイル: LinearFlux.cs プロジェクト: xyuan/BoSSS
 /// <summary>
 /// override this method to implement the Riemann flux at border edges
 /// </summary>
 protected abstract double BorderEdgeFlux(ref CommonParamsBnd inp, double[] Uin);
コード例 #6
0
 protected override double g_Neum(ref CommonParamsBnd inp)
 {
     return(0.0);
 }
コード例 #7
0
ファイル: ipPoisson.cs プロジェクト: octwanna/BoSSS
 protected override bool IsDirichlet(ref CommonParamsBnd inp)
 {
     return(ctrl.IsDirichlet(inp));
 }
コード例 #8
0
 /// <summary>
 /// not needed
 /// </summary>
 double IEdgeForm.BoundaryEdgeForm(ref CommonParamsBnd inp, double[] _uA, double[,] _Grad_uA, double _vA, double[] _Grad_vA)
 {
     throw new NotImplementedException();
 }
コード例 #9
0
ファイル: ipPoisson.cs プロジェクト: octwanna/BoSSS
        protected override double g_Diri(ref CommonParamsBnd inp)
        {
            double v = ctrl.g_Diri(inp);

            return(v);
        }
コード例 #10
0
ファイル: ipPoisson.cs プロジェクト: octwanna/BoSSS
 protected override double g_Neum(ref CommonParamsBnd inp)
 {
     return(ctrl.g_Neum(inp));
 }
コード例 #11
0
ファイル: GradientModule.cs プロジェクト: xyuan/BoSSS
 public double BoundaryEdgeForm(ref CommonParamsBnd inp, double[] PhiIn, double[,] GradPhiIn, double vIn, double[] Grad_vIn)
 {
     return(PhiIn[0] * (+inp.Normale[this.m_Direction]) * vIn);
 }
コード例 #12
0
ファイル: XLaplace.cs プロジェクト: xyuan/BoSSS
 protected override bool IsDirichlet(ref CommonParamsBnd inp)
 {
     return(boundaries.IsDirichlet(inp));
 }
コード例 #13
0
ファイル: XLaplace.cs プロジェクト: xyuan/BoSSS
 protected override double g_Diri(ref CommonParamsBnd inp)
 {
     return(boundaries.g_Diri(inp));
 }
コード例 #14
0
 public double BoundaryEdgeForm(ref CommonParamsBnd inp, double[] _uA, double[,] _Grad_uA, double _vA, double[] _Grad_vA)
 {
     throw new NotSupportedException();
 }
コード例 #15
0
        protected override double BorderEdgeFlux(ref CommonParamsBnd inp, double[] Tin)
        {
            double res = 0;

            int jIn = inp.jCellIn;

            double h = inp.GridDat.iGeomCells.h_min[jIn];

            IncompressibleBcType edgType = m_BcMap.EdgeTag2Type[inp.EdgeTag];

            switch (edgType)
            {
            case IncompressibleBcType.Outflow:
            case IncompressibleBcType.Pressure_Outlet:


                // Atmospheric outlet/pressure outflow: hom. Neumann
                res += Tin[0] * inp.Normale[0];
                res += Tin[1] * inp.Normale[1];
                break;

            case IncompressibleBcType.Velocity_Inlet:
            case IncompressibleBcType.Wall:

                double VelocityX = VelFunction[inp.EdgeTag, 0](inp.X, inp.time);
                double VelocityY = VelFunction[inp.EdgeTag, 1](inp.X, inp.time);

                // Dirichlet value for Stresses
                // ============================
                //double StressXX = StressFunction[inp.EdgeTag, 0](inp.X, inp.time);
                //double StressXY = StressFunction[inp.EdgeTag, 1](inp.X, inp.time);
                //double StressYY = StressFunction[inp.EdgeTag, 2](inp.X, inp.time);

                switch (Component)
                {
                case 0:
                    //res += StressXX * inp.Normale[0];
                    //res += StressXY * inp.Normale[1];
                    res += Tin[0] * inp.Normale[0];
                    res += Tin[1] * inp.Normale[1];
                    //res += 0.5 * (StressXX + Tin[0]) * inp.Normale[0];
                    //res += 0.5 * (StressXY + Tin[1]) * inp.Normale[1];
                    //res += -pen2/h * (Tin[2] - VelocityX) * inp.Normale[0] - pen2/h * (Tin[2] - VelocityX) * inp.Normale[1]; //alpha penalty for boundary (no beta penalty)
                    //res += -pen2 * (Tin[2] - VelocityX); // / h

                    break;

                case 1:
                    //res += StressXY * inp.Normale[0];
                    //res += StressYY * inp.Normale[1];
                    res += Tin[0] * inp.Normale[0];
                    res += Tin[1] * inp.Normale[1];
                    //res += 0.5 * (StressXY + Tin[0]) * inp.Normale[0];
                    //res += 0.5 * (StressYY + Tin[1]) * inp.Normale[1];
                    //res += -pen2/h * (Tin[2] - VelocityY) * inp.Normale[0] - pen2 / h * (Tin[2] - VelocityY) * inp.Normale[1]; //alpha penalty for boundary (no beta penalty)
                    //res += -pen2* (Tin[2] - VelocityY); // / h

                    break;

                default:
                    throw new NotImplementedException();
                }
                break;

            default:
                throw new NotImplementedException("unsupported/unknown b.c. - missing implementation;");
            }
            return(InverseReynolds * res);
        }
コード例 #16
0
ファイル: UpwindingLHS.cs プロジェクト: xyuan/BoSSS
 public new double BoundaryEdgeForm(ref CommonParamsBnd inp, double[] uA, double[,] Grad_uA, double vA, double[] Grad_vA)
 {
     return(0);
 }
コード例 #17
0
        /// <summary>
        /// Stress divergence border edge term
        /// </summary>
        protected override double BorderEdgeFlux(ref CommonParamsBnd inp, double[] Tin)
        {
            double res = 0;

            int jIn = inp.jCellIn;

            double h = inp.GridDat.iGeomCells.h_min[jIn];

            IncompressibleBcType edgType = m_BcMap.EdgeTag2Type[inp.EdgeTag];

            switch (edgType)
            {
            case IncompressibleBcType.Outflow:
            case IncompressibleBcType.Pressure_Outlet:


                // Atmospheric outlet/pressure outflow: hom. Neumann
                res += Tin[0] * inp.Normal[0];
                res += Tin[1] * inp.Normal[1];
                break;

            case IncompressibleBcType.Velocity_Inlet:
            case IncompressibleBcType.Wall:

                double VelocityX = VelFunction[inp.EdgeTag, 0](inp.X, inp.time);
                double VelocityY = VelFunction[inp.EdgeTag, 1](inp.X, inp.time);

                switch (Component)
                {
                case 0:
                    res += Tin[0] * inp.Normal[0];
                    res += Tin[1] * inp.Normal[1];
                    //alpha penalty for boundary (no beta penalty)
                    res += -pen2 / h * (Tin[2] - VelocityX);

                    break;

                case 1:
                    res += Tin[0] * inp.Normal[0];
                    res += Tin[1] * inp.Normal[1];
                    //alpha penalty for boundary (no beta penalty)
                    res += -pen2 / h * (Tin[2] - VelocityY);

                    break;

                default:
                    throw new NotImplementedException();
                }
                break;

            case IncompressibleBcType.FreeSlip:

                //Free slip wall for symmetry line of symmetric channel

                //double VelocityX2 = VelFunction[inp.EdgeTag, 0](inp.X, inp.time);
                //double VelocityY2 = VelFunction[inp.EdgeTag, 1](inp.X, inp.time);

                switch (Component)
                {
                case 0:
                    res += inp.Normal[0] * Tin[0] * inp.Normal[0] * inp.Normal[0];
                    res += inp.Normal[0] * Tin[1] * inp.Normal[1] * inp.Normal[0];
                    res += inp.Normal[0] * Tin[1] * inp.Normal[0] * inp.Normal[1];
                    res += inp.Normal[0] * Tin[3] * inp.Normal[1] * inp.Normal[1];
                    //res += -pen2 / h * (Tin[2] - VelocityX2) * inp.Normale[0] - pen2 / h * (Tin[2] - VelocityX2) * inp.Normale[1];
                    //res += 0;

                    break;

                case 1:
                    res += inp.Normal[1] * Tin[3] * inp.Normal[0] * inp.Normal[0];
                    res += inp.Normal[1] * Tin[0] * inp.Normal[1] * inp.Normal[0];
                    res += inp.Normal[1] * Tin[0] * inp.Normal[0] * inp.Normal[1];
                    res += inp.Normal[1] * Tin[1] * inp.Normal[1] * inp.Normal[1];
                    //res += -pen2 / h * (Tin[2] - VelocityY2) * inp.Normale[0] - pen2 / h * (Tin[2] - VelocityY2) * inp.Normale[1];
                    //res += Tin[1] * inp.Normale[1];
                    //res += 0;

                    break;

                default:
                    throw new NotImplementedException();
                }
                break;


            default:
                throw new NotImplementedException("unsupported/unknown b.c. - missing implementation;");
            }
            return(InverseReynolds * res);
        }
コード例 #18
0
ファイル: ExtVelSolver_PDEbased.cs プロジェクト: xyuan/BoSSS
 public new double BoundaryEdgeForm(ref CommonParamsBnd inp, double[] sA, double[,] Grad_sA, double _vA, double[] _Grad_vA)
 {
     return(0.0);
 }
コード例 #19
0
        protected override double BorderEdgeFlux(ref CommonParamsBnd inp, Double[] Uin)
        {
            double[] Vel_IN = inp.Parameters_IN.GetSubVector(0, m_D);
            double[,] GradVel_IN = VelocityGradient(inp.Parameters_IN.GetSubVector(m_D, m_D), inp.Parameters_IN.GetSubVector(2 * m_D, m_D));
            //double Press_IN = inp.Parameters_IN[3 * m_D];

            double acc = 0;

            IncompressibleBcType edgType = m_bcMap.EdgeTag2Type[inp.EdgeTag];

            switch (edgType)
            {
            case IncompressibleBcType.Wall: {
                //for (int d = 0; d < m_D; d++) {
                //    //acc -= Press_IN * Vel_IN[d] * inp.Normale[d];
                //    for (int dd = 0; dd < m_D; dd++) {
                //        acc += mu * (GradVel_IN[d, dd] * Vel_IN[dd]) * inp.Normale[d];
                //        //acc += mu * (GradVel_IN[dd, d] * Vel_IN[dd]) * inp.Normale[d];  // transposed term
                //    }
                //}
                break;
            }

            case IncompressibleBcType.Velocity_Inlet: {
                for (int d = 0; d < m_D; d++)
                {
                    //acc -= Press_IN * Vel_IN[d] * inp.Normale[d];
                    for (int dd = 0; dd < m_D; dd++)
                    {
                        double VelD = VelFunction[inp.EdgeTag, dd](inp.X, inp.time);
                        acc += mu * (GradVel_IN[d, dd] * VelD) * inp.Normal[d];
                        if (transposedTerm)
                        {
                            acc += mu * (GradVel_IN[dd, d] * VelD) * inp.Normal[d];          // transposed term
                        }
                    }
                }
                break;
            }

            case IncompressibleBcType.Pressure_Outlet:
            case IncompressibleBcType.Pressure_Dirichlet: {
                for (int d = 0; d < m_D; d++)
                {
                    //acc -= Press_IN * Vel_IN[d] * inp.Normale[d];
                    for (int dd = 0; dd < m_D; dd++)
                    {
                        acc += mu * (GradVel_IN[d, dd] * Vel_IN[dd]) * inp.Normal[d];
                        if (transposedTerm)
                        {
                            acc += mu * (GradVel_IN[dd, d] * Vel_IN[dd]) * inp.Normal[d];          // transposed term
                        }
                    }
                }
                break;
            }

            default: {
                throw new NotImplementedException("ToDo");
            }
            }

            return(-acc);
        }
コード例 #20
0
        protected override double BorderEdgeFlux(ref CommonParamsBnd inp, Double[] Uin)
        {
            ThermalBcType edgeType = m_bcmap.EdgeTag2Type[inp.EdgeTag];

            switch (edgeType)
            {
            case ThermalBcType.ConstantTemperature: {
                double r = 0.0;

                // Setup params
                // ============
                Foundation.CommonParams inp2;
                inp2.GridDat       = inp.GridDat;
                inp2.Normale       = inp.Normale;
                inp2.iEdge         = inp.iEdge;
                inp2.Parameters_IN = inp.Parameters_IN;
                inp2.X             = inp.X;
                inp2.time          = inp.time;


                // Specify Parameters_OUT
                // ======================
                inp2.Parameters_OUT = new double[inp.Parameters_IN.Length];

                // Dirichlet value for temperature
                double Uout = TempFunction[inp.EdgeTag](inp.X, inp.time);

                // Outer values for Velocity and VelocityMean
                for (int j = 0; j < m_SpatialDimension; j++)
                {
                    inp2.Parameters_OUT[j] = inp2.Parameters_IN[j];         //velFunction[inp.EdgeTag, j](inp.X, inp.time);

                    // Velocity0MeanVectorOut is set to zero, i.e. always LambdaIn is used.
                    //inp2.Parameters_OUT[m_SpatialDimension + j] = 0.0;

                    // VelocityMeanOut = VelocityMeanIn
                    inp2.Parameters_OUT[m_SpatialDimension + j] = inp.Parameters_IN[m_SpatialDimension + j];
                }

                // Calculate BorderEdgeFlux as InnerEdgeFlux
                // =========================================
                r = InnerEdgeFlux(ref inp2, Uin, new double[] { Uout });

                return(r);
            }

            case ThermalBcType.ZeroGradient:
            case ThermalBcType.ConstantHeatFlux: {
                double r = 0.0;
                double u1, u2, u3 = 0, u_d;

                u_d = Uin[0];
                u1  = inp.Parameters_IN[0];
                u2  = inp.Parameters_IN[1];
                if (m_SpatialDimension == 3)
                {
                    u3 = inp.Parameters_IN[2];
                }

                r += u_d * (u1 * inp.Normale[0] + u2 * inp.Normale[1]);
                if (m_SpatialDimension == 3)
                {
                    r += u_d * u3 * inp.Normale[2];
                }

                return(r);
            }

            default:
                throw new NotImplementedException("Boundary condition not implemented!");
            }
        }
コード例 #21
0
ファイル: ipFlux.cs プロジェクト: nehzatemamy/BoSSS
        protected override double g_Neum(ref CommonParamsBnd inp)
        {
            double v = m_bndFunc[inp.EdgeTag](inp.X, inp.time);

            return(v);
        }
コード例 #22
0
        public double BoundaryEdgeForm(ref CommonParamsBnd inp, double[] _uA, double[,] _Grad_uA, double _vA, double[] _Grad_vA)
        {
            double Acc = 0.0;

            double pnlty = 2 * GetPenalty(inp.jCellIn, -1);//, inp.GridDat.Cells.cj);
            double DiffusivityA;

            switch (Mode)
            {
            case DiffusionMode.Temperature:
                DiffusivityA = ((MaterialLawCombustion)EoS).GetHeatConductivity(inp.Parameters_IN[0]);
                break;

            case DiffusionMode.MassFraction:
                DiffusivityA = ((MaterialLawCombustion)EoS).GetDiffusivity(inp.Parameters_IN[0]);
                break;

            default:
                throw new NotImplementedException();
            }
            IncompressibleBcType edgType = BcMap.EdgeTag2Type[inp.EdgeTag];

            switch (edgType)
            {
            case IncompressibleBcType.Wall: {
                double u_D;
                switch (Mode)
                {
                case DiffusionMode.Temperature:
                    // inhom. Dirichlet b.c.
                    // =====================
                    u_D = ArgumentFunction[inp.EdgeTag](inp.X, 0);
                    for (int d = 0; d < inp.D; d++)
                    {
                        Acc += (DiffusivityA * _Grad_uA[0, d]) * (_vA) * inp.Normale[d];
                        Acc += (DiffusivityA * _Grad_vA[d]) * (_uA[0] - u_D) * inp.Normale[d];
                    }

                    Acc -= DiffusivityA * (_uA[0] - u_D) * (_vA - 0) * pnlty;
                    break;

                case DiffusionMode.MassFraction:
                    //Neumann boundary condition
                    Acc = 0.0;
                    break;

                default:
                    throw new NotImplementedException();
                }
                break;
            }

            case IncompressibleBcType.Velocity_Inlet: {
                // inhom. Dirichlet b.c.
                // =====================

                double u_D;
                switch (Mode)
                {
                case DiffusionMode.Temperature:
                    u_D = ArgumentFunction[inp.EdgeTag](inp.X, inp.time);
                    for (int d = 0; d < inp.D; d++)
                    {
                        Acc += (DiffusivityA * _Grad_uA[0, d]) * (_vA) * inp.Normale[d];
                        Acc += (DiffusivityA * _Grad_vA[d]) * (_uA[0] - u_D) * inp.Normale[d];
                    }

                    Acc -= DiffusivityA * (_uA[0] - u_D) * (_vA - 0) * pnlty;
                    break;

                case DiffusionMode.MassFraction:
                    double rhoA = 0.0;
                    rhoA = EoS.GetDensity(inp.Parameters_IN);
                    u_D  = ArgumentFunction[inp.EdgeTag](inp.X, inp.time);
                    for (int d = 0; d < inp.D; d++)
                    {
                        Acc += (DiffusivityA * rhoA * _Grad_uA[0, d]) * (_vA) * inp.Normale[d];
                        Acc += (DiffusivityA * rhoA * _Grad_vA[d]) * (_uA[0] - u_D) * inp.Normale[d];
                    }

                    Acc -= DiffusivityA * rhoA * (_uA[0] - u_D) * (_vA - 0) * pnlty;
                    break;

                default:
                    throw new NotImplementedException();
                }
                break;
            }

            case IncompressibleBcType.Outflow:
            case IncompressibleBcType.Pressure_Outlet:
            case IncompressibleBcType.Pressure_Dirichlet:
            case IncompressibleBcType.NoSlipNeumann: {
                Acc = 0.0;
                break;
            }

            default:
                throw new NotSupportedException();
            }

            Acc *= 1.0 / (Reynolds * Schmidt);
            return(-Acc);
        }
コード例 #23
0
ファイル: LinearDualValueFlux.cs プロジェクト: xyuan/BoSSS
 /// <summary>
 /// override this method to implement the 'flux' at boundary edges
 /// </summary>
 protected abstract void BorderEdgeFlux_(ref CommonParamsBnd inp, double[] Uin, out double FluxInCell);
コード例 #24
0
 public double BoundaryEdgeForm(ref CommonParamsBnd inp, double[] _uA, double[,] _Grad_uA, double _vA, double[] _Grad_vA)
 {
     return(edgeForm.BoundaryEdgeForm(ref inp, _uA, _Grad_uA, _vA, _Grad_vA));
 }
コード例 #25
0
        protected override double BorderEdgeFlux(ref CommonParamsBnd inp, Double[] Uin)
        {
            IncompressibleBcType edgeType = m_bcMap.EdgeTag2Type[inp.EdgeTag];

            switch (edgeType)
            {
            case IncompressibleBcType.Wall:
            case IncompressibleBcType.Velocity_Inlet: {
                double r = 0.0;

                // Setup params
                // ============
                CommonParams inp2 = new CommonParams();;
                inp2.GridDat       = inp.GridDat;
                inp2.Normal        = inp.Normal;
                inp2.iEdge         = inp.iEdge;
                inp2.Parameters_IN = inp.Parameters_IN;
                inp2.X             = inp.X;
                inp2.time          = inp.time;

                // Specify Parameters_OUT
                // ======================
                inp2.Parameters_OUT = new double[inp.Parameters_IN.Length];


                // Dirichlet value for scalar (kinetic energy)
                double kinE_Diri = 0.0;
                for (int i = 0; i < m_SpatialDimension; i++)
                {
                    Func <double[], double, double> boundVel = this.VelFunction[inp.EdgeTag, i];
                    kinE_Diri += boundVel(inp.X, inp.time) * boundVel(inp.X, inp.time);
                }

                double Uout = kinE_Diri / 2.0;


                // Outer values for Velocity and VelocityMean
                for (int j = 0; j < m_SpatialDimension; j++)
                {
                    inp2.Parameters_OUT[j] = inp2.Parameters_IN[j];         // VelFunction[inp.EdgeTag, j](inp.X, inp.time);

                    // VelocityMeanOut = VelocityMeanIn
                    inp2.Parameters_OUT[m_SpatialDimension + j] = inp.Parameters_IN[m_SpatialDimension + j];
                }

                // Calculate BorderEdgeFlux as InnerEdgeFlux
                // =========================================
                r = InnerEdgeFlux(ref inp2, Uin, new double[] { Uout });

                return(r);
            }

            case IncompressibleBcType.Pressure_Outlet: {
                double r = 0.0;
                double u1, u2, u3 = 0, u_d;

                u_d = Uin[0];
                u1  = inp.Parameters_IN[0];
                u2  = inp.Parameters_IN[1];
                if (m_SpatialDimension == 3)
                {
                    u3 = inp.Parameters_IN[2];
                }

                r += u_d * (u1 * inp.Normal[0] + u2 * inp.Normal[1]);
                if (m_SpatialDimension == 3)
                {
                    r += u_d * u3 * inp.Normal[2];
                }

                return(r);
            }

            default:
                throw new NotImplementedException("Boundary condition not implemented!");
            }
        }
コード例 #26
0
 protected override bool IsDirichlet(ref CommonParamsBnd inp)
 {
     return(false);
 }
コード例 #27
0
 /// <summary>
 /// Calculating the integral of the boundary edge part
 /// </summary>
 public double BoundaryEdgeForm(ref CommonParamsBnd inp, double[] Tin, double[,] Grad_Tin, double Vin, double[] Grad_Vin)
 {
     return(0.0);
 }
コード例 #28
0
 /// <summary>
 /// Non-optimized version of the border edge flux,
 /// <seealso cref="BoSSS.Solution.NSECommon.SIPLaplace"/>
 /// </summary>
 double IEdgeForm.BoundaryEdgeForm(ref CommonParamsBnd inp, double[] _uA, double[,] _Grad_uA, double _vA, double[] _Grad_vA)
 {
     // Zero Neumann boundary conditions
     return(0.0);
 }
コード例 #29
0
 protected override bool IsDirichlet(ref CommonParamsBnd inp)
 {
     throw new NotSupportedException("I had to implement this...");
 }