示例#1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="XOp"></param>
 /// <param name="config"></param>
 /// <param name="D"></param>
 /// <param name="LsTrk"></param>
 public static void AddInterfaceNSE_withEvaporation(XSpatialOperatorMk2 XOp, XNSFE_OperatorConfiguration config, int D, LevelSetTracker LsTrk)
 {
     for (int d = 0; d < D; d++)
     {
         AddInterfaceNSE_withEvaporation_component(XOp, config, d, D, LsTrk);
     }
 }
示例#2
0
        //==============================================================
        // additional interface components for NSFE interface components
        //==============================================================


        /// <summary>
        ///
        /// </summary>
        /// <param name="XOp"></param>
        /// <param name="config"></param>
        /// <param name="d"></param>
        /// <param name="D"></param>
        /// <param name="LsTrk"></param>
        public static void AddInterfaceNSE_withEvaporation_component(XSpatialOperatorMk2 XOp, XNSFE_OperatorConfiguration config,
                                                                     int d, int D, LevelSetTracker LsTrk)
        {
            // check input
            if (XOp.IsCommited)
            {
                throw new InvalidOperationException("Spatial Operator is already comitted. Adding of new components is not allowed");
            }

            string CodName = EquationNames.MomentumEquationComponent(d);

            if (!XOp.CodomainVar.Contains(CodName))
            {
                throw new ArgumentException("CoDomain variable \"" + CodName + "\" is not defined in Spatial Operator");
            }

            PhysicalParameters   physParams  = config.getPhysParams;
            ThermalParameters    thermParams = config.getThermParams;
            DoNotTouchParameters dntParams   = config.getDntParams;

            // set species arguments
            double rhoA  = physParams.rho_A;
            double rhoB  = physParams.rho_B;
            double muA   = physParams.mu_A;
            double muB   = physParams.mu_B;
            double sigma = physParams.Sigma;


            // compute further arguments
            double hVapA = thermParams.hVap_A;
            double hVapB = thermParams.hVap_B;

            double Tsat = thermParams.T_sat;

            double f     = config.thermParams.fc;
            double R     = config.thermParams.Rc;
            double R_int = 0.0;

            if (config.thermParams.hVap_A > 0 && config.thermParams.hVap_B < 0)
            {
                R_int = ((2.0 - f) / (2 * f)) * Tsat * Math.Sqrt(2 * Math.PI * R * Tsat) / (rhoB * hVapA.Pow2());
                //T_intMin = Tsat * (1 + (pc / (rhoA * hVapA.Pow2())));
            }
            else if (config.thermParams.hVap_A < 0 && config.thermParams.hVap_B > 0)
            {
                R_int = ((2.0 - f) / (2 * f)) * Tsat * Math.Sqrt(2 * Math.PI * R * Tsat) / (rhoA * hVapB.Pow2());
                //T_intMin = Tsat * (1 + (pc / (rhoB * hVapB.Pow2())));
            }
            //double prescrbM = config.prescribedMassflux;

            // set components
            var comps = XOp.EquationComponents[CodName];


            if (config.isTransport)
            {
                comps.Add(new ConvectionAtLevelSet_nonMaterialLLF(d, D, LsTrk, rhoA, rhoB, thermParams, R_int, sigma));
                comps.Add(new ConvectionAtLevelSet_Consistency(d, D, LsTrk, rhoA, rhoB, dntParams.ContiSign, dntParams.RescaleConti, thermParams, R_int, sigma));
            }

            //if (config.isPInterfaceSet) {
            //    comps.Add(new GeneralizedPressureFormAtLevelSet(d, LsTrk, thermParams.p_sat, thermParams.hVap_A));
            //}

            if (config.isViscous)
            {
                comps.Add(new ViscosityAtLevelSet_FullySymmetric_withEvap(LsTrk, muA, muB, dntParams.PenaltySafety, d, rhoA, rhoB, thermParams, R_int, sigma));
            }

            comps.Add(new MassFluxAtInterface(d, D, LsTrk, rhoA, rhoB, thermParams, R_int, sigma));
        }
示例#3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="XOp"></param>
        /// <param name="config"></param>
        /// <param name="D"></param>
        /// <param name="LsTrk"></param>
        public static void AddInterfaceHeatEq_withEvaporation(XSpatialOperatorMk2 XOp, XNSFE_OperatorConfiguration config, int D, LevelSetTracker LsTrk)
        {
            // check input
            if (XOp.IsCommited)
            {
                throw new InvalidOperationException("Spatial Operator is already comitted. Adding of new components is not allowed");
            }

            string CodName = EquationNames.HeatEquation;

            if (!XOp.CodomainVar.Contains(CodName))
            {
                throw new ArgumentException("CoDomain variable \"" + CodName + "\" is not defined in Spatial Operator");
            }

            if (config.getConductMode != ConductivityInSpeciesBulk.ConductivityMode.SIP)
            {
                foreach (string cn in EquationNames.AuxHeatFlux(D))
                {
                    if (!XOp.CodomainVar.Contains(cn))
                    {
                        throw new ArgumentException("CoDomain variable \"" + cn + "\" is not defined in Spatial Operator");
                    }
                }
            }

            PhysicalParameters physParams  = config.getPhysParams;
            ThermalParameters  thermParams = config.getThermParams;

            // set species arguments
            double rhoA  = physParams.rho_A;
            double rhoB  = physParams.rho_B;
            double sigma = physParams.Sigma;


            // compute further arguments
            double hVapA = thermParams.hVap_A;
            double hVapB = thermParams.hVap_B;

            double Tsat = thermParams.T_sat;

            double f     = config.thermParams.fc;
            double R     = config.thermParams.Rc;
            double rho_l = 0.0;
            double R_int = 0.0;

            if (config.thermParams.hVap_A > 0 && config.thermParams.hVap_B < 0)
            {
                rho_l = rhoA;
                R_int = ((2.0 - f) / (2 * f)) * Tsat * Math.Sqrt(2 * Math.PI * R * Tsat) / (rhoB * hVapA.Pow2());
                //T_intMin = Tsat * (1 + (pc / (rhoA * hVapA.Pow2())));
            }
            else if (config.thermParams.hVap_A < 0 && config.thermParams.hVap_B > 0)
            {
                rho_l = rhoB;
                R_int = ((2.0 - f) / (2 * f)) * Tsat * Math.Sqrt(2 * Math.PI * R * Tsat) / (rhoA * hVapB.Pow2());
                //T_intMin = Tsat * (1 + (pc / (rhoB * hVapB.Pow2())));
            }


            // set components
            var comps = XOp.EquationComponents[CodName];


            // mass flux at interface
            // ======================
            //if (!config.isSeparated) {
            //    comps.Add(new HeatFluxAtLevelSet(LsTrk, rho_l, thermParams, R_int, sigma));
            //}


            // convective part
            // ================
            if (thermParams.IncludeConvection)
            {
                comps.Add(new HeatConvectionAtLevelSet_Divergence(D, LsTrk, rhoA, rhoB, thermParams, R_int, sigma));
            }
        }
示例#4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="XOp"></param>
        /// <param name="config"></param>
        /// <param name="D"></param>
        /// <param name="LsTrk"></param>
        public static void AddInterfaceContinuityEq_withEvaporation(XSpatialOperatorMk2 XOp, XNSFE_OperatorConfiguration config, int D, LevelSetTracker LsTrk)
        {
            // check input
            if (XOp.IsCommited)
            {
                throw new InvalidOperationException("Spatial Operator is already comitted. Adding of new components is not allowed");
            }

            string CodName = EquationNames.ContinuityEquation;

            if (!XOp.CodomainVar.Contains(CodName))
            {
                throw new ArgumentException("CoDomain variable \"" + CodName + "\" is not defined in Spatial Operator");
            }

            PhysicalParameters   physParams  = config.getPhysParams;
            ThermalParameters    thermParams = config.getThermParams;
            DoNotTouchParameters dntParams   = config.getDntParams;

            // set species arguments
            double rhoA  = physParams.rho_A;
            double rhoB  = physParams.rho_B;
            double sigma = physParams.Sigma;


            // compute further arguments
            double hVapA = thermParams.hVap_A;
            double hVapB = thermParams.hVap_B;

            double Tsat = thermParams.T_sat;

            double f     = config.thermParams.fc;
            double R     = config.thermParams.Rc;
            double R_int = 0.0;

            if (config.thermParams.hVap_A > 0 && config.thermParams.hVap_B < 0)
            {
                R_int = ((2.0 - f) / (2 * f)) * Tsat * Math.Sqrt(2 * Math.PI * R * Tsat) / (rhoB * hVapA.Pow2());
                //T_intMin = Tsat * (1 + (pc / (rhoA * hVapA.Pow2())));
            }
            else if (config.thermParams.hVap_A < 0 && config.thermParams.hVap_B > 0)
            {
                R_int = ((2.0 - f) / (2 * f)) * Tsat * Math.Sqrt(2 * Math.PI * R * Tsat) / (rhoA * hVapB.Pow2());
                //T_intMin = Tsat * (1 + (pc / (rhoB * hVapB.Pow2())));
            }
            //double prescrbM = config.prescribedMassflux;

            // set components
            var comps = XOp.EquationComponents[CodName];

            var divEvap = new DivergenceAtLevelSet_withEvaporation(D, LsTrk, rhoA, rhoB, dntParams.ContiSign, dntParams.RescaleConti, thermParams, R_int, sigma);

            comps.Add(divEvap);
        }
        /// <summary>
        /// ctor for the operator factory, where the equation compnents are set
        /// </summary>
        /// <param name="_config"></param>
        /// <param name="_LsTrk"></param>
        /// <param name="_HMFdegree"></param>
        /// <param name="BcMap"></param>
        /// <param name="thermBcMap"></param>
        /// <param name="degU"></param>
        public XNSFE_OperatorFactory(XNSFE_OperatorConfiguration _config, LevelSetTracker _LsTrk, int _HMFdegree,
                                     IncompressibleMultiphaseBoundaryCondMap BcMap, ThermalMultiphaseBoundaryCondMap thermBcMap, int degU, IDictionary <SpeciesId, IEnumerable <double> > MassScale)
        {
            this.config = _config;
            this.LsTrk  = _LsTrk;
            this.D      = _LsTrk.GridDat.SpatialDimension;

            this.HMFDegree = _HMFdegree;

            this.physParams  = config.getPhysParams;
            this.thermParams = config.getThermParams;
            this.dntParams   = config.getDntParams;


            // test input
            // ==========
            {
                if ((config.getPhysParams.mu_A <= 0) && (config.getPhysParams.mu_B <= 0))
                {
                    config.isViscous = false;
                }
                else
                {
                    if ((config.getPhysParams.mu_A <= 0) || (config.getPhysParams.mu_B <= 0))
                    {
                        throw new ArgumentException();
                    }
                }

                if ((config.getPhysParams.rho_A <= 0) || (config.getPhysParams.rho_B <= 0))
                {
                    throw new ArgumentException();
                }

                if (_LsTrk.SpeciesNames.Count != 2)
                {
                    throw new ArgumentException();
                }

                if (!(_LsTrk.SpeciesNames.Contains("A") && _LsTrk.SpeciesNames.Contains("B")))
                {
                    throw new ArgumentException();
                }
            }


            // full operator:
            // ==============
            CodName = ArrayTools.Cat(EquationNames.MomentumEquations(D), EquationNames.ContinuityEquation);
            Params  = ArrayTools.Cat(
                VariableNames.Velocity0Vector(D),
                VariableNames.Velocity0MeanVector(D),
                VariableNames.NormalVector(D),
                VariableNames.Curvature,
                VariableNames.SurfaceForceVector(D)
                );
            DomName = ArrayTools.Cat(VariableNames.VelocityVector(D), VariableNames.Pressure);

            if (config.solveEnergy)
            {
                CodName = ArrayTools.Cat(CodName, EquationNames.KineticEnergyEquation);
                Params  = ArrayTools.Cat(Params,
                                         VariableNames.VelocityX_GradientVector(),
                                         VariableNames.VelocityY_GradientVector(),
                                         new string[] { "VelocityXGradX_GradientX", "VelocityXGradX_GradientY" },
                                         new string[] { "VelocityXGradY_GradientX", "VelocityXGradY_GradientY" },
                                         new string[] { "VelocityYGradX_GradientX", "VelocityYGradX_GradientY" },
                                         new string[] { "VelocityYGradY_GradientX", "VelocityYGradY_GradientY" },
                                         VariableNames.Pressure0,
                                         VariableNames.PressureGradient(D),
                                         VariableNames.GravityVector(D)
                                         );
                DomName = ArrayTools.Cat(DomName, VariableNames.KineticEnergy);
            }

            if (config.solveHeat)
            {
                Params = ArrayTools.Cat(Params,
                                        VariableNames.Temperature0,
                                        VariableNames.HeatFlux0Vector(D),
                                        VariableNames.DisjoiningPressure
                                        );
                if (config.conductMode == ConductivityInSpeciesBulk.ConductivityMode.SIP)
                {
                    CodName = ArrayTools.Cat(CodName, EquationNames.HeatEquation);
                    DomName = ArrayTools.Cat(DomName, VariableNames.Temperature);
                }
                else
                {
                    CodName = ArrayTools.Cat(CodName, EquationNames.HeatEquation, EquationNames.AuxHeatFlux(D));
                    DomName = ArrayTools.Cat(DomName, VariableNames.Temperature, VariableNames.HeatFluxVector(D));
                }
            }

            storedParams = new DGField[Params.Length];

            // selected part:
            if (config.getCodBlocks[0])
            {
                CodNameSelected = ArrayTools.Cat(CodNameSelected, CodName.GetSubVector(0, D));
            }
            if (config.getCodBlocks[1])
            {
                CodNameSelected = ArrayTools.Cat(CodNameSelected, CodName.GetSubVector(D, 1));
            }

            if (config.getDomBlocks[0])
            {
                DomNameSelected = ArrayTools.Cat(DomNameSelected, DomName.GetSubVector(0, D));
            }
            if (config.getDomBlocks[1])
            {
                DomNameSelected = ArrayTools.Cat(DomNameSelected, DomName.GetSubVector(D, 1));
            }

            int nBlocks = 2;

            if (config.solveEnergy)
            {
                nBlocks = 3;
                if (config.getCodBlocks[2])
                {
                    CodNameSelected = ArrayTools.Cat(CodNameSelected, CodName.GetSubVector(D + 1, 1));
                }
                if (config.getDomBlocks[2])
                {
                    DomNameSelected = ArrayTools.Cat(DomNameSelected, DomName.GetSubVector(D + 1, 1));
                }
            }

            if (config.solveHeat)
            {
                if (config.getCodBlocks[nBlocks])
                {
                    CodNameSelected = ArrayTools.Cat(CodNameSelected, CodName.GetSubVector(nBlocks + (D - 1) + 1, 1));
                }
                if (config.getDomBlocks[nBlocks])
                {
                    DomNameSelected = ArrayTools.Cat(DomNameSelected, DomName.GetSubVector(nBlocks + (D - 1) + 1, 1));
                }

                if (config.conductMode != ConductivityInSpeciesBulk.ConductivityMode.SIP)
                {
                    if (config.getCodBlocks[nBlocks + 1])
                    {
                        CodNameSelected = ArrayTools.Cat(CodNameSelected, CodName.GetSubVector(nBlocks + (D - 1) + 2, D));
                    }
                    if (config.getDomBlocks[nBlocks + 1])
                    {
                        DomNameSelected = ArrayTools.Cat(DomNameSelected, DomName.GetSubVector(nBlocks + (D - 1) + 2, D));
                    }
                }
            }


            // create Operator
            // ===============
            m_XOp = new XSpatialOperatorMk2(DomNameSelected, Params, CodNameSelected, (A, B, C) => _HMFdegree, this.LsTrk.SpeciesNames);

            // add Navier-Stokes components
            // ============================

            // species bulk components
            for (int spc = 0; spc < LsTrk.TotalNoOfSpecies; spc++)
            {
                // Navier Stokes equations
                Solution.XNSECommon.XOperatorComponentsFactory.AddSpeciesNSE(m_XOp, config, D, LsTrk.SpeciesNames[spc], LsTrk.SpeciesIdS[spc], BcMap, LsTrk, out U0meanrequired);

                // continuity equation
                if (config.isContinuity)
                {
                    Solution.XNSECommon.XOperatorComponentsFactory.AddSpeciesContinuityEq(m_XOp, config, D, LsTrk.SpeciesNames[spc], LsTrk.SpeciesIdS[spc], BcMap);
                }
            }

            // interface components
            Solution.XNSECommon.XOperatorComponentsFactory.AddInterfaceNSE(m_XOp, config, D, BcMap, LsTrk);                                                          // surface stress tensor
            Solution.XNSECommon.XOperatorComponentsFactory.AddSurfaceTensionForce(m_XOp, config, D, BcMap, LsTrk, degU, out NormalsRequired, out CurvatureRequired); // surface tension force

            if (config.isContinuity)
            {
                Solution.XNSECommon.XOperatorComponentsFactory.AddInterfaceContinuityEq(m_XOp, config, D, LsTrk);       // continuity equation
            }
            // add kinetic energy equation components
            // ======================================
            if (config.solveEnergy)
            {
                // species bulk components
                for (int spc = 0; spc < LsTrk.TotalNoOfSpecies; spc++)
                {
                    Solution.EnergyCommon.XOperatorComponentsFactory.AddSpeciesKineticEnergyEquation(m_XOp, config, D, LsTrk.SpeciesNames[spc], LsTrk.SpeciesIdS[spc], BcMap, LsTrk);
                }

                // interface components
                Solution.EnergyCommon.XOperatorComponentsFactory.AddInterfaceKineticEnergyEquation(m_XOp, config, D, BcMap, LsTrk, degU);
                CurvatureRequired = true;
            }


            // add Heat equation components
            // ============================
            if (config.solveHeat)
            {
                // species bulk components
                for (int spc = 0; spc < LsTrk.TotalNoOfSpecies; spc++)
                {
                    Solution.XheatCommon.XOperatorComponentsFactory.AddSpeciesHeatEq(m_XOp, config,
                                                                                     D, LsTrk.SpeciesNames[spc], LsTrk.SpeciesIdS[spc], thermBcMap, LsTrk);
                }

                // interface components
                Solution.XheatCommon.XOperatorComponentsFactory.AddInterfaceHeatEq(m_XOp, config, D, thermBcMap, LsTrk);
            }


            // add Evaporation interface components
            // ====================================

            if (config.isEvaporation)
            {
                XOperatorComponentsFactory.AddInterfaceNSE_withEvaporation(m_XOp, config, D, LsTrk);
                if (config.isContinuity)
                {
                    XOperatorComponentsFactory.AddInterfaceContinuityEq_withEvaporation(m_XOp, config, D, LsTrk);
                }
            }

            // create temporal operator
            // ========================
            var TempOp = new ConstantXTemporalOperator(m_XOp, 0.0);

            m_XOp.TemporalOperator = TempOp;
            foreach (var kv in MassScale)
            {
                TempOp.DiagonalScale[LsTrk.GetSpeciesName(kv.Key)].SetV(kv.Value.ToArray());
            }

            // Finalize
            // ========

            m_XOp.Commit();
        }
示例#6
0
        /// <summary>
        /// ctor for the operator factory, where the equation compnents are set
        /// </summary>
        /// <param name="config"></param>
        /// <param name="_LsTrk"></param>
        /// <param name="_HMFdegree"></param>
        /// <param name="BcMap"></param>
        /// <param name="degU"></param>
        public XNSFE_OperatorFactory(XNSFE_OperatorConfiguration _config, LevelSetTracker _LsTrk, int _HMFdegree, IncompressibleMultiphaseBoundaryCondMap BcMap, int degU)
        {
            this.config = _config;
            this.LsTrk  = _LsTrk;
            this.D      = _LsTrk.GridDat.SpatialDimension;

            this.HMFDegree = _HMFdegree;

            this.physParams  = config.getPhysParams;
            this.thermParams = config.getThermParams;
            this.dntParams   = config.getDntParams;


            // test input
            // ==========
            {
                if (config.getDomBlocks.GetLength(0) != 2 || config.getCodBlocks.GetLength(0) != 2)
                {
                    throw new ArgumentException();
                }

                if ((config.getPhysParams.mu_A <= 0) && (config.getPhysParams.mu_B <= 0))
                {
                    config.isViscous = false;
                }
                else
                {
                    if ((config.getPhysParams.mu_A <= 0) || (config.getPhysParams.mu_B <= 0))
                    {
                        throw new ArgumentException();
                    }
                }

                if ((config.getPhysParams.rho_A <= 0) || (config.getPhysParams.rho_B <= 0))
                {
                    throw new ArgumentException();
                }

                if (_LsTrk.SpeciesNames.Count != 2)
                {
                    throw new ArgumentException();
                }
                if (!(_LsTrk.SpeciesNames.Contains("A") && _LsTrk.SpeciesNames.Contains("B")))
                {
                    throw new ArgumentException();
                }
            }

            // full operator:
            // ==============
            CodName = ArrayTools.Cat(EquationNames.MomentumEquations(D), EquationNames.ContinuityEquation);
            Params  = ArrayTools.Cat(
                VariableNames.Velocity0Vector(D),
                VariableNames.Velocity0MeanVector(D),
                VariableNames.NormalVector(D),
                VariableNames.Curvature,
                VariableNames.SurfaceForceVector(D),
                VariableNames.Temperature0,
                VariableNames.HeatFlux0Vector(D),
                VariableNames.DisjoiningPressure
                );
            DomName = ArrayTools.Cat(VariableNames.VelocityVector(D), VariableNames.Pressure);


            // selected part:
            if (config.getCodBlocks[0])
            {
                CodNameSelected = ArrayTools.Cat(CodNameSelected, CodName.GetSubVector(0, D));
            }
            if (config.getCodBlocks[1])
            {
                CodNameSelected = ArrayTools.Cat(CodNameSelected, CodName.GetSubVector(D, 1));
            }

            if (config.getDomBlocks[0])
            {
                DomNameSelected = ArrayTools.Cat(DomNameSelected, DomName.GetSubVector(0, D));
            }
            if (config.getDomBlocks[1])
            {
                DomNameSelected = ArrayTools.Cat(DomNameSelected, DomName.GetSubVector(D, 1));
            }


            // create Operator
            // ===============
            m_XOp = new XSpatialOperatorMk2(DomNameSelected, Params, CodNameSelected, (A, B, C) => _HMFdegree, this.LsTrk.SpeciesIdS.ToArray());

            // add Navier-Stokes components
            // ============================

            // species bulk components
            for (int spc = 0; spc < LsTrk.TotalNoOfSpecies; spc++)
            {
                // Navier Stokes equations
                Solution.XNSECommon.XOperatorComponentsFactory.AddSpeciesNSE(m_XOp, config, D, LsTrk.SpeciesNames[spc], LsTrk.SpeciesIdS[spc], BcMap, LsTrk, out U0meanrequired);

                // continuity equation
                if (config.isContinuity)
                {
                    Solution.XNSECommon.XOperatorComponentsFactory.AddSpeciesContinuityEq(m_XOp, config, D, LsTrk.SpeciesNames[spc], LsTrk.SpeciesIdS[spc], BcMap);
                }
            }

            // interface components
            Solution.XNSECommon.XOperatorComponentsFactory.AddInterfaceNSE(m_XOp, config, D, BcMap, LsTrk);                                                          // surface stress tensor
            Solution.XNSECommon.XOperatorComponentsFactory.AddSurfaceTensionForce(m_XOp, config, D, BcMap, LsTrk, degU, out NormalsRequired, out CurvatureRequired); // surface tension force

            if (config.isContinuity)
            {
                Solution.XNSECommon.XOperatorComponentsFactory.AddInterfaceContinuityEq(m_XOp, config, D, LsTrk);       // continuity equation
            }
            // add Evaporation interface components
            // ====================================

            if (config.isEvaporation)
            {
                XOperatorComponentsFactory.AddInterfaceNSE_withEvaporation(m_XOp, config, D, LsTrk);

                if (config.isContinuity)
                {
                    XOperatorComponentsFactory.AddInterfaceContinuityEq_withEvaporation(m_XOp, config, D, LsTrk);
                }
            }


            m_XOp.Commit();
        }
示例#7
0
        //==============================================================
        // additional interface components for NSFE interface components
        //==============================================================


        /// <summary>
        ///
        /// </summary>
        /// <param name="XOp"></param>
        /// <param name="config"></param>
        /// <param name="d"></param>
        /// <param name="D"></param>
        /// <param name="LsTrk"></param>
        public static void AddInterfaceNSE_withEvaporation_component(XSpatialOperatorMk2 XOp, XNSFE_OperatorConfiguration config,
                                                                     int d, int D, LevelSetTracker LsTrk)
        {
            // check input
            if (XOp.IsCommited)
            {
                throw new InvalidOperationException("Spatial Operator is already comitted. Adding of new components is not allowed");
            }

            string CodName = EquationNames.MomentumEquationComponent(d);

            if (!XOp.CodomainVar.Contains(CodName))
            {
                throw new ArgumentException("CoDomain variable \"" + CodName + "\" is not defined in Spatial Operator");
            }

            PhysicalParameters   physParams  = config.getPhysParams;
            ThermalParameters    thermParams = config.getThermParams;
            DoNotTouchParameters dntParams   = config.getDntParams;

            double sigma = physParams.Sigma;


            // set components
            var comps = XOp.EquationComponents[CodName];


            if (config.isTransport)
            {
                comps.Add(new ConvectionAtLevelSet_nonMaterialLLF(d, D, LsTrk, thermParams, sigma));
                comps.Add(new ConvectionAtLevelSet_Consistency(d, D, LsTrk, dntParams.ContiSign, dntParams.RescaleConti, thermParams, sigma));
            }

            if (config.isMovingMesh)
            {
                comps.Add(new ConvectionAtLevelSet_MovingMesh(d, D, LsTrk, thermParams, sigma));
            }

            if (config.isViscous)
            {
                comps.Add(new ViscosityAtLevelSet_FullySymmetric_withEvap(LsTrk, physParams.mu_A, physParams.mu_B, dntParams.PenaltySafety, d, thermParams, sigma));
            }

            comps.Add(new MassFluxAtInterface(d, D, LsTrk, thermParams, sigma));
        }
示例#8
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="XOp"></param>
        /// <param name="config"></param>
        /// <param name="D"></param>
        /// <param name="LsTrk"></param>
        public static void AddInterfaceContinuityEq_withEvaporation(XSpatialOperatorMk2 XOp, XNSFE_OperatorConfiguration config, int D, LevelSetTracker LsTrk)
        {
            // check input
            if (XOp.IsCommited)
            {
                throw new InvalidOperationException("Spatial Operator is already comitted. Adding of new components is not allowed");
            }

            string CodName = EquationNames.ContinuityEquation;

            if (!XOp.CodomainVar.Contains(CodName))
            {
                throw new ArgumentException("CoDomain variable \"" + CodName + "\" is not defined in Spatial Operator");
            }


            ThermalParameters    thermParams = config.getThermParams;
            DoNotTouchParameters dntParams   = config.getDntParams;

            // set components
            var comps = XOp.EquationComponents[CodName];

            var divEvap = new DivergenceAtLevelSet_withEvaporation(D, LsTrk, dntParams.ContiSign, dntParams.RescaleConti, thermParams, config.getPhysParams.Sigma);

            comps.Add(divEvap);
        }