Skip to content

Commit

Permalink
style: alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
asmfstatoil committed Mar 15, 2024
1 parent 9ea88d2 commit 720ebe4
Show file tree
Hide file tree
Showing 26 changed files with 653 additions and 650 deletions.
2 changes: 1 addition & 1 deletion eclipse-java-google-style.xml
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant.count_dependent" value="16|-1|16"/>
<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="100"/>
<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="120"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/>
Expand Down
4 changes: 2 additions & 2 deletions neqsim_formatter.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/>
<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="2"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/>
Expand Down Expand Up @@ -79,7 +79,7 @@
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.align_tags_descriptions_grouped" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="80"/>
<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="120"/>
<setting id="org.eclipse.jdt.core.formatter.use_on_off_tags" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.keep_method_body_on_one_line" value="one_line_never"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,9 @@ public double getZsaturation() {
}

/**
* <p>Getter for the field <code>saturationTemperature</code>.</p>
* <p>
* Getter for the field <code>saturationTemperature</code>.
* </p>
*
* @return the saturationTemperature
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,31 @@
* @version $Id: $Id
*/
public class DensityFunction extends LevenbergMarquardtFunction {
double molarMass = 0.0;
double molarMass = 0.0;

/**
* <p>
* Constructor for DensityFunction.
* </p>
*/
public DensityFunction() {
params = new double[1];
}
/**
* <p>
* Constructor for DensityFunction.
* </p>
*/
public DensityFunction() {
params = new double[1];
}

/** {@inheritDoc} */
@Override
public double calcValue(double[] dependentValues) {
system.setTemperature(dependentValues[0]);
thermoOps.TPflash();
system.initPhysicalProperties();
/** {@inheritDoc} */
@Override
public double calcValue(double[] dependentValues) {
system.setTemperature(dependentValues[0]);
thermoOps.TPflash();
system.initPhysicalProperties();

// system.display();
return system.getPhase(0).getPhysicalProperties().getDensity();
}
// system.display();
return system.getPhase(0).getPhysicalProperties().getDensity();
}

/** {@inheritDoc} */
@Override
public void setFittingParams(int i, double value) {
params[i] = value;
}
/** {@inheritDoc} */
@Override
public void setFittingParams(int i, double value) {
params[i] = value;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,35 +12,34 @@
* @version $Id: $Id
*/
public class FunctionJohanSverderup extends LevenbergMarquardtFunction {
double molarMass = 0.0;
double molarMass = 0.0;

/**
* <p>
* Constructor for FunctionJohanSverderup.
* </p>
*/
public FunctionJohanSverderup() {
params = new double[1];
}
/**
* <p>
* Constructor for FunctionJohanSverderup.
* </p>
*/
public FunctionJohanSverderup() {
params = new double[1];
}

/** {@inheritDoc} */
@Override
public double calcValue(double[] dependentValues) {
system.addComponent("methane",
-system.getPhase(0).getComponent("methane").getNumberOfmoles());
system.addComponent("methane", params[0]);
system.init_x_y();
system.init(1);
system.setPressure(system.getPressure() - 25.0);
SaturationPressure satCalc = new SaturationPressure(system);
double satPres = satCalc.calcSaturationPressure();
/** {@inheritDoc} */
@Override
public double calcValue(double[] dependentValues) {
system.addComponent("methane", -system.getPhase(0).getComponent("methane").getNumberOfmoles());
system.addComponent("methane", params[0]);
system.init_x_y();
system.init(1);
system.setPressure(system.getPressure() - 25.0);
SaturationPressure satCalc = new SaturationPressure(system);
double satPres = satCalc.calcSaturationPressure();

return satPres;
}
return satPres;
}

/** {@inheritDoc} */
@Override
public void setFittingParams(int i, double value) {
params[i] = value;
}
/** {@inheritDoc} */
@Override
public void setFittingParams(int i, double value) {
params[i] = value;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,51 +13,51 @@
* @version $Id: $Id
*/
public class SaturationPressureFunction extends LevenbergMarquardtFunction {
double molarMass = 0.0;
double molarMass = 0.0;

/**
* <p>
* Constructor for SaturationPressureFunction.
* </p>
*/
public SaturationPressureFunction() {
params = new double[1];
}

/** {@inheritDoc} */
@Override
public double calcValue(double[] dependentValues) {
int plusNumber = 0;
molarMass = params[0];
for (int i = 0; i < system.getPhase(0).getNumberOfComponents(); i++) {
if (system.getPhase(0).getComponent(i).isIsPlusFraction()) {
plusNumber = i;
}
}
SystemInterface tempSystem = system.clone();
tempSystem.resetCharacterisation();
tempSystem.createDatabase(true);
tempSystem.setMixingRule(system.getMixingRule());
/**
* <p>
* Constructor for SaturationPressureFunction.
* </p>
*/
public SaturationPressureFunction() {
params = new double[1];
}

tempSystem.getPhase(0).getComponent(plusNumber).setMolarMass(molarMass);
tempSystem.getPhase(1).getComponent(plusNumber).setMolarMass(molarMass);
tempSystem.setTemperature(dependentValues[0]);
tempSystem.setPressure(50.0);
tempSystem.getCharacterization().characterisePlusFraction();
tempSystem.createDatabase(true);
tempSystem.setMixingRule(system.getMixingRule());
tempSystem.init(0);
tempSystem.init(1);
// \\tempSystem.display();
SaturationPressure satCalc = new SaturationPressure(tempSystem);
double satPres = satCalc.calcSaturationPressure();
// tempSystem.display();
return satPres;
/** {@inheritDoc} */
@Override
public double calcValue(double[] dependentValues) {
int plusNumber = 0;
molarMass = params[0];
for (int i = 0; i < system.getPhase(0).getNumberOfComponents(); i++) {
if (system.getPhase(0).getComponent(i).isIsPlusFraction()) {
plusNumber = i;
}
}
SystemInterface tempSystem = system.clone();
tempSystem.resetCharacterisation();
tempSystem.createDatabase(true);
tempSystem.setMixingRule(system.getMixingRule());

/** {@inheritDoc} */
@Override
public void setFittingParams(int i, double value) {
params[i] = value;
}
tempSystem.getPhase(0).getComponent(plusNumber).setMolarMass(molarMass);
tempSystem.getPhase(1).getComponent(plusNumber).setMolarMass(molarMass);
tempSystem.setTemperature(dependentValues[0]);
tempSystem.setPressure(50.0);
tempSystem.getCharacterization().characterisePlusFraction();
tempSystem.createDatabase(true);
tempSystem.setMixingRule(system.getMixingRule());
tempSystem.init(0);
tempSystem.init(1);
// \\tempSystem.display();
SaturationPressure satCalc = new SaturationPressure(tempSystem);
double satPres = satCalc.calcSaturationPressure();
// tempSystem.display();
return satPres;
}

/** {@inheritDoc} */
@Override
public void setFittingParams(int i, double value) {
params[i] = value;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,51 +12,51 @@
* @version $Id: $Id
*/
public class ViscosityFunction extends LevenbergMarquardtFunction {
double molarMass = 0.0;
boolean includeWaxEmulsionViscosity = true;
double molarMass = 0.0;
boolean includeWaxEmulsionViscosity = true;

/**
* <p>
* Constructor for ViscosityFunction.
* </p>
*/
public ViscosityFunction() {
params = new double[1];
}
/**
* <p>
* Constructor for ViscosityFunction.
* </p>
*/
public ViscosityFunction() {
params = new double[1];
}

/**
* <p>
* Constructor for ViscosityFunction.
* </p>
*
* @param includeWax a boolean
*/
public ViscosityFunction(boolean includeWax) {
params = new double[1];
includeWaxEmulsionViscosity = includeWax;
}
/**
* <p>
* Constructor for ViscosityFunction.
* </p>
*
* @param includeWax a boolean
*/
public ViscosityFunction(boolean includeWax) {
params = new double[1];
includeWaxEmulsionViscosity = includeWax;
}

/** {@inheritDoc} */
@Override
public double calcValue(double[] dependentValues) {
thermoOps.TPflash();
system.initPhysicalProperties();
double waxFraction = 0.0;
if (system.hasPhaseType("wax") && includeWaxEmulsionViscosity) {
waxFraction = system.getWtFraction(system.getPhaseNumberOfPhase("wax"));
return system.getPhase(0).getPhysicalProperties().getViscosityOfWaxyOil(waxFraction,
dependentValues[0]); // %wax
}
// system.display();
return system.getPhase(0).getPhysicalProperties().getViscosity(); // %wax
/** {@inheritDoc} */
@Override
public double calcValue(double[] dependentValues) {
thermoOps.TPflash();
system.initPhysicalProperties();
double waxFraction = 0.0;
if (system.hasPhaseType("wax") && includeWaxEmulsionViscosity) {
waxFraction = system.getWtFraction(system.getPhaseNumberOfPhase("wax"));
return system.getPhase(0).getPhysicalProperties().getViscosityOfWaxyOil(waxFraction,
dependentValues[0]); // %wax
}
// system.display();
return system.getPhase(0).getPhysicalProperties().getViscosity(); // %wax
}

/** {@inheritDoc} */
@Override
public void setFittingParams(int i, double value) {
params[i] = value;
/** {@inheritDoc} */
@Override
public void setFittingParams(int i, double value) {
params[i] = value;

((FrictionTheoryViscosityMethod) system.getPhase(0).getPhysicalProperties()
.getViscosityModel()).setTBPviscosityCorrection(value);
}
((FrictionTheoryViscosityMethod) system.getPhase(0).getPhysicalProperties().getViscosityModel())
.setTBPviscosityCorrection(value);
}
}
Loading

0 comments on commit 720ebe4

Please sign in to comment.