Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docfix and style #609

Merged
merged 6 commits into from
Mar 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 37 additions & 69 deletions src/main/java/neqsim/physicalProperties/PhysicalPropertyHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import neqsim.physicalProperties.physicalPropertySystem.PhysicalPropertiesInterface;
import neqsim.physicalProperties.physicalPropertySystem.commonPhasePhysicalProperties.DefaultPhysicalProperties;
import neqsim.physicalProperties.physicalPropertySystem.gasPhysicalProperties.GasPhysicalProperties;
import neqsim.physicalProperties.physicalPropertySystem.liquidPhysicalProperties.AminePhysicalProperties;
import neqsim.physicalProperties.physicalPropertySystem.liquidPhysicalProperties.CO2waterPhysicalProperties;
import neqsim.physicalProperties.physicalPropertySystem.liquidPhysicalProperties.GlycolPhysicalProperties;
import neqsim.physicalProperties.physicalPropertySystem.liquidPhysicalProperties.LiquidPhysicalProperties;
import neqsim.physicalProperties.physicalPropertySystem.liquidPhysicalProperties.WaterPhysicalProperties;
import neqsim.physicalProperties.physicalPropertySystem.solidPhysicalProperties.SolidPhysicalProperties;
import neqsim.thermo.phase.PhaseInterface;

Expand All @@ -14,14 +22,10 @@
* @version $Id: $Id
*/
public class PhysicalPropertyHandler implements Cloneable, java.io.Serializable {
private neqsim.physicalProperties.physicalPropertySystem.PhysicalPropertiesInterface gasPhysicalProperties =
null;
private neqsim.physicalProperties.physicalPropertySystem.PhysicalPropertiesInterface oilPhysicalProperties =
null;
private neqsim.physicalProperties.physicalPropertySystem.PhysicalPropertiesInterface aqueousPhysicalProperties =
null;
private neqsim.physicalProperties.physicalPropertySystem.PhysicalPropertiesInterface solidPhysicalProperties =
null;
private PhysicalPropertiesInterface gasPhysicalProperties = null;
private PhysicalPropertiesInterface oilPhysicalProperties = null;
private PhysicalPropertiesInterface aqueousPhysicalProperties = null;
private PhysicalPropertiesInterface solidPhysicalProperties = null;
private neqsim.physicalProperties.mixingRule.PhysicalPropertyMixingRule mixingRule = null;
static Logger logger = LogManager.getLogger(PhysicalPropertyHandler.class);
private static final long serialVersionUID = 1000;
Expand All @@ -39,75 +43,39 @@ public PhysicalPropertyHandler() {}
* </p>
*
* @param phase a {@link neqsim.thermo.phase.PhaseInterface} object
* @param type a int
* @param type 0 Orginal/default 1 Water 2 Glycol 3 Amine 4 CO2Water 6 Basic
*/
public void setPhysicalProperties(PhaseInterface phase, int type) {
switch (type) {
case 0:
gasPhysicalProperties =
new neqsim.physicalProperties.physicalPropertySystem.gasPhysicalProperties.GasPhysicalProperties(
phase, 0, 0);
oilPhysicalProperties =
new neqsim.physicalProperties.physicalPropertySystem.liquidPhysicalProperties.LiquidPhysicalProperties(
phase, 0, 0);
aqueousPhysicalProperties =
new neqsim.physicalProperties.physicalPropertySystem.liquidPhysicalProperties.WaterPhysicalProperties(
phase, 0, 0);
case 0: // Default
gasPhysicalProperties = new GasPhysicalProperties(phase, 0, 0);
oilPhysicalProperties = new LiquidPhysicalProperties(phase, 0, 0);
aqueousPhysicalProperties = new WaterPhysicalProperties(phase, 0, 0);
break;
case 1:
gasPhysicalProperties =
new neqsim.physicalProperties.physicalPropertySystem.gasPhysicalProperties.GasPhysicalProperties(
phase, 0, 0);
oilPhysicalProperties =
new neqsim.physicalProperties.physicalPropertySystem.liquidPhysicalProperties.LiquidPhysicalProperties(
phase, 0, 0);
aqueousPhysicalProperties =
new neqsim.physicalProperties.physicalPropertySystem.liquidPhysicalProperties.WaterPhysicalProperties(
phase, 0, 0);
case 1: // Water
gasPhysicalProperties = new GasPhysicalProperties(phase, 0, 0);
oilPhysicalProperties = new LiquidPhysicalProperties(phase, 0, 0);
aqueousPhysicalProperties = new WaterPhysicalProperties(phase, 0, 0);
break;
case 2:
gasPhysicalProperties =
new neqsim.physicalProperties.physicalPropertySystem.gasPhysicalProperties.GasPhysicalProperties(
phase, 0, 0);
oilPhysicalProperties =
new neqsim.physicalProperties.physicalPropertySystem.liquidPhysicalProperties.LiquidPhysicalProperties(
phase, 0, 0);
aqueousPhysicalProperties =
new neqsim.physicalProperties.physicalPropertySystem.liquidPhysicalProperties.GlycolPhysicalProperties(
phase, 0, 0);
case 2: // Glycol
gasPhysicalProperties = new GasPhysicalProperties(phase, 0, 0);
oilPhysicalProperties = new LiquidPhysicalProperties(phase, 0, 0);
aqueousPhysicalProperties = new GlycolPhysicalProperties(phase, 0, 0);
break;
case 3:
gasPhysicalProperties =
new neqsim.physicalProperties.physicalPropertySystem.gasPhysicalProperties.GasPhysicalProperties(
phase, 0, 0);
oilPhysicalProperties =
new neqsim.physicalProperties.physicalPropertySystem.liquidPhysicalProperties.LiquidPhysicalProperties(
phase, 0, 0);
aqueousPhysicalProperties =
new neqsim.physicalProperties.physicalPropertySystem.liquidPhysicalProperties.AminePhysicalProperties(
phase, 0, 0);
case 3: // Amine
gasPhysicalProperties = new GasPhysicalProperties(phase, 0, 0);
oilPhysicalProperties = new LiquidPhysicalProperties(phase, 0, 0);
aqueousPhysicalProperties = new AminePhysicalProperties(phase, 0, 0);
break;
case 4:
gasPhysicalProperties =
new neqsim.physicalProperties.physicalPropertySystem.gasPhysicalProperties.GasPhysicalProperties(
phase, 0, 0);
oilPhysicalProperties =
new neqsim.physicalProperties.physicalPropertySystem.liquidPhysicalProperties.LiquidPhysicalProperties(
phase, 0, 0);
aqueousPhysicalProperties =
new neqsim.physicalProperties.physicalPropertySystem.liquidPhysicalProperties.CO2waterPhysicalProperties(
phase, 0, 0);
case 4: // CO2water
gasPhysicalProperties = new GasPhysicalProperties(phase, 0, 0);
oilPhysicalProperties = new LiquidPhysicalProperties(phase, 0, 0);
aqueousPhysicalProperties = new CO2waterPhysicalProperties(phase, 0, 0);
break;
case 6:
gasPhysicalProperties =
new neqsim.physicalProperties.physicalPropertySystem.commonPhasePhysicalProperties.DefaultPhysicalProperties(
phase, 0, 0);
oilPhysicalProperties =
new neqsim.physicalProperties.physicalPropertySystem.commonPhasePhysicalProperties.DefaultPhysicalProperties(
phase, 0, 0);
aqueousPhysicalProperties =
new neqsim.physicalProperties.physicalPropertySystem.commonPhasePhysicalProperties.DefaultPhysicalProperties(
phase, 0, 0);
case 6: // Basic?
gasPhysicalProperties = new DefaultPhysicalProperties(phase, 0, 0);
oilPhysicalProperties = new DefaultPhysicalProperties(phase, 0, 0);
aqueousPhysicalProperties = new DefaultPhysicalProperties(phase, 0, 0);
break;
default:
logger
Expand Down
Loading