Commit c3a43d6b authored by Henderson, Shane's avatar Henderson, Shane
Browse files

Merge branch 'gui_dev' into 'master'

Gui dev

See merge request neams/saline!15
parents 428e677a 1fb13a81
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -74,6 +74,7 @@ class Data_Store
        double cp_h(double enthalpy, double pressure = 101.325) const;
        bool valid_cp() const;
        double cp_unc() const;
        std::pair<double,double> cp_rng() const;
        std::string cp_ref() const;

        // viscosity
@@ -81,6 +82,7 @@ class Data_Store
        double mu_h(double enthalpy, double pressure = 101.325) const;
        bool valid_mu() const;
        double mu_unc() const;
        std::pair<double,double> mu_rng() const;
        std::string mu_ref() const;

        // conductivity
@@ -88,6 +90,7 @@ class Data_Store
        double k_h(double enthalpy, double pressure = 101.325) const;
        bool valid_k() const;
        double k_unc() const;
        std::pair<double,double> k_rng() const;
        std::string k_ref() const;

        // density
@@ -95,6 +98,7 @@ class Data_Store
        double rho_h(double enthalpy, double pressure = 101.325) const;
        bool valid_rho() const;
        double rho_unc() const;
        std::pair<double,double> rho_rng() const;
        std::string rho_ref() const;

        // enthalpy given temperature
@@ -130,11 +134,16 @@ class Data_Store
    // the constituents names in a given compound
    virtual Vec_Name names(Id) const = 0;

    // The list accessible salt names
    virtual Vec_Name getSaltKeys() const = 0;
    virtual std::vector<std::vector<double>> getSaltComps(Vec_Name names) const = 0;

    // specific heat
    virtual double cp(Id id, Id data_id, double temperature, double pressure = 101.325) const = 0;
    virtual double cp_h(Id id, Id data_id, double enthalpy, double pressure = 101.325) const = 0;
    virtual bool valid_cp(Id id, Id data_id) const = 0;
    virtual double cp_unc(Id id, Id data_id) const = 0;
    virtual std::pair<double,double> cp_rng(Id id, Id data_id) const = 0;
    virtual std::string cp_ref(Id id, Id data_id) const = 0;

    // viscosity
@@ -142,6 +151,7 @@ class Data_Store
    virtual double mu_h(Id id, Id data_id, double enthalpy, double pressure = 101.325) const = 0;
    virtual bool valid_mu(Id id, Id data_id) const = 0;
    virtual double mu_unc(Id id, Id data_id) const = 0;
    virtual std::pair<double,double> mu_rng(Id id, Id data_id) const = 0;
    virtual std::string mu_ref(Id id, Id data_id) const = 0;

    // conductivity
@@ -149,6 +159,7 @@ class Data_Store
    virtual double k_h(Id id, Id data_id, double enthalpy, double pressure = 101.325) const = 0;
    virtual bool valid_k(Id id, Id data_id) const = 0;
    virtual double k_unc(Id id, Id data_id) const = 0;
    virtual std::pair<double,double> k_rng(Id id, Id data_id) const = 0;
    virtual std::string k_ref(Id id, Id data_id) const = 0;

    // density
@@ -156,6 +167,7 @@ class Data_Store
    virtual double rho_h(Id id, Id data_id, double enthalpy, double pressure = 101.325) const = 0;
    virtual bool valid_rho(Id id, Id data_id) const = 0;
    virtual double rho_unc(Id id, Id data_id) const = 0;
    virtual std::pair<double,double> rho_rng(Id id, Id data_id) const = 0;
    virtual std::string rho_ref(Id id, Id data_id) const = 0;

    // enthalpy
+8 −1
Original line number Diff line number Diff line
@@ -82,6 +82,7 @@ class Default_Data_Store : public Data_Store
    double cp_h(Id id, Id data_id, double enthalpy, double pressure = 101.325) const;
    bool valid_cp(Id id, Id data_id) const;
    double cp_unc(Id id, Id data_id) const;
    std::pair<double,double> cp_rng(Id id, Id data_id) const;
    std::string cp_ref(Id id, Id data_id) const;

    // viscosity
@@ -89,6 +90,7 @@ class Default_Data_Store : public Data_Store
    double mu_h(Id id, Id data_id, double enthalpy, double pressure = 101.325) const;
    bool valid_mu(Id id, Id data_id) const;
    double mu_unc(Id id, Id data_id) const;
    std::pair<double,double> mu_rng(Id id, Id data_id) const;
    std::string mu_ref(Id id, Id data_id) const;

    // conductivity
@@ -96,6 +98,7 @@ class Default_Data_Store : public Data_Store
    double k_h(Id id, Id data_id, double enthalpy, double pressure = 101.325) const;
    bool valid_k(Id id, Id data_id) const;
    double k_unc(Id id, Id data_id) const;
    std::pair<double,double> k_rng(Id id, Id data_id) const;
    std::string k_ref(Id id, Id data_id) const;

    // density
@@ -103,6 +106,7 @@ class Default_Data_Store : public Data_Store
    double rho_h(Id id, Id data_id, double enthalpy, double pressure = 101.325) const;
    bool valid_rho(Id id, Id data_id) const;
    double rho_unc(Id id, Id data_id) const;
    std::pair<double,double> rho_rng(Id id, Id data_id) const;
    std::string rho_ref(Id id, Id data_id) const;

    // enthalpy
@@ -148,8 +152,11 @@ class Default_Data_Store : public Data_Store
    //Obtain the nearest neighboring composition
    Id nearest(Id id, const Vec_Mole& mole_percent) const;

  private:
    // The list accessible salt names
    Vec_Name getSaltKeys() const;
    std::vector<std::vector<double>> getSaltComps(Vec_Name names) const;

  private:

    class Data
    {
+8 −0
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@ class R_Kister_Data_Store : public Data_Store
    double cp(Id id, Id data_id, double temperature, double pressure = 101.325) const;
    double cp_h(Id id, Id data_id, double enthalpy, double pressure = 101.325) const;
    double cp_unc(Id id, Id data_id) const {return .2;}
    std::pair<double,double> cp_rng(Id id, Id data_id) const;
    std::string cp_ref(Id id, Id data_id) const {return "----";}
    bool valid_cp(Id id, Id data_id) const;

@@ -60,12 +61,14 @@ class R_Kister_Data_Store : public Data_Store
    double mu_h(Id id, Id data_id, double enthalpy, double pressure = 101.325) const;
    bool valid_mu(Id id, Id data_id) const;
    double mu_unc(Id id, Id data_id) const{return .2;}
    std::pair<double,double> mu_rng(Id id, Id data_id) const;
    std::string mu_ref(Id id, Id data_id) const {return "----";}

    // conductivity
    double k(Id id, Id data_id, double temperature, double pressure = 101.325) const;
    double k_h(Id id, Id data_id, double enthalpy, double pressure = 101.325) const;
    bool valid_k(Id id, Id data_id) const;
    std::pair<double,double> k_rng(Id id, Id data_id) const;
    double k_unc(Id id, Id data_id) const{return .2;}
    std::string k_ref(Id id, Id data_id) const {return "----";}

@@ -74,6 +77,7 @@ class R_Kister_Data_Store : public Data_Store
    double rho_h(Id id, Id data_id, double enthalpy, double pressure = 101.325) const;
    bool valid_rho(Id id, Id data_id) const;
    double rho_unc(Id id, Id data_id) const{return .2;}
    std::pair<double,double> rho_rng(Id id, Id data_id) const;
    std::string rho_ref(Id id, Id data_id) const {return "----";}

    // enthalpy
@@ -111,6 +115,10 @@ class R_Kister_Data_Store : public Data_Store
    bool valid(Vec_Name& names) const;
    bool valid(Name& name) const;

    // The list accessible salt names
    Vec_Name getSaltKeys() const;
    std::vector<std::vector<double>> getSaltComps(Vec_Name names) const;

    private:
        // Data_Store providing the base information
        Default_Data_Store d;
+14 −2
Original line number Diff line number Diff line
@@ -56,16 +56,22 @@ class Thermophysical_Properties
    double cp_h(double enthalpy, double pressure = 101.325) const;
    double cp_kg(double temperature, double pressure = 101.325) const;
    double cp_h_kg(double enthalpy, double pressure = 101.325) const;
    double cp_unc() const {return m_impl.cp_unc();}
    std::pair<double,double> cp_rng() const {return m_impl.cp_rng();}
    bool valid_cp() const;

    // viscosity
    double mu(double temperature, double pressure = 101.325) const;
    double mu_h(double enthalpy, double pressure = 101.325) const;
    double mu_unc() const {return m_impl.mu_unc();}
    std::pair<double,double> mu_rng() const{return m_impl.mu_rng();}
    bool valid_mu() const;

    // conductivity
    double k(double temperature, double pressure = 101.325) const;
    double k_h(double enthalpy, double pressure = 101.325) const;
    double k_unc() const {return m_impl.k_unc();}
    std::pair<double,double> k_rng() const{return m_impl.k_rng();}
    bool valid_k() const;

    // density
@@ -73,6 +79,8 @@ class Thermophysical_Properties
    double rho_h(double enthalpy, double pressure = 101.325) const;
    double rho_kgm3(double temperature, double pressure = 101.325) const;
    double rho_h_kgm3(double enthalpy, double pressure = 101.325) const;
    double rho_unc() const {return m_impl.rho_unc();}
    std::pair<double,double> rho_rng() const{return m_impl.rho_rng();}
    bool valid_rho() const;

    // enthalpy
@@ -86,6 +94,10 @@ class Thermophysical_Properties
    double t_melt() const;
    double t_boil() const;

    // The list accessible salt names
    Vec_Name getSaltKeys() const;
    std::vector<std::vector<double>> getSaltComps(std::string names) const;

    // list of species for which properties are being tracked
    const Vec_Name& species() const {return m_comp_names;}

@@ -105,7 +117,7 @@ class Thermophysical_Properties
                        int mole_percent_count);

    // interface for checking if salt is valid
    bool isSaltValid(const Vec_Name& names);
    bool isSaltValid(const Vec_Name& names) const;
    bool isSaltValid(const std::string& names, int name_count);

    // initialize the properties data
@@ -114,7 +126,7 @@ class Thermophysical_Properties
  private:

    // the most recent species used by the client (names in order of request)
    std::vector<std::string> m_comp_names;
    Vec_Name m_comp_names;

    // the data store backing this instance of material properties
    Data_Store* m_data;
+32 −0
Original line number Diff line number Diff line
@@ -89,6 +89,14 @@ double Data_Store::View::cp_unc() const
    return d->cp_unc(id,rec_id);
}
//----------------------------------------------------------------------------//
/*!
 * \brief retrieves the density experimental range for the view object
 */
std::pair<double,double> Data_Store::View::cp_rng() const
{
    return d->cp_rng(id,rec_id);
}
//----------------------------------------------------------------------------//
/*!
 * \brief retrieves the heat capacity reference for the view object
 */
@@ -125,6 +133,14 @@ bool Data_Store::View::valid_mu() const
  return d->valid_mu(id, rec_id);
}
//----------------------------------------------------------------------------//
/*!
 * \brief retrieves the density experimental range for the view object
 */
std::pair<double,double> Data_Store::View::mu_rng() const
{
    return d->mu_rng(id,rec_id);
}
//----------------------------------------------------------------------------//
/*!
 * \brief retrieves the viscosity uncertainty for the view object
 */
@@ -177,6 +193,14 @@ double Data_Store::View::k_unc() const
    return d->k_unc(id,rec_id);
}
//----------------------------------------------------------------------------//
/*!
 * \brief retrieves the density experimental range for the view object
 */
std::pair<double,double> Data_Store::View::k_rng() const
{
    return d->k_rng(id,rec_id);
}
//----------------------------------------------------------------------------//
/*!
 * \brief retrieves the thermal conductivity reference for the view object
 */
@@ -213,6 +237,14 @@ bool Data_Store::View::valid_rho() const
  return d->valid_rho(id, rec_id);
}
//----------------------------------------------------------------------------//
/*!
 * \brief retrieves the density experimental range for the view object
 */
std::pair<double,double> Data_Store::View::rho_rng() const
{
    return d->rho_rng(id,rec_id);
}
//----------------------------------------------------------------------------//
/*!
 * \brief retrieves the density uncertainty for the view object
 */
Loading