Reaction panel is added on checking reaction

This commit is contained in:
Yeongdo Park 2019-03-12 09:35:03 -07:00
parent 1b6c546d43
commit 26e94bdcf1
4 changed files with 488 additions and 9 deletions

View file

@ -72,6 +72,8 @@ public class CombustionModule extends ApplicationModuleAdapter {
private CombustionReader reader;
private boolean reacting;
@Inject
public CombustionModule(Model model) {
this.model = model;
@ -83,6 +85,8 @@ public class CombustionModule extends ApplicationModuleAdapter {
this.reader = new CombustionReader(model, this);
this.reacting = false;
this.defaults = new ModuleDefaults(this, model.getDefaults(), model.getDefaults().getDefaultStateData()) {
@Override
public Dictionary getDefaultsFieldMapsFor(State state, String region) {
@ -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) {

View file

@ -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;

View file

@ -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;
}
}
}

View file

@ -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 " : "") + "]";