Exemplo n.º 1
0
        /// <summary>
        /// Ctor for low Mach number flows.
        /// </summary>
        /// <param name="Component"></param>
        /// <param name="Bcmap"></param>
        /// <param name="EoS"></param>
        public Divergence_CentralDifferenceJacobian(int Component, IncompressibleBoundaryCondMap Bcmap, int SpatDim, MaterialLaw EoS, int NumberOfSpecies = -1)
            : this(Component, Bcmap, SpatDim)
        {
            this.EoS = EoS;

            switch (Bcmap.PhysMode)
            {
            case PhysicsMode.Incompressible:
            case PhysicsMode.Multiphase:
                throw new ApplicationException("Wrong constructor");

            case PhysicsMode.MixtureFraction:
                m_ArgumentOrdering   = ArrayTools.Cat(VariableNames.VelocityVector(SpatDim), new string[] { VariableNames.MixtureFraction });
                m_ParameterOrdering  = null;
                this.NumberOfSpecies = NumberOfSpecies;
                break;

            case PhysicsMode.LowMach:
                m_ArgumentOrdering = ArrayTools.Cat(VariableNames.VelocityVector(SpatDim), new string[] { VariableNames.Temperature });
                break;

            case PhysicsMode.Combustion:
                if (NumberOfSpecies == -1)
                {
                    throw new ArgumentException("NumberOfSpecies must be specified for combustion flows.");
                }
                string[] Parameters = ArrayTools.Cat(new string[] { VariableNames.Temperature }, VariableNames.MassFractions(NumberOfSpecies - 1));
                this.NumberOfSpecies = NumberOfSpecies;
                m_ArgumentOrdering   = ArrayTools.Cat(VariableNames.VelocityVector(SpatDim), Parameters);
                break;

            default:
                throw new NotImplementedException();
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// ctor; parameter documentation see <see cref="swipViscosityBase.swipViscosityBase"/>.
 /// </summary>
 public swipViscosity_Term2(double _penalty, int iComp, int D, IncompressibleBoundaryCondMap bcmap,
                            ViscosityOption _ViscosityMode, ViscositySolverMode ViscSolverMode = ViscositySolverMode.FullyCoupled,
                            double constantViscosityValue = double.NaN, double reynolds = double.NaN, MaterialLaw EoS = null)
     : base(_penalty, iComp, D, bcmap, _ViscosityMode, constantViscosityValue, reynolds, EoS)
 {
     this.ViscSolverMode = ViscSolverMode;
 }
Exemplo n.º 3
0
        /// <summary>
        /// Ctor.
        /// </summary>
        /// <param name="Reynolds"></param>
        /// <param name="Schmidt"></param>
        /// <param name="EoS">Material law</param>
        /// <param name="PenaltyBase">C.f. Calculation of SIP penalty base, cf. Chapter 3 in
        /// K. Hillewaert, “Development of the discontinuous Galerkin method for high-resolution, large scale CFD and acoustics in industrial geometries”,
        /// Université catholique de Louvain, 2013.</param>
        /// <param name="BcMap">Boundary condition map</param>
        /// <param name="Mode">Equation type. Can be Temperature or MassFraction</param>
        /// <param name="Argument">The argument of the flux. Must be compatible with the DiffusionMode.</param>
        /// <param name="PenaltyLengthScales"></param>
        public SIPDiffusion(double Reynolds, double Schmidt, MaterialLaw EoS, double PenaltyBase, MultidimensionalArray PenaltyLengthScales, IncompressibleBoundaryCondMap BcMap, DiffusionMode Mode, string Argument)
        {
            this.m_Reynolds       = Reynolds;
            this.m_Schmidt        = Schmidt;
            this.EoS              = EoS;
            this.PenaltyBase      = PenaltyBase;
            this.BcMap            = BcMap;
            this.ArgumentFunction = BcMap.bndFunction[Argument];
            this.Mode             = Mode;
            this.Argument         = Argument;
            this.cj = PenaltyLengthScales;
            switch (BcMap.PhysMode)
            {
            case PhysicsMode.LowMach:
                this.m_ParameterOrdering = new string[] { VariableNames.Temperature0 };
                break;

            case PhysicsMode.Combustion:
                this.m_ParameterOrdering = new string[] { VariableNames.Temperature0, VariableNames.MassFraction0_0, VariableNames.MassFraction1_0, VariableNames.MassFraction2_0, VariableNames.MassFraction3_0 };
                break;

            default:
                throw new ApplicationException("Wrong physicsMode");
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Ctor for low Mach number flows.
        /// </summary>
        /// <param name="Component"></param>
        /// <param name="Bcmap"></param>
        /// <param name="EoS"></param>
        public Divergence_CentralDifference(int Component, IncompressibleBoundaryCondMap Bcmap, MaterialLaw EoS, int NumberOfReactants = -1)
            : this(Component, Bcmap)
        {
            this.EoS = EoS;
            switch (Bcmap.PhysMode)
            {
            case PhysicsMode.Incompressible:
            case PhysicsMode.Multiphase:
                throw new ApplicationException("Wrong constructor");

            case PhysicsMode.LowMach:
                this.m_ParamterOrdering = new string[] { VariableNames.Temperature0 };
                break;

            case PhysicsMode.Combustion:
                this.m_ParamterOrdering = ArrayTools.Cat(new string[] { VariableNames.Temperature0 }, VariableNames.MassFractions0(NumberOfReactants));
                this.NumberOfReactants  = NumberOfReactants;
                if (NumberOfReactants == -1)
                {
                    throw new ArgumentException("NumberOfReactants must be specified for combustion flows.");
                }
                break;

            default:
                throw new NotImplementedException();
            }
        }
Exemplo n.º 5
0
 /// <summary>
 /// Ctor for incompressible flows.
 /// </summary>
 /// <param name="Component"></param>
 /// <param name="Bcmap"></param>
 public Divergence_CentralDifferenceJacobian(int Component, IncompressibleBoundaryCondMap Bcmap, int SpatDim)
 {
     this.Component     = Component;
     this.Bcmap         = Bcmap;
     this.VelFunction   = Bcmap.bndFunction[VariableNames.Velocity_d(Component)];
     m_SpatialDimension = SpatDim;
     m_ArgumentOrdering = ArrayTools.Cat(VariableNames.VelocityVector(SpatDim));
 }
Exemplo n.º 6
0
            /// <summary>
            /// Cartesian grid, nothing fancy.
            /// </summary>
            public void CreateGrid(Context _Context, out GridCommons grd, out IncompressibleBoundaryCondMap bcMap)
            {
                grd = new Cartesian2DGrid(_Context.CommMaster, Grid1D.Linspace(-2, 2, 10), Grid1D.Linspace(-2, 2, 10));
                grd.EdgeTagsNames.Add(1, "Pressure_Outlet");
                grd.DefineEdgeTags(x => 1);

                bcMap = null;
            }
Exemplo n.º 7
0
 /// <summary>
 /// Ctor.
 /// </summary>
 /// <param name="Reynolds"></param>
 /// <param name="Prandtl"></param>
 /// <param name="EoS"></param>
 /// <param name="PenaltyBase"></param>
 /// <param name="BcMap"></param>
 public swipHeatConduction(double Reynolds, double Prandtl, MaterialLaw EoS, double PenaltyBase, IncompressibleBoundaryCondMap BcMap)
 {
     this.Reynolds            = Reynolds;
     this.Prandtl             = Prandtl;
     this.EoS                 = EoS;
     this.PenaltyBase         = PenaltyBase;
     this.BcMap               = BcMap;
     this.TemperatureFunction = BcMap.bndFunction[VariableNames.Temperature];
 }
Exemplo n.º 8
0
        /// <summary>
        /// Ctor for incompressible flows.
        /// </summary>
        /// <param name="SpatDim">
        /// Spatial dimension (either 2 or 3).
        /// </param>
        /// <param name="_bcmap"></param>
        /// <param name="_component"></param>
        /// <param name="UseBoundaryVelocityParameter">
        /// True, if (an offset to) the boundary velocity is supplied in form of parameter variables.
        /// </param>
        public LinearizedConvection(int SpatDim, IncompressibleBoundaryCondMap _bcmap, int _component, bool UseBoundaryVelocityParameter = false)
            : this(SpatDim, _bcmap, _component)
        {
            m_UseBoundaryVelocityParameter = UseBoundaryVelocityParameter;

            m_ParameterOrdering = ArrayTools.Cat(VariableNames.Velocity0Vector(SpatDim), VariableNames.Velocity0MeanVector(SpatDim));
            if (m_UseBoundaryVelocityParameter)
            {
                m_ParameterOrdering = ArrayTools.Cat(m_ParameterOrdering, VariableNames.BoundaryVelocityVector(SpatDim));
            }
        }
Exemplo n.º 9
0
        /// <summary>
        /// Ctor
        /// </summary>
        /// <param name="SpatDim">Spatial dimension (either 2 or 3)</param>
        /// <param name="BcMap"></param>
        /// <param name="EoS">Null for multiphase. Has to be given for Low-Mach and combustion to calculate density.</param>
        /// <param name="Argument">Variable name of the argument (e.g. "Temperature" or "MassFraction0")</param>
        public LinearizedScalarConvection2(int SpatDim, int NumberOfReactants, IncompressibleBoundaryCondMap BcMap, MaterialLaw EoS, string Argument = null)
        {
            this.NumberOfReactants = NumberOfReactants;
            m_SpatialDimension     = SpatDim;
            m_bcmap = BcMap;

            switch (BcMap.PhysMode)
            {
            case PhysicsMode.Multiphase:
                this.Argument       = VariableNames.LevelSet;
                m_ArgumentOrdering  = new string[] { VariableNames.LevelSet };
                m_ParameterOrdering = ArrayTools.Cat(VariableNames.Velocity0Vector(SpatDim), VariableNames.Velocity0MeanVector(SpatDim));
                break;

            case PhysicsMode.LowMach:
                this.Argument       = VariableNames.Temperature;
                m_ParameterOrdering = ArrayTools.Cat(VariableNames.Velocity0Vector(SpatDim), VariableNames.Velocity0MeanVector(SpatDim),
                                                     VariableNames.Temperature0, VariableNames.Temperature0Mean);
                m_ArgumentOrdering = new string[] { VariableNames.Temperature };
                if (EoS == null)
                {
                    throw new ApplicationException("EoS has to be given for Low-Mach flows to calculate density.");
                }
                else
                {
                    this.EoS = EoS;
                }
                break;

            case PhysicsMode.Combustion:
                this.Argument       = Argument;
                m_ParameterOrdering = ArrayTools.Cat(
                    VariableNames.Velocity0Vector(SpatDim),
                    VariableNames.Velocity0MeanVector(SpatDim),
                    VariableNames.Temperature0,
                    VariableNames.MassFractions0(NumberOfReactants),
                    VariableNames.Temperature0Mean,
                    VariableNames.MassFractionsMean(NumberOfReactants));
                m_ArgumentOrdering = new string[] { Argument };
                if (EoS == null)
                {
                    throw new ApplicationException("EoS has to be given for Low-Mach flows to calculate density.");
                }
                else
                {
                    this.EoS = EoS;
                }
                break;

            default:
                throw new NotImplementedException();
            }
        }
Exemplo n.º 10
0
 /// <summary>
 /// Ctor.
 /// </summary>
 /// <param name="Reynolds"></param>
 /// <param name="Schmidt"></param>
 /// <param name="EoS">Material law</param>
 /// <param name="PenaltyBase">C.f. Calculation of SIP penalty base, cf. Chapter 3 in
 /// K. Hillewaert, “Development of the discontinuous Galerkin method for high-resolution, large scale CFD and acoustics in industrial geometries”,
 /// Université catholique de Louvain, 2013.</param>
 /// <param name="BcMap">Boundary condition map</param>
 /// <param name="Mode">Equation type. Can be Temperature or MassFraction</param>
 /// <param name="Argument">The argument of the flux. Must be compatible with the DiffusionMode.</param>
 /// <param name="PenaltyLengthScales"></param>
 public SIPDiffusion(double Reynolds, double Schmidt, MaterialLaw EoS, double PenaltyBase, MultidimensionalArray PenaltyLengthScales, IncompressibleBoundaryCondMap BcMap, DiffusionMode Mode, string Argument)
 {
     this.Reynolds         = Reynolds;
     this.Schmidt          = Schmidt;
     this.EoS              = EoS;
     this.PenaltyBase      = PenaltyBase;
     this.BcMap            = BcMap;
     this.ArgumentFunction = BcMap.bndFunction[Argument];
     this.Mode             = Mode;
     this.Argument         = Argument;
     this.cj = PenaltyLengthScales;
 }
Exemplo n.º 11
0
        /// <summary>
        /// Ctor for common part of incompressible and low Mach number flows.
        /// </summary>
        public UpwindMomentumConvection(int SpatDim, IncompressibleBoundaryCondMap _bcmap, int _component, double __rho)
        {
            m_SpatialDimension = SpatDim;
            m_bcmap            = _bcmap;
            m_component        = _component;
            m_rho = __rho;

            velFunction = new Func <double[], double, double> [m_bcmap.MaxEdgeTagNo, SpatDim];
            for (int d = 0; d < SpatDim; d++)
            {
                velFunction.SetColumn(m_bcmap.bndFunction[VariableNames.Velocity_d(d)], d);
            }
        }
Exemplo n.º 12
0
        /// <summary>
        /// ctor.
        /// </summary>
        /// <param name="_penaltyBase"></param>
        /// <param name="iComp">
        /// component index
        /// </param>
        /// <param name="D">
        /// spatial dimension.
        /// </param>
        /// <param name="bcmap"></param>
        /// <param name="_ViscosityMode">
        /// see <see cref="ViscosityOption"/>
        /// </param>
        /// <param name="constantViscosityValue">
        /// Constant value for viscosity.
        /// Needs to be given for <see cref="ViscosityOption.ConstantViscosity"/>.
        /// </param>
        /// <param name="reynolds">
        /// Reynolds number for dimensionless formulation.
        /// Needs to be given for <see cref="ViscosityOption.ConstantViscosityDimensionless"/> and <see cref="ViscosityOption.VariableViscosityDimensionless"/>.
        /// </param>
        /// <param name="EoS">
        /// Optional material law for calculating the viscosity
        /// as a function of the level-set.
        /// Only available for <see cref="ViscosityOption.VariableViscosity"/> and <see cref="ViscosityOption.VariableViscosityDimensionless"/>.
        /// </param>
        protected swipViscosityBase(
            double _penaltyBase,
            int iComp, int D, IncompressibleBoundaryCondMap bcmap,
            ViscosityOption _ViscosityMode, double constantViscosityValue = double.NaN, double reynolds = double.NaN, MaterialLaw EoS = null)
        {
            //Func<double, int, int, MultidimensionalArray, double> ComputePenalty = null) {
            this.m_penalty_base = _penaltyBase;
            //this.m_ComputePenalty = ComputePenalty;
            this.m_iComp = iComp;
            this.m_D     = D;
            //this.cj = PenaltyLengthScales;
            velFunction        = D.ForLoop(d => bcmap.bndFunction[VariableNames.Velocity_d(d)]);
            EdgeTag2Type       = bcmap.EdgeTag2Type;
            this.m_PhysicsMode = bcmap.PhysMode;

            this.m_ViscosityMode = _ViscosityMode;
            switch (_ViscosityMode)
            {
            case ViscosityOption.ConstantViscosity:
                if (double.IsNaN(constantViscosityValue))
                {
                    throw new ArgumentException("constantViscosityValue is missing!");
                }
                this.m_constantViscosityValue = constantViscosityValue;
                break;

            case ViscosityOption.ConstantViscosityDimensionless:
                if (double.IsNaN(reynolds))
                {
                    throw new ArgumentException("reynolds number is missing!");
                }
                this.m_reynolds = reynolds;
                break;

            case ViscosityOption.VariableViscosity:
                this.m_EoS = EoS;
                break;

            case ViscosityOption.VariableViscosityDimensionless:
                if (double.IsNaN(reynolds))
                {
                    throw new ArgumentException("reynolds number is missing!");
                }
                this.m_reynolds = reynolds;
                this.m_EoS      = EoS;
                break;

            default:
                throw new NotImplementedException();
            }
        }
Exemplo n.º 13
0
        /// <summary>
        /// Ctor for common part of incompressible and low Mach number flows.
        /// </summary>
        /// <param name="SpatDim"></param>
        /// <param name="_bcmap"></param>
        /// <param name="_component"></param>
        private LinearizedConvection(int SpatDim, IncompressibleBoundaryCondMap _bcmap, int _component)
        {
            m_SpatialDimension = SpatDim;
            m_bcmap            = _bcmap;
            m_component        = _component;

            velFunction = new Func <double[], double, double> [GridCommons.FIRST_PERIODIC_BC_TAG, SpatDim];
            for (int d = 0; d < SpatDim; d++)
            {
                velFunction.SetColumn(m_bcmap.bndFunction[VariableNames.Velocity_d(d)], d);
            }

            PhysMode = _bcmap.PhysMode;
        }
Exemplo n.º 14
0
        /// <summary>
        /// Ctor.
        /// </summary>
        /// <param name="SpatDimension"></param>
        /// <param name="EoS"></param>
        /// <param name="bcmap"></param>
        public CoupledLaxFriedrichsScalar(int SpatDimension, MaterialLaw EoS, IncompressibleBoundaryCondMap bcmap)
        {
            this.SpatDimension = SpatDimension;
            this.EoS           = EoS;
            this.bcmap         = bcmap;

            velFunction = new Func <double[], double, double> [GridCommons.FIRST_PERIODIC_BC_TAG, SpatDimension];
            for (int d = 0; d < SpatDimension; d++)
            {
                velFunction.SetColumn(bcmap.bndFunction[VariableNames.Velocity_d(d)], d);
            }

            scalarFunction = bcmap.bndFunction[VariableNames.LevelSet];
        }
Exemplo n.º 15
0
        /// <summary>
        /// Ctor for variable density flows,
        /// i.e. low Mach number flows and
        /// multiphase flows with smooth interface.
        /// </summary>
        /// <param name="SpatDim">
        /// Spatial dimension (either 2 or 3).
        /// </param>
        /// <param name="_bcmap"></param>
        /// <param name="_component"></param>
        /// <param name="EoS">
        /// Material law for variable density flows.
        /// </param>
        public LinearizedConvection(int SpatDim, IncompressibleBoundaryCondMap _bcmap, int _component, MaterialLaw EoS, int NumberOfReactants = -1)
            : this(SpatDim, _bcmap, _component)
        {
            //m_VariableDensity = true;
            this.EoS = EoS;
            this.NumberOfReactants = NumberOfReactants;

            switch (_bcmap.PhysMode)
            {
            case PhysicsMode.LowMach:
                scalarFunction      = m_bcmap.bndFunction[VariableNames.Temperature];
                m_ParameterOrdering = ArrayTools.Cat(VariableNames.Velocity0Vector(SpatDim),
                                                     VariableNames.Velocity0MeanVector(SpatDim),
                                                     VariableNames.Temperature0,
                                                     VariableNames.Temperature0Mean);
                break;

            case PhysicsMode.Multiphase:
                scalarFunction      = m_bcmap.bndFunction[VariableNames.LevelSet];
                m_ParameterOrdering = ArrayTools.Cat(VariableNames.Velocity0Vector(SpatDim),
                                                     VariableNames.Velocity0MeanVector(SpatDim),
                                                     VariableNames.Phi0,
                                                     VariableNames.Phi0Mean);
                break;

            case PhysicsMode.Combustion:
                if (NumberOfReactants == -1)
                {
                    throw new ArgumentException("NumberOfReactants needs to be specified!");
                }
                m_ParameterOrdering = ArrayTools.Cat(
                    VariableNames.Velocity0Vector(SpatDim),
                    VariableNames.Velocity0MeanVector(SpatDim),
                    VariableNames.Temperature0,
                    VariableNames.MassFractions0(NumberOfReactants),
                    VariableNames.Temperature0Mean,
                    VariableNames.MassFractionsMean(NumberOfReactants));
                break;

            case PhysicsMode.Viscoelastic:
                throw new ApplicationException("Using of wrong constructor for viscoelastic flows.");

            case PhysicsMode.Incompressible:
                throw new ApplicationException("Using of wrong constructor for incompressible flows.");

            default:
                throw new NotImplementedException();
            }
        }
Exemplo n.º 16
0
        /// <summary>
        /// Ctor
        /// intended for use in the context of RANS turbulence model equations
        /// </summary>
        public LinearizedScalarConvection(int SpatDim, IncompressibleBoundaryCondMap BcMap, string TurbulentVariable, string TurbulentVariable0, string TurbulentVariable0Mean)
        {
            if (BcMap.PhysMode != PhysicsMode.RANS)
            {
                throw new ApplicationException("This Constructor is only intended for RANS turbulence model equations");
            }
            m_SpatialDimension = SpatDim;
            m_bcmap            = BcMap;

            velFunction = new Func <double[], double, double> [SpatDim][];
            for (int d = 0; d < SpatDim; d++)
            {
                velFunction[d] = m_bcmap.bndFunction[VariableNames.Velocity_d(d)];
            }

            scalarFunction      = m_bcmap.bndFunction[TurbulentVariable];
            m_ArgumentOrdering  = new string[] { TurbulentVariable };
            m_ParameterOrdering = ArrayTools.Cat(VariableNames.Velocity0Vector(SpatDim), VariableNames.Velocity0MeanVector(SpatDim),
                                                 TurbulentVariable0, TurbulentVariable0Mean);
        }
Exemplo n.º 17
0
        /// <summary>
        /// Ctor
        /// </summary>
        /// <param name="SpatDim">Spatial dimension (either 2 or 3)</param>
        /// <param name="BcMap"></param>
        /// <param name="EoS">
        /// Null for multiphase.
        /// Has to be given for Low-Mach to calculate density.
        /// </param>
        public LinearizedScalarConvection(int SpatDim, IncompressibleBoundaryCondMap BcMap, MaterialLaw EoS)
        {
            m_SpatialDimension = SpatDim;
            m_bcmap            = BcMap;

            velFunction = new Func <double[], double, double> [SpatDim][];
            for (int d = 0; d < SpatDim; d++)
            {
                velFunction[d] = m_bcmap.bndFunction[VariableNames.Velocity_d(d)];
            }

            switch (BcMap.PhysMode)
            {
            case PhysicsMode.Multiphase:
                scalarFunction      = m_bcmap.bndFunction[VariableNames.LevelSet];
                m_ArgumentOrdering  = new string[] { VariableNames.LevelSet };
                m_ParameterOrdering = ArrayTools.Cat(VariableNames.Velocity0Vector(SpatDim), VariableNames.Velocity0MeanVector(SpatDim));
                break;

            case PhysicsMode.LowMach:
            case PhysicsMode.Combustion:
                scalarFunction      = m_bcmap.bndFunction[VariableNames.Temperature];
                m_ArgumentOrdering  = new string[] { VariableNames.Temperature };
                m_ParameterOrdering = ArrayTools.Cat(VariableNames.Velocity0Vector(SpatDim), VariableNames.Velocity0MeanVector(SpatDim),
                                                     VariableNames.Temperature0, VariableNames.Temperature0Mean);
                if (EoS == null)
                {
                    throw new ApplicationException("EoS has to be given for Low-Mach flows to calculate density.");
                }
                else
                {
                    this.EoS = EoS;
                }
                break;

            default:
                throw new NotImplementedException();
            }
        }
Exemplo n.º 18
0
 /// <summary>
 /// ctor; parameter documentation see <see cref="swipViscosityBase.swipViscosityBase"/>.
 /// </summary>
 public swipViscosity_Term1(double _penalty, int iComp, int D, IncompressibleBoundaryCondMap bcmap,
                            ViscosityOption _ViscosityMode, double constantViscosityValue = double.NaN, double reynolds = double.NaN, MaterialLaw EoS = null)
 //Func<double, int, int, MultidimensionalArray, double> ComputePenalty = null)
     : base(_penalty, iComp, D, bcmap, _ViscosityMode, constantViscosityValue, reynolds, EoS)
 {
 }
Exemplo n.º 19
0
        /// <summary>
        /// Ctor
        /// </summary>
        /// <param name="SpatDim">Spatial dimension (either 2 or 3)</param>
        /// <param name="NumberOfReactants"></param>
        /// <param name="BcMap"></param>
        /// <param name="EoS">Null for multiphase. Has to be given for Low-Mach and combustion to calculate density.</param>
        /// <param name="idx">Index of scalar in array, </param>
        /// <param name="Argument">Variable name of the argument (e.g. "Temperature" or "MassFraction0")</param>
        public LinearizedScalarConvection2Jacobi(int SpatDim, int NumberOfReactants, IncompressibleBoundaryCondMap BcMap, MaterialLaw EoS, int idx)
        {
            this.NumberOfReactants = NumberOfReactants;
            m_SpatialDimension     = SpatDim;
            m_bcmap       = BcMap;
            argumentIndex = m_SpatialDimension + idx;

            velFunction = new Func <double[], double, double> [GridCommons.FIRST_PERIODIC_BC_TAG, SpatDim];

            for (int d = 0; d < SpatDim; d++)
            {
                velFunction.SetColumn(m_bcmap.bndFunction[VariableNames.Velocity_d(d)], d);
            }


            switch (BcMap.PhysMode)
            {
            case PhysicsMode.Multiphase:
                //this.Argument = VariableNames.LevelSet;
                m_ArgumentOrdering = new string[] { VariableNames.LevelSet };
                break;

            case PhysicsMode.LowMach:

                m_ArgumentOrdering = ArrayTools.Cat(VariableNames.VelocityVector(SpatDim), VariableNames.Temperature);     // VelocityX,VelocityY,(VelocityZ), Temperature as variables.

                if (EoS == null)
                {
                    throw new ApplicationException("EoS has to be given for Low-Mach flows to calculate density.");
                }
                else
                {
                    this.EoS = EoS;
                }
                break;

            case PhysicsMode.MixtureFraction:
                ;
                m_ArgumentOrdering = ArrayTools.Cat(VariableNames.VelocityVector(SpatDim), VariableNames.MixtureFraction);     // VelocityX,VelocityY,(VelocityZ), MixtureFraction as variables.

                if (EoS == null)
                {
                    throw new ApplicationException("EoS has to be given for Low-Mach flows to calculate density.");
                }
                else
                {
                    this.EoS = EoS;
                }
                break;

            case PhysicsMode.Combustion:
                m_ArgumentOrdering = ArrayTools.Cat(VariableNames.VelocityVector(SpatDim), VariableNames.Temperature, VariableNames.MassFractions(NumberOfReactants - 1));     // u,v,w,T, Y0,Y1,Y2,Y3  as variables (Y4 is calculated as Y4 = 1- (Y0+Y1+Y2+Y3)
                if (EoS == null)
                {
                    throw new ApplicationException("EoS has to be given for Low-Mach flows to calculate density.");
                }
                else
                {
                    this.EoS = EoS;
                }
                break;

            default:
                throw new NotImplementedException();
            }
        }
Exemplo n.º 20
0
 /// <summary>
 /// ctor
 /// </summary>
 /// <param name="_d">
 /// spatial direction of derivative
 /// </param>
 /// <param name="bcmap"></param>
 public PressureGradientLin_d(int _d, IncompressibleBoundaryCondMap bcmap)
 {
     m_d              = _d;
     m_bcmap          = bcmap;
     pressureFunction = bcmap.bndFunction[VariableNames.Pressure];
 }
Exemplo n.º 21
0
 /// <summary>
 /// Ctor for incompressible flows.
 /// </summary>
 /// <param name="Component"></param>
 /// <param name="Bcmap"></param>
 public Divergence_CentralDifference(int Component, IncompressibleBoundaryCondMap Bcmap)
 {
     this.Component   = Component;
     this.Bcmap       = Bcmap;
     this.VelFunction = Bcmap.bndFunction[VariableNames.Velocity_d(Component)];
 }
 /// <summary>
 /// Ctor for incompressible flows.
 /// </summary>
 /// <param name="component">component of the divergence</param>
 /// <param name="bcmap"></param>
 public Divergence_DerivativeSource_Flux(int component, IncompressibleBoundaryCondMap bcmap) //, double PresPenalty2) {
 {
     this.component   = component;
     this.bcmap       = bcmap;
     this.bndFunction = bcmap.bndFunction[VariableNames.Velocity_d(component)];
 }
Exemplo n.º 23
0
 /// <summary>
 /// Ctor.
 /// </summary>
 public IP1_Flux_PressureCorrection(double penalty_base, MultidimensionalArray PenaltyLengthScales, IncompressibleBoundaryCondMap _BcMap)
     : base(penalty_base, PenaltyLengthScales, VariableNames.PresCor)
 {
     m_BcMap = _BcMap;
 }
Exemplo n.º 24
0
 /// <summary>
 /// ctor; parameter documentation see <see cref="swipViscosityBase.swipViscosityBase"/>.
 /// </summary>
 public swipViscosity_Term3(double _penalty, MultidimensionalArray PenaltyLengthScales, int iComp, int D, IncompressibleBoundaryCondMap bcmap,
                            ViscosityImplementation implMode, ViscosityOption _ViscosityMode, ViscositySolverMode ViscSolverMode = ViscositySolverMode.FullyCoupled,
                            double constantViscosityValue = double.NaN, double reynolds = double.NaN, MaterialLaw EoS = null)
     : base(_penalty, PenaltyLengthScales, iComp, D, bcmap, implMode, _ViscosityMode, constantViscosityValue, reynolds, EoS)
 {
     this.ViscSolverMode = ViscSolverMode;
 }