private SteelFlowProjectFile() : base() { inletNames = new List <string>(); upfaceNames = new List <string>(); symNames = new List <string>(); outletNames = new List <string>(); wallNames = new List <string>(); U = new FieldFile("U", Dimension.U, new InternalField(new VectorVar(0.0, 0.0, 0.0, true))); p = new FieldFile("p", Dimension.P, new InternalField(new ScalerVar(0, true))); k = new FieldFile("k", Dimension.K, new InternalField(new ScalerVar(0.001, true))); nut = new FieldFile("nut", Dimension.NU, new InternalField(new ScalerVar(0.0, true))); epsilon = new FieldFile("epsilon", Dimension.EPSILON, new InternalField(new ScalerVar(0.1, true))); this.Fields.AddRange(new FieldFile[] { U, p, k, nut, epsilon }); TransportProperties.AddPropertie("nu", new ScalerVar(Material.DynamicViscosity / Material.Density, Dimension.NU)); TurbulenceProperties.Model = new KEpsilon(); Ddt ddtSteady = new Ddt(Ddt.DdtTypes.steadyState); Interpolation ipLinear = new Interpolation(Interpolation.InterpolationTypes.linear); Interpolation ipUpwind = new Interpolation(Interpolation.InterpolationTypes.upwind); Grad gdGaussLinear = new Grad(Grad.GradTypes.Gauss, ipLinear); Grad gdGaussUpwind = new Grad(Grad.GradTypes.Gauss, ipUpwind); Div dvGaussUpwind = new Div(Div.DivTypes.Gauss, ipUpwind); Div dvGaussLinear = new Div(Div.DivTypes.Gauss, ipLinear); SnGrad sgLimitedCorrected = new SnGrad(SnGrad.SnGradTypes.limited, "corrected 0.33"); Laplacian lpGaussLinear = new Laplacian(Laplacian.LaplacianTypes.Gauss, ipLinear, sgLimitedCorrected); FvSchemes.AddDdtSchemes(ddtSteady); FvSchemes.AddGradSchemes(gdGaussLinear); FvSchemes.AddDivSchemes(dvGaussLinear); FvSchemes.AddDivSchemes("div(phi,U)", dvGaussUpwind); FvSchemes.AddDivSchemes("div(phi,k)", dvGaussUpwind); FvSchemes.AddDivSchemes("div(phi,epsilon)", dvGaussUpwind); FvSchemes.AddLaplacianSchemes(lpGaussLinear); FvSchemes.AddInterpolationSchemes(ipLinear); FvSchemes.AddSnGradSchemes(sgLimitedCorrected); Simple simple = new Simple(); simple.residual.SetResidual("p", 1e-4); simple.residual.SetResidual("U", 1e-4); simple.residual.SetResidual("\"(k|omega|epsilon)\"", 1e-4); FvSolution.Solution = simple; FvSolution.Relaxation.AddFieldFactor("p", 0.3); FvSolution.Relaxation.AddEquationFactor("U", 0.7); FvSolution.Relaxation.AddEquationFactor("\"(k|omega|epsilon).*\"", 0.7); GAMG gamgP = new GAMG("p", 1e-6, 0.1, Solver.SmootherTypes.GaussSeidel); SmootherSolver ssOther = new SmootherSolver("\"(U|k|omega|epsilon)\"", 1e-5, 0.1, Solver.SmootherTypes.GaussSeidel); GAMG gamgOther = new GAMG("\"(U|k|omega|epsilon)\"", 1e-6, 0.1, Solver.SmootherTypes.GaussSeidel); FvSolution.AddSolver(gamgP); FvSolution.AddSolver(ssOther); }
public void AddDdtSchemes(Ddt ddt) { AddDdtSchemes("default", ddt); }
public void AddDdtSchemes(string key, Ddt ddt) { _ddtSchemes.NewChild(key, ddt); }