Compare commits
17 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
26e94bdcf1 | ||
|
|
1b6c546d43 | ||
|
|
e3232940f1 | ||
|
|
edc1fabbbd | ||
|
|
bd679dea07 | ||
|
|
ab7ba4b4b5 | ||
|
|
971abb25f9 | ||
|
|
3b082dded2 | ||
|
|
c597ab5b4a | ||
|
|
d68e52e564 | ||
|
|
f457c8b3af | ||
|
|
1b8b0002b6 | ||
|
|
dcf0f15cee | ||
|
|
f369370fc2 | ||
|
|
471490caaf | ||
|
|
f921c0ea12 | ||
|
|
a2f0a3b776 |
18 changed files with 1490 additions and 34 deletions
|
|
@ -1,6 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry excluding="eu/engys/vtk/actors/" kind="src" path="src"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
12
.gitignore
vendored
12
.gitignore
vendored
|
|
@ -1 +1,11 @@
|
|||
/bin/
|
||||
HELYX-OS.sh
|
||||
bin
|
||||
dictData
|
||||
ext
|
||||
img
|
||||
lib
|
||||
.classpath
|
||||
.project
|
||||
build
|
||||
vtkError.txt
|
||||
|
||||
|
|
|
|||
11
.gitlab-ci.yml
Normal file
11
.gitlab-ci.yml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
image: registry.gitlab.com/combustion-postech/helyx-os
|
||||
|
||||
allwmake:
|
||||
stage: build
|
||||
tags:
|
||||
- docker
|
||||
script:
|
||||
- cd ${CI_PROJECT_DIR}
|
||||
- cp -R * /root/Engys/HELYX-OS/v2.4.0
|
||||
- cd /root/Engys/HELYX-OS/v2.4.0
|
||||
- ant -buildfile build_src.xml
|
||||
17
.project
17
.project
|
|
@ -1,17 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>HELYX-OS</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
11
README.md
11
README.md
|
|
@ -1,18 +1,11 @@
|
|||
# HELYX-OS
|
||||
[HELYX-OS](http://engys.com/products/helyx-os) is an open-source Graphical User Interface designed to work natively with OpenFOAM [version 4.1](http://www.openfoam.org/archive/4.1/download/source.php) and OpenFOAM [v1606+](http://openfoam.com/download/install-binary.php). The GUI is developed by [ENGYS](http://engys.com/) using Java+[VTK](http://www.vtk.org/) and delivered to the public under the GNU General Public License.
|
||||
[HELYX-OS](http://engys.com/products/helyx-os) is an open-source Graphical User Interface designed to work natively with OpenFOAM [version 4.1](http://www.openfoam.org/archive/4.1/download/source.php) and OpenFOAM v1606+. The GUI is developed by [ENGYS](http://engys.com/) using Java+[VTK](http://www.vtk.org/) and delivered to the public under the GNU General Public License.
|
||||
|
||||
HELYX-OS has been created to facilitate the usage of the standard OpenFOAM libraries, by removing the complexity of text based case definition in favour of an intuitive easy-to-use graphical user interface. The GUI is focused on pre-processing tasks, including meshing, case definition and solver execution. Visit the [HELYX-OS Project Page](http://engys.github.io/HELYX-OS/) for more information.
|
||||
|
||||
## Installing the latest binary file for 64 bit linux
|
||||
Visit [http://engys.github.io/HELYX-OS/](http://engys.github.io/HELYX-OS/) to download the latest HELYX-OS binary and view [installation instructions](http://engys.github.io/HELYX-OS/installation/).
|
||||
|
||||
## Configuring HELYX-OS for OpenFOAM v1606+
|
||||
To use OpenFOAM v1606+ installed via Docker following the instructions detailed [here](http://openfoam.com/download/install-binary.php) you need to do the following:
|
||||
- Open HELYX-OS
|
||||
- Go to Edit>Preferences
|
||||
- In the "Misc" section check the "Use Docker" tick box and then type "openfoamplus/of_v1606plus_centos66" in the "Docker Image" textbox
|
||||
- Press "OK" to apply settings
|
||||
|
||||
## Compiling HELYX-OS on your own
|
||||
|
||||
### Prerequisites
|
||||
|
|
@ -41,4 +34,4 @@ To use OpenFOAM v1606+ installed via Docker following the instructions detailed
|
|||
./HELYX-OS.sh
|
||||
|
||||
## Disclaimer
|
||||
None of the OPENFOAM® related products and services offered by ENGYS are approved or endorsed by OpenCFD Ltd. (ESI Group), producer of the OpenFOAM software and owner of the OPENFOAM® and OpenCFD® trade marks.
|
||||
This offering is not approved or endorsed by OpenCFD Limited, producer and distributor of the OpenFOAM software via www.openfoam.com, and owner of the OPENFOAM® and OpenCFD® trade marks.
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,81 @@
|
|||
/*******************************************************************************
|
||||
* | o |
|
||||
* | o o | HELYX-OS: The Open Source GUI for OpenFOAM |
|
||||
* | o O o | Copyright (C) 2012-2016 ENGYS |
|
||||
* | o o | http://www.engys.com |
|
||||
* | o | |
|
||||
* |---------------------------------------------------------------------------|
|
||||
* | License |
|
||||
* | This file is part of HELYX-OS. |
|
||||
* | |
|
||||
* | HELYX-OS is free software; you can redistribute it and/or modify it |
|
||||
* | under the terms of the GNU General Public License as published by the |
|
||||
* | Free Software Foundation; either version 2 of the License, or (at your |
|
||||
* | option) any later version. |
|
||||
* | |
|
||||
* | HELYX-OS is distributed in the hope that it will be useful, but WITHOUT |
|
||||
* | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
||||
* | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
||||
* | for more details. |
|
||||
* | |
|
||||
* | You should have received a copy of the GNU General Public License |
|
||||
* | along with HELYX-OS; if not, write to the Free Software Foundation, |
|
||||
* | Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
|
||||
*******************************************************************************/
|
||||
package eu.engys.combustion;
|
||||
|
||||
import eu.engys.core.modules.boundaryconditions.BoundaryConditionsView;
|
||||
import eu.engys.core.modules.boundaryconditions.BoundaryTypePanel;
|
||||
import eu.engys.core.modules.boundaryconditions.IBoundaryConditionsPanel;
|
||||
import eu.engys.core.project.Model;
|
||||
import eu.engys.core.project.zero.patches.BoundaryType;
|
||||
import eu.engys.gui.casesetup.boundaryconditions.panels.patch.MomentumPatch;
|
||||
import eu.engys.gui.casesetup.boundaryconditions.panels.wall.StandardMomentumWall;
|
||||
import eu.engys.gui.casesetup.boundaryconditions.parameterspanel.MomentumParametersPanel;
|
||||
|
||||
public class CombustionBoundaryConditionsView implements BoundaryConditionsView {
|
||||
|
||||
public static final String MOMENTUM = " " + MomentumParametersPanel.MOMENTUM + " ";
|
||||
private CombustionModule module;
|
||||
|
||||
public CombustionBoundaryConditionsView(CombustionModule module) {
|
||||
this.module = module;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configure(BoundaryTypePanel panel) {
|
||||
if (panel.getType() == BoundaryType.WALL) {
|
||||
panel.addPanel(MOMENTUM, new VOFStandardMomentumWall(panel), 0);
|
||||
} else if (panel.getType() == BoundaryType.PATCH) {
|
||||
panel.addPanel(MOMENTUM, new VOFStandardMomentumPatch(panel), 0);
|
||||
}
|
||||
}
|
||||
|
||||
class VOFStandardMomentumWall extends StandardMomentumWall {
|
||||
public VOFStandardMomentumWall(BoundaryTypePanel parent) {
|
||||
super(parent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEnabled(Model model) {
|
||||
return module.isReacting();
|
||||
}
|
||||
}
|
||||
|
||||
class VOFStandardMomentumPatch extends MomentumPatch {
|
||||
|
||||
public VOFStandardMomentumPatch(BoundaryTypePanel parent) {
|
||||
super(parent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEnabled(Model model) {
|
||||
return module.isReacting();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configure(IBoundaryConditionsPanel panel) {
|
||||
}
|
||||
|
||||
}
|
||||
196
src/eu/engys/combustion/CombustionModule.java
Normal file
196
src/eu/engys/combustion/CombustionModule.java
Normal file
|
|
@ -0,0 +1,196 @@
|
|||
/*******************************************************************************
|
||||
* | o |
|
||||
* | o o | HELYX-OS: The Open Source GUI for OpenFOAM |
|
||||
* | o O o | Copyright (C) 2012-2016 ENGYS |
|
||||
* | o o | http://www.engys.com |
|
||||
* | o | |
|
||||
* |---------------------------------------------------------------------------|
|
||||
* | License |
|
||||
* | This file is part of HELYX-OS. |
|
||||
* | |
|
||||
* | HELYX-OS is free software; you can redistribute it and/or modify it |
|
||||
* | under the terms of the GNU General Public License as published by the |
|
||||
* | Free Software Foundation; either version 2 of the License, or (at your |
|
||||
* | option) any later version. |
|
||||
* | |
|
||||
* | HELYX-OS is distributed in the hope that it will be useful, but WITHOUT |
|
||||
* | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
||||
* | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
||||
* | for more details. |
|
||||
* | |
|
||||
* | You should have received a copy of the GNU General Public License |
|
||||
* | along with HELYX-OS; if not, write to the Free Software Foundation, |
|
||||
* | Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
|
||||
*******************************************************************************/
|
||||
package eu.engys.combustion;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import eu.engys.core.dictionary.Dictionary;
|
||||
import eu.engys.core.dictionary.FieldElement;
|
||||
import eu.engys.core.modules.ApplicationModuleAdapter;
|
||||
import eu.engys.core.modules.ModuleDefaults;
|
||||
import eu.engys.core.modules.ModulePanel;
|
||||
import eu.engys.core.modules.boundaryconditions.BoundaryConditionsView;
|
||||
import eu.engys.core.modules.solutionmodelling.SolutionView;
|
||||
import eu.engys.core.modules.tree.TreeView;
|
||||
import eu.engys.core.project.Model;
|
||||
import eu.engys.core.project.defaults.DefaultsProvider;
|
||||
import eu.engys.core.project.state.Solver;
|
||||
import eu.engys.core.project.state.State;
|
||||
import eu.engys.core.project.state.StateBuilder;
|
||||
import eu.engys.core.project.zero.fields.Fields;
|
||||
import eu.engys.core.project.zero.fields.FieldsDefaults;
|
||||
import eu.engys.gui.casesetup.phases.PhasesPanel;
|
||||
import eu.engys.gui.casesetup.reactions.ReactionsPanel;
|
||||
|
||||
public class CombustionModule extends ApplicationModuleAdapter {
|
||||
|
||||
private static final String MODULE_NAME = "combustion";
|
||||
|
||||
public static final Solver REACTINGFOAM_FOAM = new Solver("reactingFoam");
|
||||
|
||||
public static final String VOF_LABEL = "VOF";
|
||||
public static final String VOF_KEY = "VOF";
|
||||
|
||||
private CombustionSolutionView solutionView;
|
||||
private CombustionBoundaryConditionsView boundaryConditionsView;
|
||||
|
||||
private ReactionsPanel reactionsPanel;
|
||||
private TreeView treeView;
|
||||
|
||||
private double sigma;
|
||||
|
||||
private Model model;
|
||||
private DefaultsProvider defaults;
|
||||
|
||||
private CombustionReader reader;
|
||||
|
||||
private boolean reacting;
|
||||
|
||||
@Inject
|
||||
public CombustionModule(Model model) {
|
||||
this.model = model;
|
||||
this.solutionView = new CombustionSolutionView(this);
|
||||
this.boundaryConditionsView = new CombustionBoundaryConditionsView(this);
|
||||
|
||||
this.reactionsPanel = new ReactionsPanel(model, new CombustionReactionsView(this, model));
|
||||
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
|
||||
public Dictionary getDefaultsFieldMapsFor(State state, String region) {
|
||||
Dictionary fieldMaps = super.getDefaultsFieldMapsFor(state, region);
|
||||
fixAlphaFieldName(fieldMaps);
|
||||
return fieldMaps;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private void fixAlphaFieldName(Dictionary fieldMaps) {
|
||||
if (model.getState().getMultiphaseModel().isMultiphase() && model.getState().getPhases() > 1 && fieldMaps != null && fieldMaps.found(Fields.ALPHA)) {
|
||||
String alpha = ((FieldElement) fieldMaps.remove(Fields.ALPHA)).getValue();
|
||||
fieldMaps.add(Fields.ALPHA + "." + model.getMaterials().getFirstMaterialName(), alpha);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return MODULE_NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TreeView getTreeView() {
|
||||
return treeView;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<ModulePanel> getCaseSetupPanels() {
|
||||
Set<ModulePanel> panels = new HashSet<>();
|
||||
return panels;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSolver(State state) {
|
||||
if (state.isCompressible()) {
|
||||
if (state.isTransient()) {
|
||||
state.setSolver(REACTINGFOAM_FOAM);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadState() {
|
||||
reader.loadState();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadMaterials() {
|
||||
reader.loadMaterials();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void save() {
|
||||
new CombustionWriter(model, this).write();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveDefaultsToProject() {
|
||||
if (isReacting()) {
|
||||
StateBuilder.saveDefaultsToProject(model, defaults);
|
||||
} else {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Fields loadDefaultsFields(String region) {
|
||||
if (isReacting()) {
|
||||
return FieldsDefaults.loadFieldsFromDefaults(model.getProject().getBaseDir(), model.getState(), defaults, model.getPatches(), region);
|
||||
} else {
|
||||
return new Fields();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public SolutionView getSolutionView() {
|
||||
return solutionView;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BoundaryConditionsView getBoundaryConditionsView() {
|
||||
return boundaryConditionsView;
|
||||
}
|
||||
|
||||
public void setReacting(boolean reacting) {
|
||||
this.reacting = reacting;
|
||||
}
|
||||
|
||||
public boolean isReacting() {
|
||||
return reacting;
|
||||
}
|
||||
|
||||
public void setSigma(double sigma) {
|
||||
this.sigma = sigma;
|
||||
}
|
||||
|
||||
public double getSigma() {
|
||||
return sigma;
|
||||
}
|
||||
|
||||
/*
|
||||
* For test purposes only
|
||||
*/
|
||||
public PhasesPanel getPhasesPanel() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
96
src/eu/engys/combustion/CombustionReactionsView.java
Normal file
96
src/eu/engys/combustion/CombustionReactionsView.java
Normal file
|
|
@ -0,0 +1,96 @@
|
|||
/*******************************************************************************
|
||||
* | o |
|
||||
* | o o | HELYX-OS: The Open Source GUI for OpenFOAM |
|
||||
* | o O o | Copyright (C) 2012-2016 ENGYS |
|
||||
* | o o | http://www.engys.com |
|
||||
* | o | |
|
||||
* |---------------------------------------------------------------------------|
|
||||
* | License |
|
||||
* | This file is part of HELYX-OS. |
|
||||
* | |
|
||||
* | HELYX-OS is free software; you can redistribute it and/or modify it |
|
||||
* | under the terms of the GNU General Public License as published by the |
|
||||
* | Free Software Foundation; either version 2 of the License, or (at your |
|
||||
* | option) any later version. |
|
||||
* | |
|
||||
* | HELYX-OS is distributed in the hope that it will be useful, but WITHOUT |
|
||||
* | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
||||
* | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
||||
* | for more details. |
|
||||
* | |
|
||||
* | You should have received a copy of the GNU General Public License |
|
||||
* | along with HELYX-OS; if not, write to the Free Software Foundation, |
|
||||
* | Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
|
||||
*******************************************************************************/
|
||||
package eu.engys.combustion;
|
||||
|
||||
import static eu.engys.core.project.constant.TransportProperties.SIGMA_KEY;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import eu.engys.core.dictionary.Dictionary;
|
||||
import eu.engys.core.dictionary.DimensionedScalar;
|
||||
import eu.engys.core.dictionary.model.DictionaryModel;
|
||||
import eu.engys.core.project.Model;
|
||||
import eu.engys.gui.casesetup.phases.PhasesView;
|
||||
import eu.engys.gui.casesetup.reactions.ReactionsView;
|
||||
import eu.engys.util.DimensionalUnits;
|
||||
import eu.engys.util.ui.builder.PanelBuilder;
|
||||
|
||||
public class CombustionReactionsView implements ReactionsView {
|
||||
|
||||
public static final String SURFACE_TENSION_LABEL = "Surface Tension [N/m]";
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(CombustionReactionsView.class);
|
||||
|
||||
private Model model;
|
||||
private CombustionModule module;
|
||||
private DictionaryModel sigmaModel = new DictionaryModel(new Dictionary(""));
|
||||
|
||||
private PanelBuilder parametersBuilder;
|
||||
|
||||
public CombustionReactionsView(CombustionModule module, Model model) {
|
||||
this.module = module;
|
||||
this.model = model;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void layoutComponents(PanelBuilder parametersBuilder) {
|
||||
this.parametersBuilder = parametersBuilder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void load(Model model) {
|
||||
if (module.isReacting()) {
|
||||
_layoutComponents();
|
||||
_load(model);
|
||||
}
|
||||
}
|
||||
|
||||
private void _layoutComponents() {
|
||||
parametersBuilder.clear();
|
||||
parametersBuilder.addComponent(SURFACE_TENSION_LABEL, sigmaModel.bindDimensionedDouble(SIGMA_KEY, DimensionalUnits.KG_S2, 0D, Double.MAX_VALUE));
|
||||
}
|
||||
|
||||
private void _load(Model model) {
|
||||
Dictionary dict = new Dictionary("");
|
||||
dict.add(new DimensionedScalar(SIGMA_KEY, String.valueOf(module.getSigma()), DimensionalUnits.KG_S2));
|
||||
sigmaModel.setDictionary(dict);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void save(Model model) {
|
||||
if (module.isReacting()) {
|
||||
_save(model);
|
||||
}
|
||||
}
|
||||
|
||||
private void _save(Model model) {
|
||||
Dictionary sigmaDict = sigmaModel.getDictionary();
|
||||
if (sigmaDict.found(SIGMA_KEY)) {
|
||||
module.setSigma(sigmaDict.lookupScalar(SIGMA_KEY).doubleValue());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
137
src/eu/engys/combustion/CombustionReader.java
Normal file
137
src/eu/engys/combustion/CombustionReader.java
Normal file
|
|
@ -0,0 +1,137 @@
|
|||
/*******************************************************************************
|
||||
* | o |
|
||||
* | o o | HELYX-OS: The Open Source GUI for OpenFOAM |
|
||||
* | o O o | Copyright (C) 2012-2016 ENGYS |
|
||||
* | o o | http://www.engys.com |
|
||||
* | o | |
|
||||
* |---------------------------------------------------------------------------|
|
||||
* | License |
|
||||
* | This file is part of HELYX-OS. |
|
||||
* | |
|
||||
* | HELYX-OS is free software; you can redistribute it and/or modify it |
|
||||
* | under the terms of the GNU General Public License as published by the |
|
||||
* | Free Software Foundation; either version 2 of the License, or (at your |
|
||||
* | option) any later version. |
|
||||
* | |
|
||||
* | HELYX-OS is distributed in the hope that it will be useful, but WITHOUT |
|
||||
* | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
||||
* | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
||||
* | for more details. |
|
||||
* | |
|
||||
* | You should have received a copy of the GNU General Public License |
|
||||
* | along with HELYX-OS; if not, write to the Free Software Foundation, |
|
||||
* | Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
|
||||
*******************************************************************************/
|
||||
package eu.engys.combustion;
|
||||
|
||||
import static eu.engys.core.project.constant.ThermophysicalProperties.MATERIAL_NAME_KEY;
|
||||
import static eu.engys.core.project.constant.TransportProperties.PHASES_KEY;
|
||||
import static eu.engys.core.project.constant.TransportProperties.SIGMA_KEY;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import eu.engys.core.dictionary.Dictionary;
|
||||
import eu.engys.core.project.Model;
|
||||
import eu.engys.core.project.constant.ConstantFolder;
|
||||
import eu.engys.core.project.constant.TransportProperties;
|
||||
import eu.engys.core.project.materials.Material;
|
||||
import eu.engys.core.project.materials.Materials;
|
||||
import eu.engys.gui.casesetup.materials.StandardMaterialsReader;
|
||||
|
||||
public class CombustionReader {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(CombustionReader.class);
|
||||
|
||||
private Model model;
|
||||
private CombustionModule module;
|
||||
|
||||
private TransportProperties transportProperties;
|
||||
|
||||
public CombustionReader(Model model, CombustionModule module) {
|
||||
this.model = model;
|
||||
this.module = module;
|
||||
}
|
||||
|
||||
public void loadState() {
|
||||
}
|
||||
|
||||
public void loadMaterials() {
|
||||
if (isMultiphaseVOF()) {
|
||||
if (model.getState().isIncompressible()) {
|
||||
readIncompressibleMaterials();
|
||||
} else {
|
||||
readCompressibleMaterials();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isMultiphaseVOF() {
|
||||
ConstantFolder constantFolder = model.getProject().getConstantFolder();
|
||||
TransportProperties transportProperties = constantFolder.getTransportProperties();
|
||||
if (transportProperties != null) {
|
||||
if ((transportProperties.found(PHASES_KEY))) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private void readIncompressibleMaterials() {
|
||||
Materials materials = model.getMaterials();
|
||||
ConstantFolder constantFolder = model.getProject().getConstantFolder();
|
||||
transportProperties = constantFolder.getTransportProperties();
|
||||
|
||||
if (transportProperties.found(PHASES_KEY)) {
|
||||
model.getState().setPhases(2);
|
||||
|
||||
String phases = transportProperties.lookup(PHASES_KEY).replaceAll("\\(", "").replaceAll("\\)", "").trim();
|
||||
|
||||
Dictionary dict1 = new Dictionary(transportProperties.subDict(phases.split(" ")[0]));
|
||||
if (!dict1.isEmpty()) {
|
||||
if (!dict1.found(MATERIAL_NAME_KEY)) {
|
||||
dict1.add(MATERIAL_NAME_KEY, "material1");
|
||||
}
|
||||
String name1 = dict1.lookup(MATERIAL_NAME_KEY);
|
||||
dict1.setName(name1);
|
||||
Material m1 = new StandardMaterialsReader().readIncompressibleMaterial(dict1);
|
||||
materials.add(m1);
|
||||
}
|
||||
|
||||
Dictionary dict2 = new Dictionary(transportProperties.subDict(phases.split(" ")[1]));
|
||||
if (!dict2.isEmpty()) {
|
||||
if (!dict2.found(MATERIAL_NAME_KEY)) {
|
||||
dict2.add(MATERIAL_NAME_KEY, "material2");
|
||||
}
|
||||
String name2 = dict2.lookup(MATERIAL_NAME_KEY);
|
||||
dict2.setName(name2);
|
||||
Material m2 = new StandardMaterialsReader().readIncompressibleMaterial(dict2);
|
||||
materials.add(m2);
|
||||
}
|
||||
|
||||
if (transportProperties.found(SIGMA_KEY)) {
|
||||
double sigma = transportProperties.lookupScalar(SIGMA_KEY).doubleValue();
|
||||
module.setSigma(sigma);
|
||||
} else if (dict1.found(SIGMA_KEY)) {
|
||||
double sigma = dict1.lookupScalar(SIGMA_KEY).doubleValue();
|
||||
module.setSigma(sigma);
|
||||
} else if (dict2.found(SIGMA_KEY)) {
|
||||
double sigma = dict2.lookupScalar(SIGMA_KEY).doubleValue();
|
||||
module.setSigma(sigma);
|
||||
}
|
||||
|
||||
model.materialsChanged();
|
||||
|
||||
} else {
|
||||
logger.warn("Multiphase case but no phases found in transportProperties");
|
||||
}
|
||||
}
|
||||
|
||||
public void readCompressibleMaterials() {
|
||||
logger.error("Multiphase Compressible not supported");
|
||||
}
|
||||
|
||||
}
|
||||
178
src/eu/engys/combustion/CombustionSolutionView.java
Normal file
178
src/eu/engys/combustion/CombustionSolutionView.java
Normal file
|
|
@ -0,0 +1,178 @@
|
|||
/*******************************************************************************
|
||||
* | o |
|
||||
* | o o | HELYX-OS: The Open Source GUI for OpenFOAM |
|
||||
* | o O o | Copyright (C) 2012-2016 ENGYS |
|
||||
* | o o | http://www.engys.com |
|
||||
* | o | |
|
||||
* |---------------------------------------------------------------------------|
|
||||
* | License |
|
||||
* | This file is part of HELYX-OS. |
|
||||
* | |
|
||||
* | HELYX-OS is free software; you can redistribute it and/or modify it |
|
||||
* | under the terms of the GNU General Public License as published by the |
|
||||
* | Free Software Foundation; either version 2 of the License, or (at your |
|
||||
* | option) any later version. |
|
||||
* | |
|
||||
* | HELYX-OS is distributed in the hope that it will be useful, but WITHOUT |
|
||||
* | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
||||
* | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
||||
* | for more details. |
|
||||
* | |
|
||||
* | You should have received a copy of the GNU General Public License |
|
||||
* | along with HELYX-OS; if not, write to the Free Software Foundation, |
|
||||
* | Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
|
||||
*******************************************************************************/
|
||||
package eu.engys.combustion;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Component;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import javax.swing.DefaultComboBoxModel;
|
||||
import javax.swing.JCheckBox;
|
||||
import javax.swing.JComboBox;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JList;
|
||||
import javax.swing.ListCellRenderer;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
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;
|
||||
|
||||
public class CombustionSolutionView extends AbstractSolutionView {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(CombustionSolutionView.class);
|
||||
|
||||
private CombustionModule module;
|
||||
private ActionListener listener;
|
||||
private PanelBuilder builder;
|
||||
|
||||
private JCheckBox reaction;
|
||||
|
||||
JComboBox<String> modelsCombo;
|
||||
|
||||
public CombustionSolutionView(CombustionModule module) {
|
||||
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;
|
||||
this.reaction = (JCheckBox) builder.startCheck("Reaction");
|
||||
|
||||
modelsCombo = new JComboBox<String>();
|
||||
modelsCombo.setPrototypeDisplayValue("Laminar");
|
||||
final ListCellRenderer<? super String> renderer = modelsCombo.getRenderer();
|
||||
modelsCombo.setRenderer(new ListCellRenderer<String>() {
|
||||
@Override
|
||||
public Component getListCellRendererComponent(JList<? extends String> list, String value, int index, boolean isSelected, boolean cellHasFocus) {
|
||||
Component c = renderer.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
|
||||
if (c instanceof JLabel && value instanceof String) {
|
||||
String model = (String) value;
|
||||
((JLabel) c).setText(model);
|
||||
}
|
||||
return c;
|
||||
}
|
||||
});
|
||||
|
||||
builder.addComponent("Combustion Model", modelsCombo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fixSolutionState(SolutionState ss) {
|
||||
if (ss.areSolverTypeAndTimeAndFlowAndTurbulenceChoosen()) {
|
||||
boolean isVOFState = ss.isTransient() && ss.isIncompressible();
|
||||
if (isVOFState) {
|
||||
// builder.enableChoice(CombustionModule.VOF_MODEL);
|
||||
} else {
|
||||
// builder.disableChoice(CombustionModule.VOF_MODEL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fixThermal(SolutionState ss, ThermalState ts) {
|
||||
module.setReacting(ts.isReacting());
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
String selectedItem = modelsCombo.getItemAt(modelsCombo.getSelectedIndex());
|
||||
|
||||
List<String> models = Arrays.asList(new String[]{"Laminar", "PaSR"});
|
||||
|
||||
modelsCombo.removeAllItems();
|
||||
String laminar = null;
|
||||
for (String combModel : models) {
|
||||
modelsCombo.addItem(combModel);
|
||||
if (combModel == "Laminar") {
|
||||
laminar = combModel;
|
||||
}
|
||||
}
|
||||
|
||||
if (((DefaultComboBoxModel<String>) modelsCombo.getModel()).getIndexOf(selectedItem) < 0) {
|
||||
modelsCombo.setSelectedItem(laminar);
|
||||
} else {
|
||||
modelsCombo.setSelectedItem(selectedItem);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setThermalListener(ActionListener listener) {
|
||||
this.listener = listener;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addThermalListener() {
|
||||
reaction.addActionListener(listener);
|
||||
modelsCombo.addActionListener(listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeThermalListener() {
|
||||
reaction.removeActionListener(listener);
|
||||
modelsCombo.removeActionListener(listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateThermalState(ThermalState ts) {
|
||||
ts.setReacting(reaction.isSelected());
|
||||
}
|
||||
}
|
||||
52
src/eu/engys/combustion/CombustionTreeView.java
Normal file
52
src/eu/engys/combustion/CombustionTreeView.java
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
/*******************************************************************************
|
||||
* | o |
|
||||
* | o o | HELYX-OS: The Open Source GUI for OpenFOAM |
|
||||
* | o O o | Copyright (C) 2012-2016 ENGYS |
|
||||
* | o o | http://www.engys.com |
|
||||
* | o | |
|
||||
* |---------------------------------------------------------------------------|
|
||||
* | License |
|
||||
* | This file is part of HELYX-OS. |
|
||||
* | |
|
||||
* | HELYX-OS is free software; you can redistribute it and/or modify it |
|
||||
* | under the terms of the GNU General Public License as published by the |
|
||||
* | Free Software Foundation; either version 2 of the License, or (at your |
|
||||
* | option) any later version. |
|
||||
* | |
|
||||
* | HELYX-OS is distributed in the hope that it will be useful, but WITHOUT |
|
||||
* | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
||||
* | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
||||
* | for more details. |
|
||||
* | |
|
||||
* | You should have received a copy of the GNU General Public License |
|
||||
* | along with HELYX-OS; if not, write to the Free Software Foundation, |
|
||||
* | Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
|
||||
*******************************************************************************/
|
||||
package eu.engys.combustion;
|
||||
|
||||
import eu.engys.core.modules.ModulePanel;
|
||||
import eu.engys.core.modules.tree.AbstractTreeViewAdapter;
|
||||
import eu.engys.core.modules.tree.ModuleElementPanel;
|
||||
import eu.engys.gui.casesetup.phases.PhasesPanel;
|
||||
import eu.engys.gui.casesetup.reactions.ReactionsPanel;
|
||||
|
||||
public class CombustionTreeView extends AbstractTreeViewAdapter {
|
||||
|
||||
private CombustionModule module;
|
||||
private ModulePanel reactionsPanel;
|
||||
|
||||
public CombustionTreeView(CombustionModule module, ReactionsPanel reactionsPanel) {
|
||||
this.module = module;
|
||||
this.reactionsPanel = reactionsPanel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateCaseSetupTree(ModuleElementPanel viewElementPanel) {
|
||||
if (module.isReacting()) {
|
||||
viewElementPanel.addPanel(reactionsPanel);
|
||||
} else {
|
||||
viewElementPanel.removePanel(reactionsPanel);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
101
src/eu/engys/combustion/CombustionWriter.java
Normal file
101
src/eu/engys/combustion/CombustionWriter.java
Normal file
|
|
@ -0,0 +1,101 @@
|
|||
/*******************************************************************************
|
||||
* | o |
|
||||
* | o o | HELYX-OS: The Open Source GUI for OpenFOAM |
|
||||
* | o O o | Copyright (C) 2012-2016 ENGYS |
|
||||
* | o o | http://www.engys.com |
|
||||
* | o | |
|
||||
* |---------------------------------------------------------------------------|
|
||||
* | License |
|
||||
* | This file is part of HELYX-OS. |
|
||||
* | |
|
||||
* | HELYX-OS is free software; you can redistribute it and/or modify it |
|
||||
* | under the terms of the GNU General Public License as published by the |
|
||||
* | Free Software Foundation; either version 2 of the License, or (at your |
|
||||
* | option) any later version. |
|
||||
* | |
|
||||
* | HELYX-OS is distributed in the hope that it will be useful, but WITHOUT |
|
||||
* | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
||||
* | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
||||
* | for more details. |
|
||||
* | |
|
||||
* | You should have received a copy of the GNU General Public License |
|
||||
* | along with HELYX-OS; if not, write to the Free Software Foundation, |
|
||||
* | Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
|
||||
*******************************************************************************/
|
||||
package eu.engys.combustion;
|
||||
|
||||
import static eu.engys.core.project.constant.TransportProperties.PHASES_KEY;
|
||||
import static eu.engys.core.project.constant.TransportProperties.SIGMA_KEY;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import eu.engys.core.dictionary.Dictionary;
|
||||
import eu.engys.core.dictionary.DimensionedScalar;
|
||||
import eu.engys.core.project.Model;
|
||||
import eu.engys.core.project.constant.ConstantFolder;
|
||||
import eu.engys.core.project.constant.TransportProperties;
|
||||
import eu.engys.core.project.materials.Material;
|
||||
import eu.engys.core.project.materials.Materials;
|
||||
import eu.engys.gui.casesetup.materials.StandardMaterialsWriter;
|
||||
|
||||
public class CombustionWriter {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(CombustionWriter.class);
|
||||
|
||||
private Model model;
|
||||
private CombustionModule module;
|
||||
|
||||
public CombustionWriter(Model model, CombustionModule module) {
|
||||
this.model = model;
|
||||
this.module = module;
|
||||
|
||||
}
|
||||
|
||||
public void write() {
|
||||
if (module.isReacting()) {
|
||||
if (model.getState().isIncompressible()) {
|
||||
writeIncompressibleMaterials();
|
||||
} else {
|
||||
writeCompressibleMaterials();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void writeCompressibleMaterials() {
|
||||
logger.error("Multiphase Compressible not supported");
|
||||
}
|
||||
|
||||
private void writeIncompressibleMaterials() {
|
||||
Materials materials = model.getMaterials();
|
||||
ConstantFolder constantFolder = model.getProject().getConstantFolder();
|
||||
TransportProperties transportProperties = constantFolder.getTransportProperties();
|
||||
|
||||
if (materials.size() == 2) {
|
||||
transportProperties.clear();
|
||||
|
||||
Material mat1 = materials.get(0);
|
||||
String mat1Name = mat1.getName();
|
||||
Material mat2 = materials.get(1);
|
||||
String mat2Name = mat2.getName();
|
||||
|
||||
transportProperties.add(PHASES_KEY, "(" + mat1Name + " " + mat2Name + ")");
|
||||
|
||||
Dictionary dict1 = new StandardMaterialsWriter(model).writeSingle_IncompressibleMaterial(mat1);
|
||||
dict1.remove(SIGMA_KEY);
|
||||
dict1.setName(mat1Name);
|
||||
transportProperties.add(dict1);
|
||||
|
||||
Dictionary dict2 = new StandardMaterialsWriter(model).writeSingle_IncompressibleMaterial(mat2);
|
||||
dict2.remove(SIGMA_KEY);
|
||||
dict2.setName(mat2Name);
|
||||
transportProperties.add(dict2);
|
||||
|
||||
double sigmaValue = module.getSigma();
|
||||
transportProperties.add(new DimensionedScalar(SIGMA_KEY, String.valueOf(sigmaValue), "[1 0 -2 0 0 0 0 ]"));
|
||||
|
||||
} else {
|
||||
logger.warn("Multiphase solution choosen but '{}' materials found", materials.size());
|
||||
}
|
||||
}
|
||||
}
|
||||
469
src/eu/engys/combustion/resources/combustion.stateData
Normal file
469
src/eu/engys/combustion/resources/combustion.stateData
Normal 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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -46,6 +46,7 @@ public class State {
|
|||
private boolean buoyant;
|
||||
private boolean radiation;
|
||||
private boolean solar;
|
||||
private boolean reacting;
|
||||
|
||||
private boolean adjoint;
|
||||
|
||||
|
|
@ -69,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 " : "") + "]";
|
||||
|
|
@ -213,6 +215,14 @@ public class State {
|
|||
public boolean isSolar() {
|
||||
return solar;
|
||||
}
|
||||
|
||||
public void setReacting(boolean reacting) {
|
||||
this.reacting = reacting;
|
||||
}
|
||||
|
||||
public boolean isReacting() {
|
||||
return reacting;
|
||||
}
|
||||
|
||||
public void setAdjoint(boolean adjoint) {
|
||||
this.adjoint = adjoint;
|
||||
|
|
|
|||
|
|
@ -29,17 +29,20 @@ public class ThermalState {
|
|||
public static final String THERMAL = "Thermal";
|
||||
public static final String ENERGY = "Energy";
|
||||
public static final String BUOYANCY = "Buoyancy";
|
||||
public static final String REACTING = "Reacting";
|
||||
|
||||
private boolean energy;
|
||||
private boolean buoyancy;
|
||||
private boolean radiation;
|
||||
private boolean solar;
|
||||
private boolean reacting;
|
||||
|
||||
public ThermalState() {
|
||||
this.setEnergy(false);
|
||||
this.setBuoyancy(false);
|
||||
this.setBuoyancy(false);
|
||||
this.setSolar(false);
|
||||
this.setReacting(false);
|
||||
}
|
||||
|
||||
public ThermalState(State state) {
|
||||
|
|
@ -47,6 +50,7 @@ public class ThermalState {
|
|||
this.setBuoyancy(state.isBuoyant());
|
||||
this.setRadiation(state.isRadiation());
|
||||
this.setSolar(state.isSolar());
|
||||
this.setReacting(state.isReacting());
|
||||
}
|
||||
|
||||
public boolean isEnergy() {
|
||||
|
|
@ -81,8 +85,17 @@ public class ThermalState {
|
|||
this.solar = solar;
|
||||
}
|
||||
|
||||
public boolean isReacting() {
|
||||
return reacting;
|
||||
}
|
||||
|
||||
public void setReacting(boolean reacting) {
|
||||
this.reacting = reacting;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Energy: " + (isEnergy() ? "ON" : "OFF") + ", Buoyancy: " + (isBuoyancy() ? "ON" : "OFF") + ", Radiation: " + (isRadiation() ? "ON" : "OFF") + ", Solar: " + (isSolar() ? "ON" : "OFF");
|
||||
return "Energy: " + (isEnergy() ? "ON" : "OFF") + ", Buoyancy: " + (isBuoyancy() ? "ON" : "OFF") + ", Radiation: " + (isRadiation() ? "ON" : "OFF") + ", Solar: " + (isSolar() ? "ON" : "OFF")
|
||||
+ ", Reacting: " + (isReacting() ? "ON" : "OFF");
|
||||
}
|
||||
}
|
||||
92
src/eu/engys/gui/casesetup/reactions/ReactionsPanel.java
Normal file
92
src/eu/engys/gui/casesetup/reactions/ReactionsPanel.java
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
/*******************************************************************************
|
||||
* | o |
|
||||
* | o o | HELYX-OS: The Open Source GUI for OpenFOAM |
|
||||
* | o O o | Copyright (C) 2012-2016 ENGYS |
|
||||
* | o o | http://www.engys.com |
|
||||
* | o | |
|
||||
* |---------------------------------------------------------------------------|
|
||||
* | License |
|
||||
* | This file is part of HELYX-OS. |
|
||||
* | |
|
||||
* | HELYX-OS is free software; you can redistribute it and/or modify it |
|
||||
* | under the terms of the GNU General Public License as published by the |
|
||||
* | Free Software Foundation; either version 2 of the License, or (at your |
|
||||
* | option) any later version. |
|
||||
* | |
|
||||
* | HELYX-OS is distributed in the hope that it will be useful, but WITHOUT |
|
||||
* | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
||||
* | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
||||
* | for more details. |
|
||||
* | |
|
||||
* | You should have received a copy of the GNU General Public License |
|
||||
* | along with HELYX-OS; if not, write to the Free Software Foundation, |
|
||||
* | Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
|
||||
*******************************************************************************/
|
||||
package eu.engys.gui.casesetup.reactions;
|
||||
|
||||
import javax.swing.JComponent;
|
||||
|
||||
import eu.engys.core.project.Model;
|
||||
import eu.engys.gui.DefaultGUIPanel;
|
||||
import eu.engys.util.ui.ExecUtil;
|
||||
import eu.engys.util.ui.builder.PanelBuilder;
|
||||
|
||||
public class ReactionsPanel extends DefaultGUIPanel {
|
||||
|
||||
public static final String REACTIONS = "Reactions";
|
||||
|
||||
private ReactionsView reactionsView;
|
||||
|
||||
public ReactionsPanel(Model model, ReactionsView reactionsView) {
|
||||
super(REACTIONS, model);
|
||||
this.reactionsView = reactionsView;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getKey() {
|
||||
return REACTIONS + "_" + reactionsView.getClass().getCanonicalName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void load() {
|
||||
reactionsView.load(model);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void save() {
|
||||
reactionsView.save(model);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stateChanged() {
|
||||
rebuildPanel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void materialsChanged() {
|
||||
rebuildPanel();
|
||||
}
|
||||
|
||||
private void rebuildPanel() {
|
||||
ExecUtil.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
removeAll();
|
||||
layoutPanel();
|
||||
load();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected JComponent layoutComponents() {
|
||||
PanelBuilder builder = new PanelBuilder();
|
||||
reactionsView.layoutComponents(builder);
|
||||
return builder.removeMargins().getPanel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIndex() {
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
38
src/eu/engys/gui/casesetup/reactions/ReactionsView.java
Normal file
38
src/eu/engys/gui/casesetup/reactions/ReactionsView.java
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
/*******************************************************************************
|
||||
* | o |
|
||||
* | o o | HELYX-OS: The Open Source GUI for OpenFOAM |
|
||||
* | o O o | Copyright (C) 2012-2016 ENGYS |
|
||||
* | o o | http://www.engys.com |
|
||||
* | o | |
|
||||
* |---------------------------------------------------------------------------|
|
||||
* | License |
|
||||
* | This file is part of HELYX-OS. |
|
||||
* | |
|
||||
* | HELYX-OS is free software; you can redistribute it and/or modify it |
|
||||
* | under the terms of the GNU General Public License as published by the |
|
||||
* | Free Software Foundation; either version 2 of the License, or (at your |
|
||||
* | option) any later version. |
|
||||
* | |
|
||||
* | HELYX-OS is distributed in the hope that it will be useful, but WITHOUT |
|
||||
* | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
||||
* | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
||||
* | for more details. |
|
||||
* | |
|
||||
* | You should have received a copy of the GNU General Public License |
|
||||
* | along with HELYX-OS; if not, write to the Free Software Foundation, |
|
||||
* | Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
|
||||
*******************************************************************************/
|
||||
package eu.engys.gui.casesetup.reactions;
|
||||
|
||||
import eu.engys.core.project.Model;
|
||||
import eu.engys.util.ui.builder.PanelBuilder;
|
||||
|
||||
public interface ReactionsView {
|
||||
|
||||
void layoutComponents(PanelBuilder parametersBuilder);
|
||||
|
||||
void load(Model model);
|
||||
|
||||
void save(Model model);
|
||||
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue