Beispiel #1
0
        /// <summary>
        /// Creates a <see cref="SpatialOperator"/> with the equation
        /// components that have been assigned to this operator.
        /// </summary>
        /// <returns></returns>
        public SpatialOperator ToSpatialOperator(CNSFieldSet fieldSet)
        {
            SpatialOperator spatialOp = new SpatialOperator(
                CompressibleEnvironment.PrimalArgumentOrdering,
                GetParameterOrdering(fieldSet),
                CompressibleEnvironment.PrimalArgumentOrdering,
                QuadOrderFunc.NonLinearWithoutParameters(2));

            MapComponents(spatialOp);
            spatialOp.Commit();
            return(spatialOp);
        }
Beispiel #2
0
        public static SpatialOperator BuildEulerOperator(IGridData gridData, CompressibleControl control)
        {
            // Boundary condition map
            Material material = control.GetMaterial();
            IBoundaryConditionMap boundaryMap = new CompressibleBoundaryCondMap(gridData, control, material);

            // Initialize operator
            SpatialOperator EulerOperator = new SpatialOperator(
                new string[] { CompressibleVariables.Density, CompressibleVariables.Momentum.xComponent, CompressibleVariables.Momentum.yComponent, CompressibleVariables.Energy },
                new string[] { },
                new string[] { CompressibleVariables.Density, CompressibleVariables.Momentum.xComponent, CompressibleVariables.Momentum.yComponent, CompressibleVariables.Energy },
                QuadOrderFunc.NonLinearWithoutParameters(2)
                );

            // Map fluxes
            EulerOperator.EquationComponents[CompressibleVariables.Density].Add(new OptimizedHLLCDensityFlux(boundaryMap, material));
            EulerOperator.EquationComponents[CompressibleVariables.Momentum.xComponent].Add(new OptimizedHLLCMomentumFlux(boundaryMap, 0, material));
            EulerOperator.EquationComponents[CompressibleVariables.Momentum.yComponent].Add(new OptimizedHLLCMomentumFlux(boundaryMap, 1, material));
            EulerOperator.EquationComponents[CompressibleVariables.Energy].Add(new OptimizedHLLCEnergyFlux(boundaryMap, material));

            EulerOperator.Commit();

            return(EulerOperator);
        }