From 26e94bdcf1e87264ece78109d9638c9174ebd7ae Mon Sep 17 00:00:00 2001 From: Yeongdo Park Date: Tue, 12 Mar 2019 09:35:03 -0700 Subject: [PATCH] Reaction panel is added on checking reaction --- src/eu/engys/combustion/CombustionModule.java | 15 +- .../combustion/CombustionSolutionView.java | 12 + .../combustion/resources/combustion.stateData | 469 ++++++++++++++++++ src/eu/engys/core/project/state/State.java | 1 + 4 files changed, 488 insertions(+), 9 deletions(-) create mode 100644 src/eu/engys/combustion/resources/combustion.stateData diff --git a/src/eu/engys/combustion/CombustionModule.java b/src/eu/engys/combustion/CombustionModule.java index 8a03cce..1cf27e3 100644 --- a/src/eu/engys/combustion/CombustionModule.java +++ b/src/eu/engys/combustion/CombustionModule.java @@ -71,6 +71,8 @@ public class CombustionModule extends ApplicationModuleAdapter { private DefaultsProvider defaults; private CombustionReader reader; + + private boolean reacting; @Inject public CombustionModule(Model model) { @@ -82,6 +84,8 @@ public class CombustionModule extends ApplicationModuleAdapter { this.treeView = new CombustionTreeView(this, reactionsPanel); this.reader = new CombustionReader(model, this); + + this.reacting = false; this.defaults = new ModuleDefaults(this, model.getDefaults(), model.getDefaults().getDefaultStateData()) { @Override @@ -168,18 +172,11 @@ public class CombustionModule extends ApplicationModuleAdapter { } public void setReacting(boolean reacting) { - Logger logger = LoggerFactory.getLogger(CombustionReactionsView.class); - - logger.debug("setting reacting on"); - - if (model != null && model.getState() != null) { - logger.debug("setting reacting done"); - model.getState().setReacting(reacting); - } + this.reacting = reacting; } public boolean isReacting() { - return model.getState().isReacting(); + return reacting; } public void setSigma(double sigma) { diff --git a/src/eu/engys/combustion/CombustionSolutionView.java b/src/eu/engys/combustion/CombustionSolutionView.java index 22014e2..31f62c3 100644 --- a/src/eu/engys/combustion/CombustionSolutionView.java +++ b/src/eu/engys/combustion/CombustionSolutionView.java @@ -44,6 +44,7 @@ import eu.engys.core.modules.solutionmodelling.AbstractSolutionView; import eu.engys.core.modules.solutionmodelling.MultiphaseBuilder; import eu.engys.core.project.state.MultiphaseModel; import eu.engys.core.project.state.SolutionState; +import eu.engys.core.project.state.State; import eu.engys.core.project.state.ThermalState; import eu.engys.util.ui.builder.PanelBuilder; import eu.engys.util.ui.textfields.SpinnerField; @@ -64,6 +65,17 @@ public class CombustionSolutionView extends AbstractSolutionView { this.module = module; } + @Override + public boolean hasChanged(State state) { + if (module != null && reaction != null) { + return (module.isReacting() != reaction.isSelected()); + } + else { + return false; + } + + } + @Override public void buildThermal(PanelBuilder builder) { this.builder = builder; diff --git a/src/eu/engys/combustion/resources/combustion.stateData b/src/eu/engys/combustion/resources/combustion.stateData new file mode 100644 index 0000000..199ee5d --- /dev/null +++ b/src/eu/engys/combustion/resources/combustion.stateData @@ -0,0 +1,469 @@ +states +{ + reactingFoamRAS (transient compressible ras ); + reactingFoamRAS2 (PIMPLE compressible ras ); + reactingFoamRAS3 (PIMPLE compressible ras ); + + reactingFoamLES (transient compressible les ); + reactingFoamLES2 (PIMPLE compressible les ); + reactingFoamLES3 (PIMPLE compressible les ); +} + + +"reactingFoamRAS.*" +{ + fieldMaps + { + U U; + p_rgh pmultiphase; + alpha phase; + } + materialProperties + { + air{} + water{} + } + system + { + controlDict + { + startFrom startTime; + startTime 0; + stopAt endTime; + endTime 10; + deltaT 0.001; + writeControl adjustableRunTime; + writeInterval 0.1; + purgeWrite 0; + writeFormat ascii; + writePrecision 10; + writeCompression uncompressed; + timeFormat general; + timePrecision 6; + graphFormat raw; + runTimeModifiable yes; + adjustTimeStep yes; + maxCo 0.5; + maxAlphaCo 0.25; + maxDeltaT 1.0; + } + fvSchemes + { + ddtSchemes {$fvSchemes_ddtSchemes_ras_trans;} + + gradSchemes + { + $fvSchemes_gradSchemes; + grad(U) cellLimited Gauss linear 1; + grad(rho) cellLimited Gauss linear 1; + grad(p_rgh) cellLimited Gauss linear 1; + grad(pcorr) cellLimited Gauss linear 1; + } + + divSchemes + { + $fvSchemes_divSchemes_trans; + div(rhoPhi,U) Gauss linearUpwindV grad(U); + div(phi,alpha) Gauss vanLeer; + div(phirb,alpha) Gauss interfaceCompression; + div((nuEff*dev(T(grad(U))))) Gauss linear; + } + + $fvSchemes_misc; + fluxRequired + { + default no; + p_rgh; + pcorr; + "alpha.*"; + } + } + fvSolution + { + PIMPLE + { + momentumPredictor no; + nCorrectors 2; + nOuterCorrectors 1; + nNonOrthogonalCorrectors 0; + nAlphaCorr 1; + nAlphaSubCycles 3; + cAlpha 1.5; + correctPhi yes; + pRefCell 0; + pRefValue 0; + + residualControl + { + "(U|k|epsilon|omega|nuTilda|T|p_rgh|p)" + { + relTol 0; + tolerance 1e-5; + } + "alpha.*" + { + relTol 0; + tolerance 1e-5; + } + } + + } + solvers + { + + $fvSolution_solvers_PIMPLE; + + "pcorr.*" + { + solver PCG; + preconditioner + { + preconditioner GAMG; + tolerance 1e-5; + relTol 0; + smoother DICGaussSeidel; + nPreSweeps 0; + nPostSweeps 2; + nFinestSweeps 2; + cacheAgglomeration false; + nCellsInCoarsestLevel 10; + agglomerator faceAreaPair; + mergeLevels 1; + } + + tolerance 1e-05; + relTol 0; + maxIter 100; + minIter 1; + } + + "alpha.*" + { + solver smoothSolver; + smoother GaussSeidel; + tolerance 1e-6; + relTol 0; + nSweeps 1; + minIter 1; + nAlphaCorr 1; + nAlphaSubCycles 3; + cAlpha 1.5; + } + } + relaxationFactors {$fvSolution_relaxationFactors_trans;} + + } + } + + constant + { + g{$g;} + transportProperties + { + sigma sigma [1 0 -2 0 0 0 0 ] 0.0; + } + } +} + +"reactingFoamLES.*" +{ + fieldMaps + { + U U; + p_rgh pmultiphase; + alpha phase; + } + materialProperties + { + air{} + water{} + } + system + { + controlDict + { + startFrom startTime; + startTime 0; + stopAt endTime; + endTime 10; + deltaT 0.001; + writeControl adjustableRunTime; + writeInterval 0.1; + purgeWrite 0; + writeFormat ascii; + writePrecision 10; + writeCompression uncompressed; + timeFormat general; + timePrecision 6; + graphFormat raw; + runTimeModifiable yes; + adjustTimeStep yes; + maxCo 0.5; + maxAlphaCo 0.2; + maxDeltaT 1.0; + } + fvSchemes + { + ddtSchemes + { + default CrankNicolson 0.9; + } + + gradSchemes + { + $fvSchemes_gradSchemes; + grad(U) cellLimited Gauss linear 1; + grad(rho) cellLimited Gauss linear 1; + grad(p_rgh) cellLimited Gauss linear 1; + grad(pcorr) cellLimited Gauss linear 1; + } + + divSchemes + { + $fvSchemes_divSchemes_trans; + div(rhoPhi,U) Gauss LUST grad(U); + div(phi,alpha) Gauss vanLeer; + div(phirb,alpha) Gauss interfaceCompression; + div((nuEff*dev(T(grad(U))))) Gauss linear; + } + + $fvSchemes_misc; + fluxRequired + { + default no; + p_rgh; + pcorr; + "alpha.*"; + } + } + fvSolution + { + PIMPLE + { + momentumPredictor no; + nCorrectors 5; + nOuterCorrectors 1; + nNonOrthogonalCorrectors 1; + correctPhi yes; + pRefCell 0; + pRefValue 0; + + residualControl + { + "(U|k|epsilon|omega|nuTilda|T|p_rgh|p)" + { + relTol 0; + tolerance 1e-5; + } + "alpha.*" + { + relTol 0; + tolerance 1e-5; + } + } + + } + solvers + { + "pcorr.*" + { + solver PCG; + preconditioner + { + preconditioner GAMG; + tolerance 1e-5; + relTol 0; + smoother DICGaussSeidel; + nPreSweeps 0; + nPostSweeps 2; + nFinestSweeps 2; + cacheAgglomeration false; + nCellsInCoarsestLevel 10; + agglomerator faceAreaPair; + mergeLevels 1; + } + + tolerance 1e-05; + relTol 0; + maxIter 100; + minIter 1; + } + + p_rgh + { + solver GAMG; + tolerance 1e-8; + relTol 0.01; + smoother DIC; + nPreSweeps 0; + nPostSweeps 2; + nFinestSweeps 2; + cacheAgglomeration true; + nCellsInCoarsestLevel 10; + agglomerator faceAreaPair; + mergeLevels 1; + minIter 1; + } + + p_rghFinal + { + solver PCG; + preconditioner + { + preconditioner GAMG; + tolerance 1e-8; + relTol 0; + nVcycles 2; + smoother DICGaussSeidel; + nPreSweeps 2; + nPostSweeps 2; + nFinestSweeps 2; + cacheAgglomeration true; + nCellsInCoarsestLevel 10; + agglomerator faceAreaPair; + mergeLevels 1; + } + + tolerance 1e-8; + relTol 0; + maxIter 20; + minIter 1; + } + + U + { + solver smoothSolver; + smoother GaussSeidel; + tolerance 1e-6; + relTol 0.1; + nSweeps 1; + minIter 1; + } + k + { + solver smoothSolver; + smoother GaussSeidel; + tolerance 1e-6; + relTol 0.1; + nSweeps 1; + minIter 1; + } + kl + { + solver smoothSolver; + smoother GaussSeidel; + tolerance 1e-6; + relTol 0.1; + nSweeps 1; + minIter 1; + } + epsilon + { + solver smoothSolver; + smoother GaussSeidel; + tolerance 1e-6; + relTol 0.1; + nSweeps 1; + minIter 1; + } + nuTilda + { + solver smoothSolver; + smoother GaussSeidel; + tolerance 1e-6; + relTol 0.1; + nSweeps 1; + minIter 1; + } + omega + { + solver smoothSolver; + smoother GaussSeidel; + tolerance 1e-6; + relTol 0.1; + nSweeps 1; + minIter 1; + } + + + UFinal + { + solver smoothSolver; + smoother GaussSeidel; + tolerance 1e-6; + relTol 0; + nSweeps 1; + minIter 1; + } + kFinal + { + solver smoothSolver; + smoother GaussSeidel; + tolerance 1e-6; + relTol 0; + nSweeps 1; + minIter 1; + } + klFinal + { + solver smoothSolver; + smoother GaussSeidel; + tolerance 1e-6; + relTol 0; + nSweeps 1; + minIter 1; + } + epsilonFinal + { + solver smoothSolver; + smoother GaussSeidel; + tolerance 1e-6; + relTol 0; + nSweeps 1; + minIter 1; + } + nuTildaFinal + { + solver smoothSolver; + smoother GaussSeidel; + tolerance 1e-6; + relTol 0; + nSweeps 1; + minIter 1; + } + omegaFinal + { + solver smoothSolver; + smoother GaussSeidel; + tolerance 1e-6; + relTol 0; + nSweeps 1; + minIter 1; + } + "alpha.*" + { + solver smoothSolver; + smoother GaussSeidel; + tolerance 1e-6; + relTol 0; + nSweeps 1; + minIter 1; + nAlphaCorr 2; + nAlphaSubCycles 1; + cAlpha 1.5; + } + } + relaxationFactors {$fvSolution_relaxationFactors_trans;} + } + } + + constant + { + g{$g;} + transportProperties + { + sigma sigma [1 0 -2 0 0 0 0 ] 0.0; + } + } + +} diff --git a/src/eu/engys/core/project/state/State.java b/src/eu/engys/core/project/state/State.java index c3e7e0a..451b306 100644 --- a/src/eu/engys/core/project/state/State.java +++ b/src/eu/engys/core/project/state/State.java @@ -70,6 +70,7 @@ public class State { mach + "_MACH" + (radiation ? " - radiation" : "") + (solar ? " - solar" : "") + (energy ? " - energy" : "") + (buoyant ? " - buoyant" : "") + + (reacting ? " - reacting" : "") + " - multiphase: " + multiphaseModel.getLabel() + " with " + phases + " phases" + " - " + " - dynamic: " + dynamic + " - scalars: [ " + (aoa ? " AOA " : "") + (co2 ? " CO2 " : "") + (smoke ? " SMOKE " : "") + (humidity ? " HUMIDITY " : "") + "]";