Add reaction checkbox to thermal panel
This commit is contained in:
parent
971abb25f9
commit
ab7ba4b4b5
4 changed files with 37 additions and 31 deletions
|
|
@ -119,6 +119,7 @@ import eu.engys.launcher.ApplicationLauncher;
|
|||
import eu.engys.launcher.HELYXOSLauncher;
|
||||
import eu.engys.standardDynamic.StandardDynamicModule;
|
||||
import eu.engys.standardVOF.StandardVOFModule;
|
||||
import eu.engys.combustion.CombustionModule;
|
||||
import eu.engys.util.plaf.HelyxOSLookAndFeel;
|
||||
import eu.engys.util.plaf.ILookAndFeel;
|
||||
import eu.engys.util.progress.ProgressMonitor;
|
||||
|
|
@ -175,6 +176,7 @@ public class HELYXOSModule extends AbstractModule {
|
|||
Multibinder<ApplicationModule> applicationModules = Multibinder.newSetBinder(binder(), ApplicationModule.class);
|
||||
applicationModules.addBinding().to(StandardVOFModule.class).in(Singleton.class);
|
||||
applicationModules.addBinding().to(StandardDynamicModule.class).in(Singleton.class);
|
||||
applicationModules.addBinding().to(CombustionModule.class).in(Singleton.class);
|
||||
}
|
||||
|
||||
protected void configure3D() {
|
||||
|
|
|
|||
|
|
@ -56,12 +56,9 @@ public class CombustionModule extends ApplicationModuleAdapter {
|
|||
public static final String VOF_LABEL = "VOF";
|
||||
public static final String VOF_KEY = "VOF";
|
||||
|
||||
public static final MultiphaseModel VOF_MODEL = new MultiphaseModel(VOF_LABEL, VOF_KEY, true, true);
|
||||
|
||||
private CombustionSolutionView solutionView;
|
||||
private CombustionBoundaryConditionsView boundaryConditionsView;
|
||||
|
||||
private PhasesPanel phasesPanel;
|
||||
private TreeView treeView;
|
||||
|
||||
private double sigma;
|
||||
|
|
@ -77,8 +74,7 @@ public class CombustionModule extends ApplicationModuleAdapter {
|
|||
this.solutionView = new CombustionSolutionView(this);
|
||||
this.boundaryConditionsView = new CombustionBoundaryConditionsView(this);
|
||||
|
||||
this.phasesPanel = new PhasesPanel(model, new CombustionPhasesView(this, model));
|
||||
this.treeView = new CombustionTreeView(this, phasesPanel);
|
||||
this.treeView = new CombustionTreeView(this, null);
|
||||
|
||||
this.reader = new CombustionReader(model, this);
|
||||
|
||||
|
|
@ -112,21 +108,14 @@ public class CombustionModule extends ApplicationModuleAdapter {
|
|||
@Override
|
||||
public Set<ModulePanel> getCaseSetupPanels() {
|
||||
Set<ModulePanel> panels = new HashSet<>();
|
||||
panels.add(phasesPanel);
|
||||
return panels;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSolver(State state) {
|
||||
if (state.getMultiphaseModel().equals(VOF_MODEL)) {
|
||||
if (state.isIncompressible()) {
|
||||
if (state.isTransient()) {
|
||||
if (state.isDynamic()) {
|
||||
state.setSolver(INTER_DYM_FOAM);
|
||||
} else {
|
||||
state.setSolver(INTER_FOAM);
|
||||
}
|
||||
}
|
||||
if (state.isCompressible()) {
|
||||
if (state.isTransient()) {
|
||||
state.setSolver(REACTINGFOAM_FOAM);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -174,7 +163,7 @@ public class CombustionModule extends ApplicationModuleAdapter {
|
|||
}
|
||||
|
||||
public boolean isVOF() {
|
||||
return model.getState().getMultiphaseModel().equals(VOF_MODEL);
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setSigma(double sigma) {
|
||||
|
|
@ -189,6 +178,6 @@ public class CombustionModule extends ApplicationModuleAdapter {
|
|||
* For test purposes only
|
||||
*/
|
||||
public PhasesPanel getPhasesPanel() {
|
||||
return phasesPanel;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,10 +54,6 @@ public class CombustionReader {
|
|||
}
|
||||
|
||||
public void loadState() {
|
||||
if (isMultiphaseVOF()) {
|
||||
model.getState().setMultiphaseModel(CombustionModule.VOF_MODEL);
|
||||
model.getState().setPhases(2);
|
||||
}
|
||||
}
|
||||
|
||||
public void loadMaterials() {
|
||||
|
|
|
|||
|
|
@ -24,6 +24,8 @@
|
|||
*******************************************************************************/
|
||||
package eu.engys.combustion;
|
||||
|
||||
import javax.swing.JCheckBox;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
|
@ -31,6 +33,8 @@ 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.ThermalState;
|
||||
import eu.engys.util.ui.builder.PanelBuilder;
|
||||
import eu.engys.util.ui.textfields.SpinnerField;
|
||||
|
||||
public class CombustionSolutionView extends AbstractSolutionView {
|
||||
|
|
@ -38,16 +42,18 @@ public class CombustionSolutionView extends AbstractSolutionView {
|
|||
private static final Logger logger = LoggerFactory.getLogger(CombustionSolutionView.class);
|
||||
|
||||
private CombustionModule module;
|
||||
private MultiphaseBuilder builder;
|
||||
private PanelBuilder builder;
|
||||
|
||||
private JCheckBox reaction;
|
||||
|
||||
public CombustionSolutionView(CombustionModule module) {
|
||||
this.module = module;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buildMultiphase(MultiphaseBuilder builder) {
|
||||
public void buildThermal(PanelBuilder builder) {
|
||||
this.builder = builder;
|
||||
builder.addMultiphaseChoice(CombustionModule.VOF_MODEL);
|
||||
this.reaction = (JCheckBox) builder.startCheck("Reaction");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -55,19 +61,32 @@ public class CombustionSolutionView extends AbstractSolutionView {
|
|||
if (ss.areSolverTypeAndTimeAndFlowAndTurbulenceChoosen()) {
|
||||
boolean isVOFState = ss.isTransient() && ss.isIncompressible();
|
||||
if (isVOFState) {
|
||||
builder.enableChoice(CombustionModule.VOF_MODEL);
|
||||
// builder.enableChoice(CombustionModule.VOF_MODEL);
|
||||
} else {
|
||||
builder.disableChoice(CombustionModule.VOF_MODEL);
|
||||
// builder.disableChoice(CombustionModule.VOF_MODEL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fixMultiphase(MultiphaseModel mm) {
|
||||
SpinnerField phasesNumber = builder.getPhasesField();
|
||||
if (mm.equals(CombustionModule.VOF_MODEL)) {
|
||||
phasesNumber.setIntValue(2);
|
||||
phasesNumber.setEnabled(false);
|
||||
public void fixThermal(SolutionState ss, ThermalState ts) {
|
||||
if (ss.areSolverTypeAndTimeAndFlowAndTurbulenceChoosen()) {
|
||||
if (ss.isCoupled()) {
|
||||
if (reaction.isSelected()) {
|
||||
reaction.setEnabled(true);
|
||||
reaction.doClick();
|
||||
}
|
||||
reaction.setEnabled(false);
|
||||
} else {
|
||||
boolean isTransientCompressibleLES = ss.isTransient() && ss.isCompressible() && ss.isLES();
|
||||
reaction.setEnabled(true);
|
||||
if (reaction.isSelected() && (!ts.isEnergy() || isTransientCompressibleLES || ss.isHighMach())) {
|
||||
reaction.doClick();
|
||||
}
|
||||
reaction.setEnabled(ts.isEnergy() && !isTransientCompressibleLES && ss.isLowMach());
|
||||
}
|
||||
} else {
|
||||
reaction.setEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue