/// <summary> /// ... /// </summary> public override void PostRestart(double time, TimestepNumber timestep) { //InitLogEnergyOrrSommerfeld(); WorkingSet.Initialize(Control); // Create WorkingSetMatrices switch (Control.PhysicsMode) { case PhysicsMode.Incompressible: break; case PhysicsMode.LowMach: LowMachSIMPLEControl lowMachConf = Control as LowMachSIMPLEControl; m_WorkingSetMatrices = new VariableMatrices(base.GridData, WorkingSet.VelBasis, WorkingSet.PressureBasis, lowMachConf.EoS, WorkingSet.Temperature.Current); break; case PhysicsMode.Multiphase: MultiphaseSIMPLEControl multiphaseConf = Control as MultiphaseSIMPLEControl; m_WorkingSetMatrices = new VariableMatrices(base.GridData, WorkingSet.VelBasis, WorkingSet.PressureBasis, multiphaseConf.EoS, WorkingSet.Phi.Current); break; default: throw new NotImplementedException(); } WorkingSet.CheckForNanOrInf(Control); // push start values to history WorkingSet.Push(Control); }
/// <summary> /// Ctor. /// </summary> /// <param name="SolverConf"></param> /// <param name="WorkingSet"></param> /// <param name="WorkingSetMatrices"></param> public BaseSIMPLEStepVariableDensity(SolverConfiguration SolverConf, VariableSet WorkingSet, VariableMatrices WorkingSetMatrices) { this.SolverConf = SolverConf; this.WorkingSet = WorkingSet; this.WorkingSetMatrices = WorkingSetMatrices; // Construct BDF scheme for unsteady solver if (SolverConf.Control.Algorithm == SolutionAlgorithms.Unsteady_SIMPLE) { BDF = new BDFScheme(); } // Construct SIMPLEOperators UnsetteledCoordinateMapping VelocityMapping = new UnsetteledCoordinateMapping(WorkingSet.VelBasis); UnsetteledCoordinateMapping PressureMapping = new UnsetteledCoordinateMapping(WorkingSet.PressureBasis); Basis[] VelBasisS = new Basis[SolverConf.SpatialDimension]; for (int d = 0; d < SolverConf.SpatialDimension; d++) { VelBasisS[d] = WorkingSet.VelBasis; } UnsetteledCoordinateMapping VelocityVectorMapping = new UnsetteledCoordinateMapping(VelBasisS); OperatorsFlowField = GetOperatorsFlowField(VelocityMapping, VelocityVectorMapping, PressureMapping); // Construct matrix assemblies MatrixAssembliesFlowField = new MatrixFactoryVariableDensityFlowField( SolverConf, OperatorsFlowField, WorkingSetMatrices.Rho.Matrix, BDF, VelocityMapping, VelocityVectorMapping); }
/// <summary> /// Initializes velocity and pressure /// </summary> protected override void SetInitial() { //WriteQuadNodesOrrSommerfeld(); //InitOrrSommerfeld(); base.SetInitial(); //TaylorVortexHack(); WorkingSet.Initialize(Control); // Create WorkingSetMatrices switch (Control.PhysicsMode) { case PhysicsMode.Incompressible: break; case PhysicsMode.LowMach: LowMachSIMPLEControl lowMachConf = Control as LowMachSIMPLEControl; m_WorkingSetMatrices = new VariableMatrices(base.GridData, WorkingSet.VelBasis, WorkingSet.PressureBasis, lowMachConf.EoS, WorkingSet.Temperature.Current); break; case PhysicsMode.Multiphase: MultiphaseSIMPLEControl multiphaseConf = Control as MultiphaseSIMPLEControl; m_WorkingSetMatrices = new VariableMatrices(base.GridData, WorkingSet.VelBasis, WorkingSet.PressureBasis, multiphaseConf.EoS, WorkingSet.Phi.Current); break; default: throw new NotImplementedException(); } WorkingSet.CheckForNanOrInf(Control); // push start values to history WorkingSet.Push(Control); }
/// <summary> /// Ctor. /// </summary> /// <param name="SolverConf"></param> /// <param name="WorkingSet"></param> /// <param name="WorkingSetMatrices"></param> public SIMPLEStepLowMach(SolverConfiguration SolverConf, VariableSet WorkingSet, VariableMatrices WorkingSetMatrices) : base(SolverConf, WorkingSet, WorkingSetMatrices) { this.LowMachControl = SolverConf.Control as LowMachSIMPLEControl; if (this.LowMachControl == null) { throw new ArgumentException("Invalid config", nameof(SolverConf)); } // Construct SIMPLEOperators UnsetteledCoordinateMapping TemperatureMapping = new UnsetteledCoordinateMapping(WorkingSet.TemperatureBasis); UnsetteledCoordinateMapping PressureMapping = new UnsetteledCoordinateMapping(WorkingSet.PressureBasis); OperatorsTemperature = new OperatorFactoryTemperature( TemperatureMapping, PressureMapping, base.WorkingSet.Velocity.Current, base.WorkingSet.VelocityMean, base.WorkingSet.Temperature.Current, base.WorkingSet.TemperatureMean, SolverConf); // Construct matrix assemblies MatrixAssembliesTemperature = new MatrixFactoryTemperature( OperatorsTemperature, TemperatureMapping.GridDat.iLogicalCells.NoOfLocalUpdatedCells, WorkingSetMatrices.Rho.Matrix, SolverConf, base.BDF); }
/// <summary> /// Ctor. /// </summary> /// <param name="SolverConf"></param> /// <param name="WorkingSet"></param> /// <param name="WorkingSetMatrices"></param> public SIMPLEStepMultiphase(SolverConfiguration SolverConf, VariableSet WorkingSet, VariableMatrices WorkingSetMatrices) : base(SolverConf, WorkingSet, WorkingSetMatrices) { this.SolverConf = SolverConf; this.MultiphaseControl = SolverConf.Control as MultiphaseSIMPLEControl; if (this.MultiphaseControl == null) { throw new ArgumentException("Invalid configuration", nameof(SolverConf)); } // Construct SIMPLEOperators UnsetteledCoordinateMapping LevelSetMapping = new UnsetteledCoordinateMapping(WorkingSet.LevelSetBasis); OperatorsLevelSet = new OperatorFactoryLevelSet(LevelSetMapping, WorkingSet.Velocity.Current, WorkingSet.VelocityMean, SolverConf); // Construct matrix assemblies MatrixAssembliesLevelSet = new MatrixFactoryLevelSet(OperatorsLevelSet, LevelSetMapping.GridDat.iLogicalCells.NoOfLocalUpdatedCells, SolverConf, base.BDF); }