-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Delete .classpath * Delete .factorypath * update git ignore * Added new atractive term AtractiveTermMatCopPRUMRNew added * added new alpha term for UMR * disabled test * changed to use NeqSim MSAccessDB * rm invalid doc * pipe friction update * update * Update AtractiveTermMatCopPRUMRNew.java * Update ComponentEos.java * Update NeqSimDataBase.java * updates * update * updated UMR Matchias Copeman terms * update * update * further updates * small change in test * updated attr.term * updated vol.translation * just added simle PR for testing a calculation * attractive term for nitrogen * just added simper models to test some calculations * set volume correction to fals * updated devcontainer file (#410) (#411) * updated devcontainer file (#410) (#412) * added molar volume of two phases * arbitrary value for translation and tests * modified componentPRvolcor to make zero the outer get volume correction * several changes needed to be discussed * completion of the derivatives of small g and small f with regards to model B,C,V parameters * loc_C,getc,getC definitions..needing to be connected to translation definition 9with calcCi or omething) * numerous * Completion of the dF derivatives-needing changes in the way that all translation elements should be expressed e.g.Ci,cij etc * changes in volcor and some tests * Ci change * some more changes * more changes..(needing assitance to some printouts for all the F functions in order to compare with mine) * more * updates * chenges in tests * test to be checked by professor * I think I fixed the systemtest(see microsoft teams for details) * fetching also the rest of the derivative tests with the fixed setup * some changes * Added UMRCPA * modified component UMRCPA to not use the fixed a,b,c values of the CPA scheme! * use of attractive term via the PR EoS * some modifications that I did to test the volcor functions in mixtures * setting up the CPA version of my code into Neqsim through overriding the createComponent class+super.method+changing the Tc,Pc,w,ε,β parameters * ... * printouts for fugacities * print outs of fugacity * ... * added in CPA an enthalpy printout * added Hres+Cv * TESTING... * ... * fixed the bug * further sychronisation of my CPA with Neqsim CPA * crossscheck of new mc5 attractive term with my code * fixed radial g in PhaseSRKCPA * fixed componentSRKCPA original and simplified * several changes... * now all fug derivative tests are run for all phases * crosscheck of arbitrary PR_MC5_CPA EoS with my code-->on the road of fitting * small correction in dn derivative test * fugacities test fix * further correction * further fix Co-authored-by: Åsmund Våge Fannemel <[email protected]> Co-authored-by: Åsmund Våge Fannemel <[email protected]> Co-authored-by: GeorgeT <[email protected]>
- Loading branch information
1 parent
4cfdbb9
commit 4632e45
Showing
20 changed files
with
7,575 additions
and
3,664 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
729 changes: 367 additions & 362 deletions
729
src/main/java/neqsim/thermo/ThermodynamicModelTest.java
Large diffs are not rendered by default.
Oops, something went wrong.
4,503 changes: 2,244 additions & 2,259 deletions
4,503
src/main/java/neqsim/thermo/component/Component.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
191 changes: 191 additions & 0 deletions
191
src/main/java/neqsim/thermo/component/ComponentPRvolcor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,191 @@ | ||
/* | ||
* System_SRK_EOS.java | ||
* | ||
* Created on 8. april 2000, 23:14 | ||
*/ | ||
package neqsim.thermo.component; | ||
|
||
import neqsim.thermo.phase.PhaseInterface; | ||
import neqsim.thermo.phase.PhasePrEosvolcor; | ||
|
||
/** | ||
* | ||
* @author Even Solbraa | ||
* @version | ||
*/ | ||
public class ComponentPRvolcor extends ComponentPR { | ||
|
||
private static final long serialVersionUID = 1000; | ||
private double c; | ||
// private double calcc; | ||
public double[] Cij = new double[MAX_NUMBER_OF_COMPONENTS]; | ||
public double Ci = 0; | ||
public ComponentPRvolcor(int number, double TC, double PC, double M, double a, double moles) { | ||
super(number, TC, PC, M, a, moles); | ||
} | ||
|
||
/// ** {@inheritDoc} */ | ||
// @Override | ||
public double calcc() { | ||
return (0.1154 - 0.4406 * (0.29056 - 0.08775 * getAcentricFactor())) * R * criticalTemperature | ||
/ criticalPressure; | ||
} | ||
|
||
// derivative of translation with regards to temperature | ||
public double calccT() { | ||
return 0.; | ||
} | ||
|
||
// second derivative of translation with regards to temperature*temperature | ||
public double calccTT() { | ||
return 0.; | ||
} | ||
|
||
|
||
public ComponentPRvolcor(String component_name, double moles, double molesInPhase, | ||
int compnumber) { | ||
super(component_name, moles, molesInPhase, compnumber); | ||
c = (0.1154 - 0.4406 * (0.29056 - 0.08775 * getAcentricFactor())) * R * criticalTemperature | ||
/ criticalPressure; | ||
|
||
} | ||
|
||
/** {@inheritDoc} */ | ||
@Override | ||
public void init(double temp, double pres, double totMoles, double beta, int type) { | ||
super.init(temp, pres, totMoles, beta, type); | ||
c = calcc(); | ||
} | ||
|
||
|
||
/** {@inheritDoc} */ | ||
// @Override | ||
public double getc() { | ||
return c; | ||
} | ||
|
||
public double getcT() { | ||
return 0; | ||
} | ||
|
||
// derivative of C with regards to mole fraction | ||
/** {@inheritDoc} */ | ||
@Override | ||
public void Finit(PhaseInterface phase, double temp, double pres, double totMoles, double beta, | ||
int numberOfComponents, int type) | ||
{ | ||
super.Finit(phase, temp, pres, totMoles, beta, numberOfComponents, type); | ||
Ci = ((PhasePrEosvolcor) phase).calcCi(componentNumber, phase, temp, pres, numberOfComponents); | ||
if (type >= 2) { | ||
((PhasePrEosvolcor) phase).calcCiT(componentNumber, phase, temp, pres, | ||
numberOfComponents); | ||
} | ||
|
||
if (type >= 3) { | ||
for (int j = 0; j < numberOfComponents; j++) { | ||
Cij[j] = ((PhasePrEosvolcor) phase).calcCij(componentNumber, j, phase, temp, pres, | ||
numberOfComponents); | ||
} | ||
} | ||
} | ||
|
||
|
||
public double getCi() { | ||
return Ci; | ||
} | ||
|
||
|
||
public double getCij(int j) { | ||
return Cij[j]; | ||
} | ||
|
||
// depending on the type of the volume translation (T-dependent or not) these sould be properly | ||
// modified | ||
|
||
|
||
// second derivative of C with regards to mole fraction and temperature | ||
public double getCiT() { | ||
return 0; | ||
} | ||
|
||
public double getcTT() { | ||
return 0; | ||
} | ||
|
||
|
||
|
||
/// ** {@inheritDoc} */ do I need this inheritDoc thing? | ||
@Override | ||
public double dFdN(PhaseInterface phase, int numberOfComponents, double temperature, | ||
double pressure) { | ||
return phase.Fn() + phase.FB() * getBi() + phase.FD() * getAi() | ||
+ ((PhasePrEosvolcor) phase).FC() * getCi(); | ||
} | ||
|
||
public double getFC(PhaseInterface phase, int numberOfComponents, double temperature, | ||
double pressure) { | ||
return ((PhasePrEosvolcor) phase).FC(); | ||
} | ||
|
||
|
||
/** {@inheritDoc} */ | ||
@Override | ||
public double dFdNdT(PhaseInterface phase, int numberOfComponents, double temperature, | ||
double pressure) { | ||
double loc_CT = ((PhasePrEosvolcor) phase).getCT(); | ||
double loc_FnC = ((PhasePrEosvolcor) phase).FnC(); | ||
double loc_FBC = ((PhasePrEosvolcor) phase).FBC(); | ||
double loc_FCD = ((PhasePrEosvolcor) phase).FCD(); | ||
double loc_FC = ((PhasePrEosvolcor) phase).FC(); | ||
double loc_FCT = ((PhasePrEosvolcor) phase).FTC(); | ||
double loc_FCC = ((PhasePrEosvolcor) phase).FCC(); | ||
|
||
return loc_FnC * loc_CT | ||
+ (phase.FBT() + phase.FBD() * phase.getAT() + loc_FBC * loc_CT) * getBi() | ||
+ (loc_FCD * loc_CT + phase.FDT()) * getAi() | ||
+ (loc_FCT + loc_FCC * loc_CT + loc_FCD * phase.getAT()) * getCi() + phase.FD() * getAiT() | ||
+ loc_FC * getCiT(); | ||
} | ||
|
||
/** {@inheritDoc} */ | ||
@Override | ||
public double dFdNdN(int j, PhaseInterface phase, int numberOfComponents, double temperature, | ||
double pressure) { | ||
double loc_FnC = ((PhasePrEosvolcor) phase).FnC(); | ||
double loc_FBC = ((PhasePrEosvolcor) phase).FBC(); | ||
double loc_FCD = ((PhasePrEosvolcor) phase).FCD(); | ||
double loc_FC = ((PhasePrEosvolcor) phase).FC(); | ||
double loc_FCC = ((PhasePrEosvolcor) phase).FCC(); | ||
ComponentEosInterface[] comp_Array = (ComponentEosInterface[]) phase.getcomponentArray(); | ||
// return phase.FnB() * (getBi() + comp_Array[j].getBi()) | ||
// + phase.FBD() * (getBi() * comp_Array[j].getAi() + comp_Array[j].getBi() * getAi()) | ||
// + phase.FB() * getBij(j) + phase.FBB() * getBi() * comp_Array[j].getBi() | ||
// + phase.FD() * getAij(j); | ||
double loc_Cj = ((ComponentPRvolcor) comp_Array[j]).getCi(); | ||
// double loc_Ci= ((ComponentPRvolcor))component.getCi(); | ||
return phase.FnB() * comp_Array[j].getBi() + loc_FnC * loc_Cj | ||
+ (phase.FnB() + phase.FBB() * comp_Array[j].getBi() + loc_FBC * loc_Cj | ||
+ phase.FBD() * comp_Array[j].getAi()) * getBi() | ||
+ phase.FB() * getBij(j) | ||
+ (loc_FnC + loc_FCC * loc_Cj + loc_FBC * comp_Array[j].getBi() | ||
+ loc_FCD * comp_Array[j].getAi()) * getCi() | ||
+ loc_FC * getCij(j) + (loc_FCD * loc_Cj + phase.FBD() * comp_Array[j].getBi()) * getAi() | ||
+ phase.FD() * getAij(j); | ||
} | ||
|
||
|
||
/** {@inheritDoc} */ | ||
@Override | ||
public double dFdNdV(PhaseInterface phase, int numberOfComponents, double temperature, | ||
double pressure) { | ||
double loc_FCV = ((PhasePrEosvolcor) phase).FCV(); | ||
return phase.FnV() + phase.FBV() * getBi() + phase.FDV() * getAi() + loc_FCV * getCi(); | ||
} | ||
|
||
|
||
|
||
// Remember this trick above that professor showed to you...you can call whichever new F | ||
// expression | ||
// you need by first specifying the type "PhasePrEosvolcor" | ||
|
||
} |
Oops, something went wrong.