#r "BoSSSpad.dll"
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Data;
using System.Globalization;
using System.Threading;
using ilPSP;
using ilPSP.Utils;
using BoSSS.Platform;
using BoSSS.Foundation;
using BoSSS.Foundation.Grid;
using BoSSS.Foundation.Grid.Classic;
using BoSSS.Foundation.IO;
using BoSSS.Solution;
using BoSSS.Solution.Control;
using BoSSS.Solution.GridImport;
using BoSSS.Solution.Statistic;
using BoSSS.Solution.Utils;
using BoSSS.Solution.Gnuplot;
using BoSSS.Application.BoSSSpad;
using BoSSS.Application.XNSE_Solver;
using static BoSSS.Application.BoSSSpad.BoSSSshell;
using BoSSS.Foundation.Grid.RefElements;
using BoSSS.Platform.LinAlg;
using BoSSS.Solution.NSECommon;
using BoSSS.Application.XNSEC;
Init();
int[] dgDegree = new int[]{1,2,3,4};
int[] Resolutions = new int[]{6,7,8,9,10};
int numberOfMpiCores =4;
var NofCells = Resolutions.ToList().Select(r=> (int)Math.Pow(2,r)).ToArray();
string baseJobName = "ChamberedFlame";
NofCells
index | value |
---|---|
0 | 64 |
1 | 128 |
2 | 256 |
3 | 512 |
4 | 1024 |
BoSSSshell.WorkflowMgm.Init("DiffFlameConvergenceStudy");
Project name is set to 'DiffFlameConvergenceStudy'. Default Execution queue is chosen for the database. Opening existing database '\\fdygitrunner\ValidationTests\databases\DiffFlameConvergenceStudy'.
static var myBatch = GetDefaultQueue();
static var myDb = BoSSSshell.WorkflowMgm.DefaultDatabase;
wmg.Sessions
#0: DiffFlameConvergenceStudy Full_ChamberedFlameP4K1024 10/30/2023 11:04:04 60a4ec09... #1: DiffFlameConvergenceStudy Full_ChamberedFlameP3K1024 10/30/2023 11:03:11 b0cf0198... #2: DiffFlameConvergenceStudy Full_ChamberedFlameP3K512 10/30/2023 10:59:37 25cb6b0c... #3: DiffFlameConvergenceStudy Full_ChamberedFlameP2K1024 10/30/2023 11:02:18 c7ea598e... #4: DiffFlameConvergenceStudy Full_ChamberedFlameP4K512 10/30/2023 11:00:21 6ffaf12f... #5: DiffFlameConvergenceStudy Full_ChamberedFlameP1K1024 10/30/2023 11:01:25 1561b948... #6: DiffFlameConvergenceStudy Full_ChamberedFlameP2K512 10/30/2023 10:58:45 2aa17140... #7: DiffFlameConvergenceStudy Full_ChamberedFlameP4K256 10/30/2023 10:57:17 a369a690... #8: DiffFlameConvergenceStudy Full_ChamberedFlameP3K256 10/30/2023 10:56:25 5257756d... #9: DiffFlameConvergenceStudy Full_ChamberedFlameP1K512 10/30/2023 10:58:04 7eeb4b73... #10: DiffFlameConvergenceStudy Full_ChamberedFlameP2K256 10/30/2023 10:55:25 125c8d8c... #11: DiffFlameConvergenceStudy Full_ChamberedFlameP4K128 10/30/2023 10:52:44 09d523bd... #12: DiffFlameConvergenceStudy Full_ChamberedFlameP1K256 10/30/2023 10:54:14 3a5718bc... #13: DiffFlameConvergenceStudy Full_ChamberedFlameP3K128 10/30/2023 10:51:30 31812891... #14: DiffFlameConvergenceStudy Full_ChamberedFlameP2K128 10/30/2023 10:50:22 e31dbb32... #15: DiffFlameConvergenceStudy Full_ChamberedFlameP1K128 10/30/2023 10:49:00 f3dfb7ce... #16: DiffFlameConvergenceStudy Full_ChamberedFlameP3K64 10/30/2023 10:46:04 4eaf36a8... #17: DiffFlameConvergenceStudy Full_ChamberedFlameP4K64 10/30/2023 10:47:22 7cc1ad00... #18: DiffFlameConvergenceStudy Full_ChamberedFlameP2K64 10/30/2023 10:44:54 ce386b0f... #19: DiffFlameConvergenceStudy Full_ChamberedFlameP1K64 10/30/2023 10:43:44 2b727a5f... #20: DiffFlameConvergenceStudy Full_ChamberedFlameP3K1024 10/26/2023 08:54:53 2c20f33a... #21: DiffFlameConvergenceStudy Full_ChamberedFlameP4K512 10/26/2023 08:52:35 b9f1f7c5... #22: DiffFlameConvergenceStudy Full_ChamberedFlameP4K1024 10/26/2023 08:55:13 7bb02cb3... #23: DiffFlameConvergenceStudy Full_ChamberedFlameP2K1024 10/26/2023 08:54:16 cb89dd14... #24: DiffFlameConvergenceStudy Full_ChamberedFlameP3K512 10/26/2023 08:51:59 770497b6... #25: DiffFlameConvergenceStudy Full_ChamberedFlameP1K1024 10/26/2023 08:53:24 15c6d85e... #26: DiffFlameConvergenceStudy Full_ChamberedFlameP4K256 10/26/2023 08:50:22 b35c6c25... #27: DiffFlameConvergenceStudy Full_ChamberedFlameP3K256 10/26/2023 08:49:51 c2991667... #28: DiffFlameConvergenceStudy Full_ChamberedFlameP2K512 10/26/2023 08:51:21 b173e1ac... #29: DiffFlameConvergenceStudy Full_ChamberedFlameP1K512 10/26/2023 08:50:52 982d829e... #30: DiffFlameConvergenceStudy Full_ChamberedFlameP2K256 10/26/2023 08:49:24 7a5a77b2... #31: DiffFlameConvergenceStudy Full_ChamberedFlameP4K128 10/26/2023 08:48:20 062c4fb6... #32: DiffFlameConvergenceStudy Full_ChamberedFlameP4K64 10/26/2023 08:46:54 040eaefb... #33: DiffFlameConvergenceStudy Full_ChamberedFlameP3K128 10/26/2023 08:47:59 bb6e2c9c... #34: DiffFlameConvergenceStudy Full_ChamberedFlameP1K256 10/26/2023 08:48:48 c8d7070d... #35: DiffFlameConvergenceStudy Full_ChamberedFlameP3K64 10/26/2023 08:46:35 ccc78ec1... #36: DiffFlameConvergenceStudy Full_ChamberedFlameP2K128 10/26/2023 08:47:33 1459026e... #37: DiffFlameConvergenceStudy Full_ChamberedFlameP1K128 10/26/2023 08:47:09 63e6793e... #38: DiffFlameConvergenceStudy Full_ChamberedFlameP2K64 10/26/2023 08:46:09 e320836e... #39: DiffFlameConvergenceStudy Full_ChamberedFlameP1K64 10/26/2023 08:45:50 9b4d7697... #40: DiffFlameConvergenceStudy FS_ChamberedFlameP2K1024 10/26/2023 07:43:11 ff1ce4a7... #41: DiffFlameConvergenceStudy FS_ChamberedFlameP2K512 10/26/2023 07:42:55 2b1df7de... #42: DiffFlameConvergenceStudy FS_ChamberedFlameP2K256 10/26/2023 07:42:42 961dd0dc... #43: DiffFlameConvergenceStudy FS_ChamberedFlameP2K128 10/26/2023 07:42:30 0fc2caf9... #44: DiffFlameConvergenceStudy FS_ChamberedFlameP2K64 10/26/2023 07:42:19 79289aef...
public static class GridFactory {
public static Grid2D GenerateGrid(int nCells) {
double sepAdim = 20 ; // 20 is already ok!
double xleft = -sepAdim;
double xright = 0.0;
double R = sepAdim / 10;
var _xNodes = GenericBlas.Linspace(xleft, xright, nCells + 1);
double[] _yNodes = GenericBlas.Linspace(-R, R, 3 + 1);
string BC = "ScalarDirichlet_PressureOutlet";
Console.WriteLine("Number of cells in the X direction: {0}", _xNodes.Length);
Console.WriteLine("Number of cells in the Y direction: {0}", _yNodes.Length);
var grd = Grid2D.Cartesian2DGrid(_xNodes, _yNodes, periodicY: true);
grd.EdgeTagNames.Add(1, "Velocity_Inlet_CH4");
grd.EdgeTagNames.Add(2, BC);
grd.DefineEdgeTags(delegate (double[] X) {
double x = X[0];
double y = X[1];
if (Math.Abs(x - xleft) < 1e-8) { // Left boundary
return 1; // Left
} else if (Math.Abs(x - xright) < 1e-8) { // right boundary
return 2; // right
} else {
return 3;
// throw new Exception("Problem while setting GridEdgeTagFunc");
}
}
);
myDb.SaveGrid(ref grd);
return grd;
}
}
public static class BoundaryValueFactory {
public static string GetPrefixCode(double ConstVal) {
using(var stw = new System.IO.StringWriter()) {
stw.WriteLine("static class BoundaryValues {");
stw.WriteLine(" static public double ConstantValue(double[] X) {");
stw.WriteLine(" return "+ ConstVal +";");
stw.WriteLine(" }");
stw.WriteLine("}");
return stw.ToString();
}
}
static public Formula Get_ConstantValue(double ConstVal){
return new Formula("BoundaryValues.ConstantValue", AdditionalPrefixCode:GetPrefixCode(ConstVal));
}
}
In this ControlFile basic configuration of the ChamberedDiffusionFlame is defined.
static XNSEC_Control GiveMeTheCtrlFile(int dg, int nCells, bool isMF) {
var CC = new ChemicalConstants();
var C = isMF ? new XNSEC_MF_Control() : new XNSEC_Control();
C.NumberOfChemicalSpecies = 4;
C.SetDGdegree(dg); //
C.SetGrid(GridFactory.GenerateGrid(nCells)); //
C.MatParamsMode = MaterialParamsMode.Sutherland; //
// Problem Definition
//===================
double TemperatureIn = 300;
double massFuelIn = 0.24 * 0.1; //kg/m2s ////////////////////////////////////////////////////////////
double AtmPressure = 101325; // Pa
double[] FuelInletConcentrations = new double[] { 0.2, 0.0, 0.0, 0.0, 0.8 };
double[] OxidizerInletConcentrations = new double[] { 0.0, 0.23, 0.0, 0.0, 0.77 };
double[] MWs = new double[] { CC.MW_CH4, CC.MW_O2, CC.MW_CO2, CC.MW_H2O, CC.MW_N2 };
double mwFuel = CC.getAvgMW(MWs, FuelInletConcentrations);
double mwAir = CC.getAvgMW(MWs, OxidizerInletConcentrations);
double densityFuelIn = AtmPressure * mwFuel / (CC.R_gas * TemperatureIn * 1000); // Kg/m3. ok
double uInFuel = massFuelIn / densityFuelIn; //
Console.WriteLine("Velocity is "+uInFuel);
// Reference values
//===================
// Basic units to be used: Kg, m, s, mol, pa,
double TRef = TemperatureIn;// Reference temperature is the inlet temperature, (K)
double pRef = AtmPressure; // Pa
double uRef = uInFuel; // m/s
double rhoRef = pRef * mwAir / (8.314 * TRef * 1000); // Kg/m3. ok ;
double DRef = 2.2133029473872009E-05 / rhoRef;
double LRef = DRef / uRef;
C.GravityDirection = new double[] { 0.0, 0.0, 0.0 }; //No gravity.
// Solver configuration
// =======================
C.smoothingFactor = 80*0-1*1;
// C.NonLinearSolver.ConvergenceCriterion = 1e-8;
// C.LinearSolver.ConvergenceCriterion = 1e-10;
C.NonLinearSolver.verbose = true;
C.NonLinearSolver.SolverCode = NonLinearSolverCode.Newton;
C.NonLinearSolver.MaxSolverIterations = 10;
C.LinearSolver = LinearSolverCode.direct_pardiso.GetConfig();
C.TimesteppingMode = AppControl._TimesteppingMode.Steady;
C.saveperiod = 1;
C.PenaltyViscMomentum = 1.0; ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
C.PenaltyHeatConduction = 1.0;///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
C.YFuelInlet = FuelInletConcentrations[0];
C.YOxInlet = OxidizerInletConcentrations[1];
C.FuelInletConcentrations = FuelInletConcentrations;
C.OxidizerInletConcentrations = OxidizerInletConcentrations;
C.TFuelInlet = 1.0;
C.TOxInlet = 1.0;
C.PhysicalParameters.IncludeConvection = true;
// Chemical related parameters
double s = (CC.nu_O2 * CC.MW_O2) / (CC.nu_CH4 * CC.MW_CH4);
C.phi = s * C.YFuelInlet / C.YOxInlet;
C.zSt = 1.0 / (1.0 + C.phi);
var MLC = new MaterialLawCombustion(300, new double[] { }, C.MatParamsMode, C.rhoOne, true, 1.0, 1, 1, C.YOxInlet, C.YFuelInlet, C.zSt, CC, 0.75);
var ThermoProperties = new ThermodynamicalProperties();
//==========================
//Derived reference values
//==========================
C.uRef = uRef; // Reference velocity
C.LRef = LRef; // reference length
C.pRef = AtmPressure; // reference pressure
C.TRef = TRef;// reference temperature
C.MWRef = MLC.getAvgMW(MWs, C.OxidizerInletConcentrations); // Air mean molecular weight
C.rhoRef = C.pRef * C.MWRef / (8.314 * C.TRef * 1000); // Kg/m3. ok ;
C.cpRef = 1.3;//ThermoProperties.Calculate_Cp_Mixture(new double[] { 0.23, 0.77 }, new string[] { "O2", "N2" }, 300); // 1.219185317353029;// Representative value, KJ/Kg K ========> 1.31 for the one-step kinetic model
C.muRef = MLC.getViscosityDim(300);
C.MolarMasses = new double[] { C.CC.MW_CH4, C.CC.MW_O2, C.CC.MW_CO2, C.CC.MW_H2O, C.CC.MW_N2 };
C.MolarMasses.ScaleV(1.0 / C.MWRef); //NonDimensionalized Molar masses
C.T_ref_Sutherland = 300;
double heatRelease_Ref = (C.TRef * C.cpRef);
C.HeatRelease = C.CC.HeatReleaseMass / heatRelease_Ref;
C.B = CC.PreExponentialFactor;
C.StoichiometricCoefficients = new double[] { -1, -2, 1, 2, 0 };
C.Damk = C.rhoRef * C.LRef * C.B / (C.uRef * C.MWRef);
C.Reynolds = C.rhoRef * C.uRef * C.LRef / C.muRef;
C.Prandtl = 0.75;////////////////////0.75;
C.Schmidt = C.Prandtl; // Because Lewis number is assumed as 1.0 (Le = Pr/Sc)
// C.Lewis = new double[] { 0.97, 1.11, 1.39, 0.83, 1.0 };
C.Lewis = new double[] {1.0, 1.0, 1.0,1.0, 1.0 };
double g = 9.8; // m/s2
C.Froude = Math.Sqrt(uRef * uRef / (C.LRef * g)); // Not used
C.ReactionRateConstants = new double[] { C.Damk, CC.Ta / TRef, 1.0, 1.0 }; // NOTE! activation temperature is also nondimensional
//==========================
// Initial conditions
//==========================
C.AddInitialValue(VariableNames.VelocityX, BoundaryValueFactory.Get_ConstantValue(0.0));
C.AddInitialValue(VariableNames.VelocityY, BoundaryValueFactory.Get_ConstantValue(0.0));
C.AddInitialValue(VariableNames.Pressure, BoundaryValueFactory.Get_ConstantValue(0.0));
//==========================
// Boundary conditions
//==========================
C.AddBoundaryValue("Velocity_Inlet_CH4", VariableNames.Velocity_d(0), BoundaryValueFactory.Get_ConstantValue(uInFuel / C.uRef));
C.AddBoundaryValue("Velocity_Inlet_CH4", VariableNames.Velocity_d(1), BoundaryValueFactory.Get_ConstantValue(0.0));
return C;
}
Configuration for the simulation using the mixture fraction approach, where an infinite reaction rate is assumed. Used to find adequate starting solution for the full problem.
static XNSEC_Control GiveMeTheMixtureFractionCtrlFile(int dg, int nCells){
var C_MixtureFraction = GiveMeTheCtrlFile(dg, nCells, true);
C_MixtureFraction.physicsMode = PhysicsMode.MixtureFraction;
C_MixtureFraction.ProjectName = "ChamberedFlame";
string name = C_MixtureFraction.ProjectName + "P" + dg + "K" + nCells;
C_MixtureFraction.SessionName = "FS_" + name;
C_MixtureFraction.UseSelfMadeTemporalOperator = false;
C_MixtureFraction.ChemicalReactionActive = false;
C_MixtureFraction.physicsMode = PhysicsMode.MixtureFraction;
C_MixtureFraction.NonLinearSolver.MaxSolverIterations = 50;
// Boundary and initial conditions
C_MixtureFraction.AddInitialValue(VariableNames.MixtureFraction,BoundaryValueFactory.Get_ConstantValue(1.0));
C_MixtureFraction.AddBoundaryValue("Velocity_Inlet_CH4", VariableNames.MixtureFraction, BoundaryValueFactory.Get_ConstantValue(1.0));
C_MixtureFraction.AdaptiveMeshRefinement = false;
C_MixtureFraction.TimesteppingMode = BoSSS.Solution.Control.AppControl._TimesteppingMode.Steady;
return C_MixtureFraction;
}
foreach(int nCells in NofCells){
int dg = 2;
Type solver_MF = typeof(BoSSS.Application.XNSEC.XNSEC_MixtureFraction);
var C_MixtureFraction = GiveMeTheMixtureFractionCtrlFile(dg, nCells);
string jobName = C_MixtureFraction.SessionName;
Console.WriteLine(jobName);
var oneJob = new Job(jobName, solver_MF);
oneJob.NumberOfMPIProcs = 4;
// oneJob.UseComputeNodesExclusive = true;
oneJob.SetControlObject(C_MixtureFraction);
// oneJob.Activate(myBatch);
oneJob.Activate();
}
Number of cells in the X direction: 65 Number of cells in the Y direction: 4 Grid Edge Tags changed. An equivalent grid (aea5f0ec-f1eb-4d16-958e-96a8436e84bf) is already present in the database -- the grid will not be saved. Velocity is 0.02426418525959607 FS_ChamberedFlameP2K64 Deployments so far (1): (Job token: 799165, FinishedSuccessful 'DiffFlameConvergenceStudy-XNSEC2023Oct26_074159.891426' @ MS HPC client MSHPC-AllNodes @DC2, @\\fdygitrunner\ValidationTests\deploy, FinishedSuccessful); Success: 1 Info: Found successful session "DiffFlameConvergenceStudy FS_ChamberedFlameP2K64 10/26/2023 07:42:19 79289aef..." -- job is marked as successful, no further action. No submission, because job status is: FinishedSuccessful Number of cells in the X direction: 129 Number of cells in the Y direction: 4 Grid Edge Tags changed. An equivalent grid (0eb33abe-6f27-4ad8-9d44-6bd97f874c76) is already present in the database -- the grid will not be saved. Velocity is 0.02426418525959607 FS_ChamberedFlameP2K128 Deployments so far (1): (Job token: 799166, FinishedSuccessful 'DiffFlameConvergenceStudy-XNSEC2023Oct26_074212.302623' @ MS HPC client MSHPC-AllNodes @DC2, @\\fdygitrunner\ValidationTests\deploy, FinishedSuccessful); Success: 1 Info: Found successful session "DiffFlameConvergenceStudy FS_ChamberedFlameP2K128 10/26/2023 07:42:30 0fc2caf9..." -- job is marked as successful, no further action. No submission, because job status is: FinishedSuccessful Number of cells in the X direction: 257 Number of cells in the Y direction: 4 Grid Edge Tags changed. An equivalent grid (519fdb75-e733-4ff1-b6d6-d8b76bfa667c) is already present in the database -- the grid will not be saved. Velocity is 0.02426418525959607 FS_ChamberedFlameP2K256 Deployments so far (1): (Job token: 799167, FinishedSuccessful 'DiffFlameConvergenceStudy-XNSEC2023Oct26_074223.543669' @ MS HPC client MSHPC-AllNodes @DC2, @\\fdygitrunner\ValidationTests\deploy, FinishedSuccessful); Success: 1 Info: Found successful session "DiffFlameConvergenceStudy FS_ChamberedFlameP2K256 10/26/2023 07:42:42 961dd0dc..." -- job is marked as successful, no further action. No submission, because job status is: FinishedSuccessful Number of cells in the X direction: 513 Number of cells in the Y direction: 4 Grid Edge Tags changed. An equivalent grid (c1cf90e1-4aab-4937-92b1-30cab1aad9ca) is already present in the database -- the grid will not be saved. Velocity is 0.02426418525959607 FS_ChamberedFlameP2K512 Deployments so far (1): (Job token: 799168, FinishedSuccessful 'DiffFlameConvergenceStudy-XNSEC2023Oct26_074236.200006' @ MS HPC client MSHPC-AllNodes @DC2, @\\fdygitrunner\ValidationTests\deploy, FinishedSuccessful); Success: 1 Info: Found successful session "DiffFlameConvergenceStudy FS_ChamberedFlameP2K512 10/26/2023 07:42:55 2b1df7de..." -- job is marked as successful, no further action. No submission, because job status is: FinishedSuccessful Number of cells in the X direction: 1025 Number of cells in the Y direction: 4 Grid Edge Tags changed. An equivalent grid (af11eaea-9711-4374-bb60-3d9e87cfb026) is already present in the database -- the grid will not be saved. Velocity is 0.02426418525959607 FS_ChamberedFlameP2K1024 Deployments so far (1): (Job token: 799169, FinishedSuccessful 'DiffFlameConvergenceStudy-XNSEC2023Oct26_074251.937633' @ MS HPC client MSHPC-AllNodes @DC2, @\\fdygitrunner\ValidationTests\deploy, FinishedSuccessful); Success: 1 Info: Found successful session "DiffFlameConvergenceStudy FS_ChamberedFlameP2K1024 10/26/2023 07:43:11 ff1ce4a7..." -- job is marked as successful, no further action. No submission, because job status is: FinishedSuccessful
BoSSSshell.WorkflowMgm.BlockUntilAllJobsTerminate();
All jobs finished.
Now that the simulation for an "infinite" reaction rate is done, we use it for initializing the system with finite reaction rate. The goal is to obtain solutions of the counter difussion flame for increasing strain values. We start with a low strain (bigger Dahmkoehler number), which is increased until extintion is (hopefully) found
static XNSEC_Control GiveMeTheFullCtrlFile(int dg, int nCells, ISessionInfo SessionToRestart) {
var C_OneStep = GiveMeTheCtrlFile(dg, nCells, false);
C_OneStep.physicsMode = PhysicsMode.Combustion;
C_OneStep.ProjectName = "ChamberedFlame";
string name = C_OneStep.ProjectName + "P" + dg + "K" + nCells;
C_OneStep.SessionName = "Full_" + name;
C_OneStep.VariableOneStepParameters = false;
// C_OneStep.Tags.Add("VelocityMultiplier" + mult);
C_OneStep.UseSelfMadeTemporalOperator = false;
C_OneStep.myThermalWallType = SIPDiffusionTemperature.ThermalWallType.Adiabatic;
C_OneStep.Timestepper_LevelSetHandling = BoSSS.Solution.XdgTimestepping.LevelSetHandling.None;
C_OneStep.UseMixtureFractionsForCombustionInitialization = true;
// C_OneStep.LinearSolver = LinearSolverCode.exp_Kcycle_schwarz.GetConfig();
C_OneStep.NoOfMultigridLevels = 5;
C_OneStep.LinearSolver = new BoSSS.Solution.AdvancedSolvers.OrthoMGSchwarzConfig() {
NoOfMultigridLevels = 5,
CoarseUsepTG = false
};
C_OneStep.ChemicalReactionActive = true;
C_OneStep.AdaptiveMeshRefinement = false;
C_OneStep.HeatCapacityMode = MaterialLaw_MultipleSpecies.CpCalculationMode.constant;
C_OneStep.NoOfTimesteps = 1; // The steady solution will be calculated again and do AMR
C_OneStep.NonLinearSolver.MaxSolverIterations = 200;
// C_OneStep.NonLinearSolver.MaxSolverIterations = 10;
// limiting of variable values
Dictionary<string, Tuple<double, double>> Bounds = new Dictionary<string, Tuple<double, double>>();
double eps = 1e-2;
Bounds.Add(VariableNames.Temperature, new Tuple<double, double>(1.0 - eps, 10)); // Min temp should be the inlet temperature.
Bounds.Add(VariableNames.MassFraction0, new Tuple<double, double>(0.0 - 1e-1, 1.0 + 1e-1)); // Between 0 and 1 per definition
Bounds.Add(VariableNames.MassFraction1, new Tuple<double, double>(0.0 - 1e-1, 1.0 + 1e-1));
Bounds.Add(VariableNames.MassFraction2, new Tuple<double, double>(0.0 - 1e-1, 1.0 + 1e-1));
Bounds.Add(VariableNames.MassFraction3, new Tuple<double, double>(0.0 - 1e-1, 1.0 + 1e-1));
C_OneStep.VariableBounds = Bounds;
// Boundary conditions
double dummy = 0;
if(SessionToRestart != null) {
C_OneStep.SetRestart(SessionToRestart);
} else {
C_OneStep.AddInitialValue(VariableNames.Temperature, BoundaryValueFactory.Get_ConstantValue(1.0));
C_OneStep.AddInitialValue(VariableNames.MassFraction0, BoundaryValueFactory.Get_ConstantValue(0.0));
C_OneStep.AddInitialValue(VariableNames.MassFraction1, BoundaryValueFactory.Get_ConstantValue(0.23));
C_OneStep.AddInitialValue(VariableNames.MassFraction2, BoundaryValueFactory.Get_ConstantValue(0.0));
C_OneStep.AddInitialValue(VariableNames.MassFraction3, BoundaryValueFactory.Get_ConstantValue(0.0));
}
C_OneStep.AddBoundaryValue("Velocity_Inlet_CH4", VariableNames.Temperature, BoundaryValueFactory.Get_ConstantValue(1.0));
C_OneStep.AddBoundaryValue("Velocity_Inlet_CH4", VariableNames.MassFraction0, BoundaryValueFactory.Get_ConstantValue(C_OneStep.FuelInletConcentrations[0]));
C_OneStep.AddBoundaryValue("Velocity_Inlet_CH4", VariableNames.MassFraction1, BoundaryValueFactory.Get_ConstantValue(C_OneStep.FuelInletConcentrations[1]));
C_OneStep.AddBoundaryValue("Velocity_Inlet_CH4", VariableNames.MassFraction2, BoundaryValueFactory.Get_ConstantValue(C_OneStep.FuelInletConcentrations[2]));
C_OneStep.AddBoundaryValue("Velocity_Inlet_CH4", VariableNames.MassFraction3, BoundaryValueFactory.Get_ConstantValue(C_OneStep.FuelInletConcentrations[3]));
C_OneStep.AddBoundaryValue("ScalarDirichlet_PressureOutlet", VariableNames.Temperature, BoundaryValueFactory.Get_ConstantValue(1.0));
C_OneStep.AddBoundaryValue("ScalarDirichlet_PressureOutlet", VariableNames.MassFraction0, BoundaryValueFactory.Get_ConstantValue(C_OneStep.OxidizerInletConcentrations[0]));
C_OneStep.AddBoundaryValue("ScalarDirichlet_PressureOutlet", VariableNames.MassFraction1, BoundaryValueFactory.Get_ConstantValue(C_OneStep.OxidizerInletConcentrations[1]));
C_OneStep.AddBoundaryValue("ScalarDirichlet_PressureOutlet", VariableNames.MassFraction2, BoundaryValueFactory.Get_ConstantValue(C_OneStep.OxidizerInletConcentrations[2]));
C_OneStep.AddBoundaryValue("ScalarDirichlet_PressureOutlet", VariableNames.MassFraction3, BoundaryValueFactory.Get_ConstantValue(C_OneStep.OxidizerInletConcentrations[3]));
return C_OneStep;
}
(45,12): warning CS0219: The variable 'dummy' is assigned but its value is never used
Type solver = typeof(BoSSS.Application.XNSEC.XNSEC);
Calculate the full solution for the initial value
int counter = 0;
foreach (int nCells in NofCells) {
foreach (int dg in dgDegree) {
// var sess =(myDb.Sessions.Where(s=>Convert.ToInt64(s.Tags.ToArray()[0]) == i)).FirstOrDefault();
var sess = (myDb.Sessions.Where(s => s.Name == "FS_ChamberedFlameP" + 2 + "K" + nCells)).FirstOrDefault();
var C = GiveMeTheFullCtrlFile(dg, nCells, sess);
string jobName = C.SessionName + "AllOn";
Console.WriteLine(jobName);
var oneJob = new Job(jobName, solver);
oneJob.NumberOfMPIProcs = nCells > 32? 12:4 ;
oneJob.SetControlObject(C);
// oneJob.Activate(myBatch);
oneJob.Activate();
counter++;
}
}
Number of cells in the X direction: 65 Number of cells in the Y direction: 4 Grid Edge Tags changed. An equivalent grid (aea5f0ec-f1eb-4d16-958e-96a8436e84bf) is already present in the database -- the grid will not be saved. Velocity is 0.02426418525959607 Full_ChamberedFlameP1K64AllOn Deployments so far (1): (Job token: 799251, FinishedSuccessful 'DiffFlameConvergenceStudy-XNSEC2023Oct26_084529.812933' @ MS HPC client MSHPC-AllNodes @DC2, @\\fdygitrunner\ValidationTests\deploy, FinishedSuccessful); Success: 1 Info: Found successful session "DiffFlameConvergenceStudy Full_ChamberedFlameP1K64 10/26/2023 08:45:50 9b4d7697..." -- job is marked as successful, no further action. No submission, because job status is: FinishedSuccessful Number of cells in the X direction: 65 Number of cells in the Y direction: 4 Grid Edge Tags changed. An equivalent grid (aea5f0ec-f1eb-4d16-958e-96a8436e84bf) is already present in the database -- the grid will not be saved. Velocity is 0.02426418525959607 Full_ChamberedFlameP2K64AllOn Deployments so far (1): (Job token: 799253, FinishedSuccessful 'DiffFlameConvergenceStudy-XNSEC2023Oct26_084546.747197' @ MS HPC client MSHPC-AllNodes @DC2, @\\fdygitrunner\ValidationTests\deploy, FinishedSuccessful); Success: 1 Info: Found successful session "DiffFlameConvergenceStudy Full_ChamberedFlameP2K64 10/26/2023 08:46:09 e320836e..." -- job is marked as successful, no further action. No submission, because job status is: FinishedSuccessful Number of cells in the X direction: 65 Number of cells in the Y direction: 4 Grid Edge Tags changed. An equivalent grid (aea5f0ec-f1eb-4d16-958e-96a8436e84bf) is already present in the database -- the grid will not be saved. Velocity is 0.02426418525959607 Full_ChamberedFlameP3K64AllOn Deployments so far (1): (Job token: 799256, FinishedSuccessful 'DiffFlameConvergenceStudy-XNSEC2023Oct26_084604.599154' @ MS HPC client MSHPC-AllNodes @DC2, @\\fdygitrunner\ValidationTests\deploy, FinishedSuccessful); Success: 1 Info: Found successful session "DiffFlameConvergenceStudy Full_ChamberedFlameP3K64 10/26/2023 08:46:35 ccc78ec1..." -- job is marked as successful, no further action. No submission, because job status is: FinishedSuccessful Number of cells in the X direction: 65 Number of cells in the Y direction: 4 Grid Edge Tags changed. An equivalent grid (aea5f0ec-f1eb-4d16-958e-96a8436e84bf) is already present in the database -- the grid will not be saved. Velocity is 0.02426418525959607 Full_ChamberedFlameP4K64AllOn Deployments so far (1): (Job token: 799258, FinishedSuccessful 'DiffFlameConvergenceStudy-XNSEC2023Oct26_084625.403580' @ MS HPC client MSHPC-AllNodes @DC2, @\\fdygitrunner\ValidationTests\deploy, FinishedSuccessful); Success: 1 Info: Found successful session "DiffFlameConvergenceStudy Full_ChamberedFlameP4K64 10/26/2023 08:46:54 040eaefb..." -- job is marked as successful, no further action. No submission, because job status is: FinishedSuccessful Number of cells in the X direction: 129 Number of cells in the Y direction: 4 Grid Edge Tags changed. An equivalent grid (0eb33abe-6f27-4ad8-9d44-6bd97f874c76) is already present in the database -- the grid will not be saved. Velocity is 0.02426418525959607 Full_ChamberedFlameP1K128AllOn Deployments so far (1): (Job token: 799261, FinishedSuccessful 'DiffFlameConvergenceStudy-XNSEC2023Oct26_084644.327358' @ MS HPC client MSHPC-AllNodes @DC2, @\\fdygitrunner\ValidationTests\deploy, FinishedSuccessful); Success: 1 Info: Found successful session "DiffFlameConvergenceStudy Full_ChamberedFlameP1K128 10/26/2023 08:47:09 63e6793e..." -- job is marked as successful, no further action. No submission, because job status is: FinishedSuccessful Number of cells in the X direction: 129 Number of cells in the Y direction: 4 Grid Edge Tags changed. An equivalent grid (0eb33abe-6f27-4ad8-9d44-6bd97f874c76) is already present in the database -- the grid will not be saved. Velocity is 0.02426418525959607 Full_ChamberedFlameP2K128AllOn Deployments so far (1): (Job token: 799263, FinishedSuccessful 'DiffFlameConvergenceStudy-XNSEC2023Oct26_084708.613759' @ MS HPC client MSHPC-AllNodes @DC2, @\\fdygitrunner\ValidationTests\deploy, FinishedSuccessful); Success: 1 Info: Found successful session "DiffFlameConvergenceStudy Full_ChamberedFlameP2K128 10/26/2023 08:47:33 1459026e..." -- job is marked as successful, no further action. No submission, because job status is: FinishedSuccessful Number of cells in the X direction: 129 Number of cells in the Y direction: 4 Grid Edge Tags changed. An equivalent grid (0eb33abe-6f27-4ad8-9d44-6bd97f874c76) is already present in the database -- the grid will not be saved. Velocity is 0.02426418525959607 Full_ChamberedFlameP3K128AllOn Deployments so far (1): (Job token: 799266, FinishedSuccessful 'DiffFlameConvergenceStudy-XNSEC2023Oct26_084734.552174' @ MS HPC client MSHPC-AllNodes @DC2, @\\fdygitrunner\ValidationTests\deploy, FinishedSuccessful); Success: 1 Info: Found successful session "DiffFlameConvergenceStudy Full_ChamberedFlameP3K128 10/26/2023 08:47:59 bb6e2c9c..." -- job is marked as successful, no further action. No submission, because job status is: FinishedSuccessful Number of cells in the X direction: 129 Number of cells in the Y direction: 4 Grid Edge Tags changed. An equivalent grid (0eb33abe-6f27-4ad8-9d44-6bd97f874c76) is already present in the database -- the grid will not be saved. Velocity is 0.02426418525959607 Full_ChamberedFlameP4K128AllOn Deployments so far (1): (Job token: 799269, FinishedSuccessful 'DiffFlameConvergenceStudy-XNSEC2023Oct26_084759.216663' @ MS HPC client MSHPC-AllNodes @DC2, @\\fdygitrunner\ValidationTests\deploy, FinishedSuccessful); Success: 1 Info: Found successful session "DiffFlameConvergenceStudy Full_ChamberedFlameP4K128 10/26/2023 08:48:20 062c4fb6..." -- job is marked as successful, no further action. No submission, because job status is: FinishedSuccessful Number of cells in the X direction: 257 Number of cells in the Y direction: 4 Grid Edge Tags changed. An equivalent grid (519fdb75-e733-4ff1-b6d6-d8b76bfa667c) is already present in the database -- the grid will not be saved. Velocity is 0.02426418525959607 Full_ChamberedFlameP1K256AllOn Deployments so far (1): (Job token: 799272, FinishedSuccessful 'DiffFlameConvergenceStudy-XNSEC2023Oct26_084824.538718' @ MS HPC client MSHPC-AllNodes @DC2, @\\fdygitrunner\ValidationTests\deploy, FinishedSuccessful); Success: 1 Info: Found successful session "DiffFlameConvergenceStudy Full_ChamberedFlameP1K256 10/26/2023 08:48:48 c8d7070d..." -- job is marked as successful, no further action. No submission, because job status is: FinishedSuccessful Number of cells in the X direction: 257 Number of cells in the Y direction: 4 Grid Edge Tags changed. An equivalent grid (519fdb75-e733-4ff1-b6d6-d8b76bfa667c) is already present in the database -- the grid will not be saved. Velocity is 0.02426418525959607 Full_ChamberedFlameP2K256AllOn Deployments so far (1): (Job token: 799275, FinishedSuccessful 'DiffFlameConvergenceStudy-XNSEC2023Oct26_084858.279127' @ MS HPC client MSHPC-AllNodes @DC2, @\\fdygitrunner\ValidationTests\deploy, FinishedSuccessful); Success: 1 Info: Found successful session "DiffFlameConvergenceStudy Full_ChamberedFlameP2K256 10/26/2023 08:49:24 7a5a77b2..." -- job is marked as successful, no further action. No submission, because job status is: FinishedSuccessful Number of cells in the X direction: 257 Number of cells in the Y direction: 4 Grid Edge Tags changed. An equivalent grid (519fdb75-e733-4ff1-b6d6-d8b76bfa667c) is already present in the database -- the grid will not be saved. Velocity is 0.02426418525959607 Full_ChamberedFlameP3K256AllOn Deployments so far (1): (Job token: 799278, FinishedSuccessful 'DiffFlameConvergenceStudy-XNSEC2023Oct26_084923.202598' @ MS HPC client MSHPC-AllNodes @DC2, @\\fdygitrunner\ValidationTests\deploy, FinishedSuccessful); Success: 1 Info: Found successful session "DiffFlameConvergenceStudy Full_ChamberedFlameP3K256 10/26/2023 08:49:51 c2991667..." -- job is marked as successful, no further action. No submission, because job status is: FinishedSuccessful Number of cells in the X direction: 257 Number of cells in the Y direction: 4 Grid Edge Tags changed. An equivalent grid (519fdb75-e733-4ff1-b6d6-d8b76bfa667c) is already present in the database -- the grid will not be saved. Velocity is 0.02426418525959607 Full_ChamberedFlameP4K256AllOn Deployments so far (1): (Job token: 799282, FinishedSuccessful 'DiffFlameConvergenceStudy-XNSEC2023Oct26_084954.950366' @ MS HPC client MSHPC-AllNodes @DC2, @\\fdygitrunner\ValidationTests\deploy, FinishedSuccessful); Success: 1 Info: Found successful session "DiffFlameConvergenceStudy Full_ChamberedFlameP4K256 10/26/2023 08:50:22 b35c6c25..." -- job is marked as successful, no further action. No submission, because job status is: FinishedSuccessful Number of cells in the X direction: 513 Number of cells in the Y direction: 4 Grid Edge Tags changed. An equivalent grid (c1cf90e1-4aab-4937-92b1-30cab1aad9ca) is already present in the database -- the grid will not be saved. Velocity is 0.02426418525959607 Full_ChamberedFlameP1K512AllOn Deployments so far (1): (Job token: 799285, FinishedSuccessful 'DiffFlameConvergenceStudy-XNSEC2023Oct26_085025.834597' @ MS HPC client MSHPC-AllNodes @DC2, @\\fdygitrunner\ValidationTests\deploy, FinishedSuccessful); Success: 1 Info: Found successful session "DiffFlameConvergenceStudy Full_ChamberedFlameP1K512 10/26/2023 08:50:52 982d829e..." -- job is marked as successful, no further action. No submission, because job status is: FinishedSuccessful Number of cells in the X direction: 513 Number of cells in the Y direction: 4 Grid Edge Tags changed. An equivalent grid (c1cf90e1-4aab-4937-92b1-30cab1aad9ca) is already present in the database -- the grid will not be saved. Velocity is 0.02426418525959607 Full_ChamberedFlameP2K512AllOn Deployments so far (1): (Job token: 799288, FinishedSuccessful 'DiffFlameConvergenceStudy-XNSEC2023Oct26_085057.490931' @ MS HPC client MSHPC-AllNodes @DC2, @\\fdygitrunner\ValidationTests\deploy, FinishedSuccessful); Success: 1 Info: Found successful session "DiffFlameConvergenceStudy Full_ChamberedFlameP2K512 10/26/2023 08:51:21 b173e1ac..." -- job is marked as successful, no further action. No submission, because job status is: FinishedSuccessful Number of cells in the X direction: 513 Number of cells in the Y direction: 4 Grid Edge Tags changed. An equivalent grid (c1cf90e1-4aab-4937-92b1-30cab1aad9ca) is already present in the database -- the grid will not be saved. Velocity is 0.02426418525959607 Full_ChamberedFlameP3K512AllOn Deployments so far (1): (Job token: 799291, FinishedSuccessful 'DiffFlameConvergenceStudy-XNSEC2023Oct26_085129.576641' @ MS HPC client MSHPC-AllNodes @DC2, @\\fdygitrunner\ValidationTests\deploy, FinishedSuccessful); Success: 1 Info: Found successful session "DiffFlameConvergenceStudy Full_ChamberedFlameP3K512 10/26/2023 08:51:59 770497b6..." -- job is marked as successful, no further action. No submission, because job status is: FinishedSuccessful Number of cells in the X direction: 513 Number of cells in the Y direction: 4 Grid Edge Tags changed. An equivalent grid (c1cf90e1-4aab-4937-92b1-30cab1aad9ca) is already present in the database -- the grid will not be saved. Velocity is 0.02426418525959607 Full_ChamberedFlameP4K512AllOn Deployments so far (1): (Job token: 799292, FinishedSuccessful 'DiffFlameConvergenceStudy-XNSEC2023Oct26_085158.630709' @ MS HPC client MSHPC-AllNodes @DC2, @\\fdygitrunner\ValidationTests\deploy, FinishedSuccessful); Success: 1 Info: Found successful session "DiffFlameConvergenceStudy Full_ChamberedFlameP4K512 10/26/2023 08:52:35 b9f1f7c5..." -- job is marked as successful, no further action. No submission, because job status is: FinishedSuccessful Number of cells in the X direction: 1025 Number of cells in the Y direction: 4 Grid Edge Tags changed. An equivalent grid (af11eaea-9711-4374-bb60-3d9e87cfb026) is already present in the database -- the grid will not be saved. Velocity is 0.02426418525959607 Full_ChamberedFlameP1K1024AllOn Deployments so far (1): (Job token: 799293, FinishedSuccessful 'DiffFlameConvergenceStudy-XNSEC2023Oct26_085235.814634' @ MS HPC client MSHPC-AllNodes @DC2, @\\fdygitrunner\ValidationTests\deploy, FinishedSuccessful); Success: 1 Info: Found successful session "DiffFlameConvergenceStudy Full_ChamberedFlameP1K1024 10/26/2023 08:53:24 15c6d85e..." -- job is marked as successful, no further action. No submission, because job status is: FinishedSuccessful Number of cells in the X direction: 1025 Number of cells in the Y direction: 4 Grid Edge Tags changed. An equivalent grid (af11eaea-9711-4374-bb60-3d9e87cfb026) is already present in the database -- the grid will not be saved. Velocity is 0.02426418525959607 Full_ChamberedFlameP2K1024AllOn Deployments so far (1): (Job token: 799294, FinishedSuccessful 'DiffFlameConvergenceStudy-XNSEC2023Oct26_085338.266805' @ MS HPC client MSHPC-AllNodes @DC2, @\\fdygitrunner\ValidationTests\deploy, FinishedSuccessful); Success: 1 Info: Found successful session "DiffFlameConvergenceStudy Full_ChamberedFlameP2K1024 10/26/2023 08:54:16 cb89dd14..." -- job is marked as successful, no further action. No submission, because job status is: FinishedSuccessful Number of cells in the X direction: 1025 Number of cells in the Y direction: 4 Grid Edge Tags changed. An equivalent grid (af11eaea-9711-4374-bb60-3d9e87cfb026) is already present in the database -- the grid will not be saved. Velocity is 0.02426418525959607 Full_ChamberedFlameP3K1024AllOn Deployments so far (1): (Job token: 799295, FinishedSuccessful 'DiffFlameConvergenceStudy-XNSEC2023Oct26_085420.356196' @ MS HPC client MSHPC-AllNodes @DC2, @\\fdygitrunner\ValidationTests\deploy, FinishedSuccessful); Success: 1 Info: Found successful session "DiffFlameConvergenceStudy Full_ChamberedFlameP3K1024 10/26/2023 08:54:53 2c20f33a..." -- job is marked as successful, no further action. No submission, because job status is: FinishedSuccessful Number of cells in the X direction: 1025 Number of cells in the Y direction: 4 Grid Edge Tags changed. An equivalent grid (af11eaea-9711-4374-bb60-3d9e87cfb026) is already present in the database -- the grid will not be saved. Velocity is 0.02426418525959607 Full_ChamberedFlameP4K1024AllOn Deployments so far (1): (Job token: 799296, FinishedSuccessful 'DiffFlameConvergenceStudy-XNSEC2023Oct26_085447.837917' @ MS HPC client MSHPC-AllNodes @DC2, @\\fdygitrunner\ValidationTests\deploy, FinishedSuccessful); Success: 1 Info: Found successful session "DiffFlameConvergenceStudy Full_ChamberedFlameP4K1024 10/26/2023 08:55:13 7bb02cb3..." -- job is marked as successful, no further action. No submission, because job status is: FinishedSuccessful
// wait for all jobs to finish (up to 1 days, check every 5 minutes)
BoSSSshell.WorkflowMgm.BlockUntilAllJobsTerminate(TimeOutSeconds:(3600*24*1), PollingIntervallSeconds:(60*5));
All jobs finished.
// detect failed Jobs in the job management
var suspects = BoSSSshell.WorkflowMgm.AllJobs.Select(kv => kv.Value)
.Where(job => job.LatestSession.Tags.Contains(SessionInfo.NOT_TERMINATED_TAG)
|| job.LatestSession.Tags.Contains(SessionInfo.SOLVER_ERROR)).ToArray();
suspects
NUnit.Framework.Assert.IsTrue(suspects.Count() <= 0, $"{suspects.Count()} Failed Jobs of {BoSSSshell.WorkflowMgm.AllJobs.Count()} in total.");
// // Delete the flame sheet calculations
// Console.WriteLine("Deleting mass fraction calculations");
// BoSSSshell.WorkflowMgm.Sessions.Where(s => s.Name.StartsWith("FS_")).ForEach(x=>x.Delete(true));