/** module file for all rock CORBA objects. Rock is a c++ wrapper for MELTS/pMELTS code. $Id: rock.idl,v 1.25 2007/09/19 21:26:45 kress Exp $ @author Mark Ghiorso $Revision: 1.25 $ */ #include #include "common.idl" module rock { ////////////////////////////////////////////////////////////////////////// /// structure to hold status of rock instance and (optionally) client data struct RockStatus { /// time dRock object created long long timeCreated; /// last access time for dRock object long long timeLastAccessed; /// current status of dRock object string status; /// stringified IOR string ior; /// process id converted to long long pid; /// unique identifier for rock instance long identifier; /// client data structure common::ClientData client; }; //////////////////////////////////////////////////////////////////////// /// dRock interface dRock { /** valid oxygen fugacity constraints. fo2_none: no oxygen fugacity constraint mode fo2_hm: hematite-magnetite oxygen fugacity constraint mode fo2_nno: Ni-NiO oxygen fugacity constraint mode fo2_qfm: QFM oxygen fugacity constraint mode fo2_iw: iron-wustite oxygen fugacity constraint mode */ enum fO2Type {fo2_none,fo2_hm,fo2_nno,fo2_qfm,fo2_iw}; /** status returned by findRockLiquidus method. frl_success: successful termination of find rock liquidus method frl_max_t: maximum temperature exceeded in find rock liquidus method frl_min_t: minimum temperature reached in find rock liquidus method frl_time: time limit exceeded in find rock liquidus method */ enum findRockLiquidusStatus {frl_success,frl_max_t,frl_min_t,frl_time}; /** status returned by equilibrate method. equil_success: successful termination of equilibrate method equil_quad_max: quadratic iterations exceeded in equilibrate method equil_lin_zero: linear search truncation in equilibrate method equil_lin_max: linear search iterations exceeded in equilibrate method equil_sat_max: phase saturation loop exceeded in equilibrate method equil_add_drop_max: add/drop phase loop exceeded in equilibrate method equil_add_liquid_1: add solid: liquid exhausted (1) in equilibrate method equil_add_liquid_2: add solid: liquid exhausted (2) in equilibrate method equil_add_liquid_3: add liquid: solid exhausted in equilibrate method equil_rank: phase rule violation detected (rank) in equilibrate method equil_solidus: solidus detected in equilibrate method equil_phase_rule: phase rule violation detected (add0 in equilibrate method equil_time: time limit exceeded in equilibrate method */ enum equilibrateStatus {equil_success,equil_quad_max,equil_lin_zero, equil_lin_max,equil_sat_max,equil_add_drop_max,equil_add_liquid_1, equil_add_liquid_2,equil_add_liquid_3,equil_rank,equil_solidus, equil_phase_rule,equil_time}; /// set T in Kelvins void setTk(in double ltk); /// set P in Pascals void setPa(in double lpa); /// set logfo2 mode and delNNO (default none) void setlogfo2(in fO2Type mode,in double delta); /// supress phase number iphase. All suppressed by default. void supressPhase(in short iphase); /// enable phase number iphase. All supressed by default. void enablePhase(in short iphase); /// put rock in isenthalpic mode (default 0); void setIsenthalpic(in boolean i); /// put rock in isentropic mode (default 0); void setIsentropic(in boolean i); /// put rock in isochoric mode (default 0); void setIsochoric(in boolean i); /// set bulk composition in mole fraction. Values copied to internal array. void setBulkCompM(in CORBA::DoubleSeq bc); /// set bulk composition in weight%. Values copied to internal array. void setBulkCompW(in CORBA::DoubleSeq bc); /// fractionate solids from the system (scale = fraction removed) void fractionateSolids(in double scale); /// set system volume in J/Pa void setVolume(in double v); /// set system enthalpy in J void setEnthalpy(in double h); /// set system entropy in J/K void setEntropy(in double s); /// returns T in Kelvins double getTk(); /// returns P in Pascals double getPa(); /// returns number of rock components short getNcomp(); /// returns number of liquid components short getNLiqComp(); /// returns number of solid phases short getNSolPhases(); /// returns the name of a solid phase string getSolPhaseName(in short i); /// returns the formula of a solid phase /// @param i phase index /// @param j instance index of phase string getSolPhaseFormula(in short i, in short j); /// returns number of components for phase i short getNSolComp(in short i); /// Returns the name of a component in a solid phase /// @param i phase index /// @param j component index /// @returns the name of a component in a solid phase string getSolPhaseCompName(in short i, in short j); /// Returns the formula of a component in a solid phase /// @param i phase index /// @param j component index /// @returns the name of a component in a solid phase string getSolPhaseCompFormula(in short i, in short j); /// returns pointer to name of bulk component (oxide) string getCompName(in short i); /// returns pointer to name of liquid component string getLiqCompName(in short i); /// returns liquid composition CORBA::DoubleSeq getLiqComp(); /// returns liquid composition in wt% oxides CORBA::DoubleSeq getLiqCompWt(); /// returns liquid mu CORBA::DoubleSeq getLiqMu(); /// returns liquid activities CORBA::DoubleSeq getLiqActivity(); /// Returns number of saturated solid phases short getNSatSolid(); /// Returns list of indices for currently saturated solids CORBA::ShortSeq getSatSolidList(); /// Returns solid composition in mol frac of phase components. /// @param iphase phase number /// @param instance phase instance index /// @param sx double array to hold returned component moles. /// @returns number of phase saturated or 0 if supressed or undersaturated. short getSolComp(in short iphase,in short instance,out CORBA::DoubleSeq sx); /// Returns solid composition in wt% oxides. /// @param iphase phase number /// @param instance phase instance index /// @param sx double array to hold returned wt% oxides. /// @returns number of phase saturated or 0 if supressed or undersaturated. short getSolCompWt(in short iphase,in short instance,out CORBA::DoubleSeq sx); /// Returns solid mu in Joules. /// @param iphase phase number /// @param instance phase instance index /// @param smu double array to hold returned component potentials in Joules. /// @returns number of phase saturated or 0 if supressed or undersaturated. short getSolMu(in short iphase,in short instance,out CORBA::DoubleSeq smu); /// Returns affinity and composition guess for solid phase. If initial guess fails, /// Ghiorso's method will be used to try again. /// @param iphase phase number /// @param x estimate for mole fraction of components. Zeroed /// components will not be considered. /// @returns affinity if undersaturated or zero if saturated double getAffinity(in short iphase, out CORBA::DoubleSeq x); /// Returns solid partial molar volumes in J/Pa. Returns 0 if not present. short getSolVbar(in short iphase,in short instance,out CORBA::DoubleSeq svbar); /// get current log10fo2 double getlogfo2(); /// get current log10fo2 relative to buffer specified in mode double getlogfo2relative(in fO2Type mode); /// get bulk composition in moles CORBA::DoubleSeq getBulkCompM(); /// get bulk composition in grams CORBA::DoubleSeq getBulkCompW(); /// get liquid mass in gm double getLiquidMass(); /// get solid mass in gm double getSolidMass(); /// get mass in gm of phase double getSolPhaseMass(in short iphase,in short instance); /// returns system volume in J/Pa double getVolume(); /// returns Gibbs free energy of solids in J double getSolidGibbsFreeEnergyTotal(); /// returns enthalpy of solids in J double getSolidEnthalpyTotal(); /// returns entropy of solids in J/K double getSolidEntropyTotal(); /// returns heat capacity of solids in J/K double getSolidHeatCapacityTotal(); /// returns volume of solids in J/Pa double getSolidVolumeTotal(); /// returns Gibbs free energy of solid iphase in J double getSolidGibbsFreeEnergy(in short iphase,in short instance); /// returns enthalpy of solid iphase in J double getSolidEnthalpy(in short iphase,in short instance); /// returns entropy of solid iphase in J/K double getSolidEntropy(in short iphase,in short instance); /// returns heat capacity of solid iphase in J/K double getSolidHeatCapacity(in short iphase,in short instance); /// returns volume of solid iphase in J/Pa double getSolidVolume(in short iphase,in short instance); /// returns dVdT of solid iphase in J/(Pa*K) double getSoliddVdT(in short iphase,in short instance); /// returns dVdP of solid iphase in J/(Pa^2) double getSoliddVdP(in short iphase,in short instance); /// returns moles of oxygen added/removed from system double getDeltaOxygen(); /// returns Oxygen Gibbs Free Energy in J/mol double getOxygenGibbsFreeEnergy(); /// returns Oxygen enthalpy in J/mol double getOxygenEnthalpy(); /// returns Oxygen entropy in J/K-mol double getOxygenEntropy(); /// returns Oxygen heat capacity in J/K-mol double getOxygenHeatCapacity(); /// returns Oxygen volume in J/Pa-mol double getOxygenVolume(); /// returns liquid Gibbs free energy in J double getLiquidGibbsFreeEnergy(); /// returns liquid enthalpy in J double getLiquidEnthalpy(); /// returns liquid entropy in J/K double getLiquidEntropy(); /// returns liquid heat capacity in J/K double getLiquidHeatCapacity(); /// returns liquid volume in J/Pa double getLiquidVolume(); /// returns liquid dVdT in J/(Pa*K) double getLiquiddVdT(); /// returns liquid dVdP in J/Pa^2 double getLiquiddVdP(); /// returns liquid viscosity in log10 (poise) double getLiquidViscosity(); // utility methods //////////////////////////////////////////////// /// get integer value of solid phase corresponding to label short getPhaseNo(in string lab); /// returns boolean indicating if phase iphase is single-component. boolean isSingleComponent(in short iphase); /// returns number of coexisting instances of phase iphase short getNumberCoexistPhase(in short iphase); /// find liquidus temperature for this bulk composition and sets state. returns findRockLiquidusStatus short findRockLiquidus(); /// execute equilibration on current state. returns equilibrateStatus short equilibrateRock(); // cleanup and monitor methods //////////////////////////////////// /// get time of last object access (seconds from local reference) long long getLastAccessTime(); /// returns 1 if there are still active references to object unsigned short isActive(); /// returns a string that idicates the status/state of the object string getStatus(); /// cleanup and deregister object void remove(); }; //////////////////////////////////////////////////////////////////////// /// Server factory for spawning dRock objects interface RockFactory { /// spawns and returns rock object dRock spawnRock(in common::ClientData cd); }; /////////////////////////////////////////////////////////////////////// /// Manager object for monitoring and managing dRock objects interface RockManager { typedef sequence StatSeq; /// returns current grace period in seconds short getGracePeriod(); /// sets grace period in seconds void setGracePeriod(in short sec); /// registers new rock with manager object void add(in dRock dpv,in long pid,in common::ClientData cd); /// returns number of active rock objects registered with the factory short getNrock(); /// returns sequence of RockStatus objects StatSeq getStatus(); /// returns current processor load in percent (nyi) /// @param p processor number. -1 returns average. double getLoad(in short p); /// returns free memory available in bytes (nyi) long getFreeMemory(); /// returns memory used in CORBA processes (nyi) long getAllocatedMemory(); /// examine all spawned phases and prune those that are obsolete void update(); /// induce dRock to self-destruct in orderly manner /// @param i unique server id of dRock to be killed. void remove(in long i); /// induce recalictrant or locked dRock to self-destruct /// @param i unique server id of dPhase to be killed. void apoptosize(in long i); }; };