User:Vishnu: Difference between revisions

From ASCEND
Jump to navigation Jump to search
Vishnu (talk | contribs)
Vishnu (talk | contribs)
Line 56: Line 56:
char* description;
char* description;
double T_base, T_max, T_min, T_minPsat, x_base, x_max, x_min;  
double T_base, T_max, T_min, T_minPsat, x_base, x_max, x_min;  
} fprops;
} fprops_incompressible;
</source>
</source>
</blockquote>
</blockquote>

Revision as of 02:43, 20 August 2016

My GSoC 2016 project will be on the topic Adding incompressible fluids EOS to FPROPS. The project details and proposal are on the official GSOC website. My mentors will be John Pye and Mahesh Venkataraman.

My code is at vishnu:.

Approach

Here are some examples of current incompressible fluid support in ASCEND:

The project is divided into two parts:

  1. Develop a stand alone code for computing popular thermodynamic properties for incompressible pure fluids as well as mixtures.
    • This includes development of new evaluation functions for incompressible fluids based on polynomial, exponential and exponential-polynomial mathematical models with fitting coefficients extracted from various published journal articles. The development of the stand alone code will finally consist of extensive verification and validation with available data in CoolProp. The deadline to complete this work will be June 27, 2016 (GSoC '16 mid-term).
  2. Enhance the FRPOPS module with the features of the developed stand alone code
    • This second part (post mid-term) will consist of developing the incompressible fluid data structures from the existing structures in FPROPS. The property evaluation functions developed in the first part will be then linked with FPROPS, hence completely adding the incompressible EOS to FPROPS.

Weekly updates

Before 23 May 2016 (community bonding period and before)

Updates:

  1. Active participation with ascend-sim-users link
  2. Executed several ready made ASCEND models (for nitrogen and oxygen) provided by Dr. John Pye (that invoke FPROPS)
  3. Understood the implementation of TTSE (done by Dr. Sidharth Somanathan, GSoC '15 student) link
  4. Reported minor bug related to the test for 'Nitrogen' link

Work under progress:

  1. Understand call graph and data flow of ASCEND-FPROPS models

30 May 2016

Updates:

  1. Identified existing incompressible models written for a pure fluid (liquidsodium) and a molten mixture (KNO3:NaNO3)
  2. Literature review
    • Found repositories (in JSON format from CoolProp) for extracting coefficient matrices (as discussed in the proposal) of incompressible fluid models (above 100 pure and mixture fluids)
    • Different evaluation functions required for different types of fit coefficients are: polynomial type, exponential type and exponential-polynomial type

Work under progress:

  1. Understand the implementation of incompressible fluid models in CoolProp
  2. Start with a standalone code for incompressible fluids
    • Extract the coefficient matrix by implementing a JSON-to-C file parser
    • Implement the evaluation functions

06 June 2016

Updates:

  1. Identified relevant 'C' structures required for incompressible fluids
typedef struct {
	char* type;
	double** coeff;
	int numc_r, numc_c;	// number of rows and columns in coefficient matrix respectively
} coefficients;

typedef struct {
	coefficients T_freeze, conductivity, density, specific_heat, viscosity, saturation_pressure;
	char* x_id;
	char* description;
	double T_base, T_max, T_min, T_minPsat, x_base, x_max, x_min; 
} fprops_incompressible;
  1. JSON-to-C file parser added to the standalone code and subsequently loaded the incompressible fluid data structures

Work under progress:

  1. Adding property evaluation functions to the standalone code
    • for 'density', 'conductivity', 'heat capacity' and 'viscosity'
    • as function of 'temperature' (as discussed in the proposal)

13 June 2016

Updates:

  1. Still working on incompressible standalone code (please review the committed work)
  2. Added property evaluation functions for density, conductivity, heat capacity and viscosity
  3. Added functions to compute properties from different types of fit coefficients: polynomial, exponential, exponential-polynomial
  4. Analyzed preliminary results for "Zitrec S55, Potassium formate/Sodium propionate"

Work under progress:

  1. Comparing with respective computations of CoolProp to detect the root-cause behind mismatching results

Future discussion:

  1. What is the purpose of "NRMS" (normalized root-mean-square provided in the 'JSON' files of CoolProp)? Do I have to include that anywhere in the calculations or is it just additional info?
    NRMS is just a measure of correlation/agreement between results. When the value is low, it means there is good agreement. Note the ambiguity in the definition around 'nomalized'

20 June 2016

Updates:

  1. Dived deep into CoolProp evaluation functions and debugged the existing code for 'pure' fluids.
  2. Ran test cases for
    • Zitrec S55, Potassium Formate/Sodium Propionate (to test polynomial and exp-polynomial functions) and
    • Water (exponential viscosity model)
  3. Exponential type model for viscosity - bugs:
    • The model was not based on a centered-fit approach.
    • There is no need to subtract the base property (Temperature in our case) before evaluating the model.
    • Also, there is a change in sign for one of the viscosity coefficients entered in the original JSON files.
  4. Demonstrated exact results to that generated by CoolProp (compare Original_*.pdf to Results_*.pdf in repository)

Conclusion: Pure fluids incompressible EOS ready to be merged with FPROPS

Work under progress till July 27 (GSoC mid-term):

  1. Get the EOS for incompressible mixtures working: Demonstrate match for LiBr
  2. Add integration functions to evaluate 'internal energy','enthalpy' and 'entropy' (as discussed in proposal)

Further Discussions:

  1. Please note that models for incompressible mixtures are further complicated as we now have 2D coefficient matrices. Are there simplified models?

27 June 2016

Here is the update (till GSoC '16 mid-term):

  1. Developed a working stand alone code for evaluating incompressible EOS (pure fluids and mixtures)
    • Consists of JSON-to-C parser (for current requirements)
    • Evaluates different types of incompressible EOS: polynomial, exponential-polynomial and exponential for pure and mixed fluids
    • Evaluation functions for different major thermodynamic properties: Density, conductivity, specific heat, viscosity, saturation pressure
  2. Performed test cases for
    • Zitrec S55, Potassium formate/Sodium propionate (to test polynomial and exp-polynomial functions)
    • Water (exponential viscosity model) and
    • LiBr (mixture)
    • Demonstrated exact results to those generated by CoolProp (compare Original_*.pdf to Results_*.pdf in the repository) [* = ZS55, Water, LiBr]
Verification and validation of incompressible EOS models for pure fluid (Water) and mixture (Lithium Bromide)
Original from CoolProp Test results Test results Test results
'Density' (polynomial fit), 'Heat Capacity' (polynomial fit), 'Thermal Conductivity' (polynomial fit), 'Dynamic Viscosity' (exponential fit) and 'Saturation Pressure' (exponential fit) profiles of Water (pure fluid)
Polynomial fit of 'Density' profile for Water (pure fluid) mixture generated by the standalone code
Polynomial fit of 'Thermal Conductivity' profile for Water (pure fluid) mixture generated by the standalone code
Exponential fit of 'Dynamic Viscosity' profile for Water (pure fluid) mixture generated by the standalone code
'Density' (polynomial fit), 'Heat Capacity' (polynomial fit) and 'Saturation Pressure' (exponential-polynomial fit) profiles of LiBr mixture at x = 0.39
Polynomial fit of 'Density' profile for LiBr mixture generated by the standalone code at x = 0.39
Polynomial fit of 'Heat Capacity' profile for LiBr mixture generated by the standalone code at x = 0.39
Exponential-polynomial fit of 'Saturation Pressure' profile for LiBr mixture generated by the standalone code at x = 0.39

Conclusion: Pure and mixed fluids incompressible EOS ready to be linked with FPROPS

Work under progress:

  1. Add integration functions to evaluate internal energy/enthalpy/entropy
  2. Start final integration of the current code with FPROPS

Further Discussions:

  1. Do you know of any published data/equations/results to compare the integrated properties (internal energy/enthalpy/entropy)?

03 July 2016

Updates:

  1. Integration functions added: link
    • It is assumed that specific heats are polynomial functions of input temperature
    • Integration functions for internal energy and entropy calculations for incompressible pure fluid and mixtures are then added according to the equations given in the proposal
    • All incompressible fluids have an arbitrary reference state for internal energy and entropy: During initialization, the reference state is defined as a temperature of 20 C and a pressure of 1 atm according to the U.S. National Institute of Standards and Technology.

Further discussions:

  1. We don't know if we need a centered fit for this computation too (as in the evaluation functions before)
    • No data available for validation purposes
  2. How do we deal with enthalpy computation?
    • This depends on input temperature as well as pressure

Work under progress:

  1. Adding incompressible fluid data structures to filedata.h and rundata.h

10 July 2016

17 July 2016

24 July 2016

31 July 2016

07 August 2016

14 August 2016

21 August 2016