/// Set dew state void CoolPropSolver::setDewState(ExternalSaturationProperties *const properties, int phase, ExternalThermodynamicState *const dewProperties){ double hv; if (phase == 0) hv = properties->hv; else if (phase == 1) // gaseous phase hv = properties->hv+_delta_h; else // two-phase mixture hv = properties->hv-_delta_h; setState_ph(properties->psat, hv, phase, dewProperties); }
/// Set bubble state void CoolPropSolver::setBubbleState(ExternalSaturationProperties *const properties, int phase, ExternalThermodynamicState *const bubbleProperties){ double hl; if (phase == 0) hl = properties->hl; else if (phase == 1) // liquid phase hl = properties->hl-_delta_h; else // two-phase mixture hl = properties->hl+_delta_h; setState_ph(properties->psat, hl, phase, bubbleProperties); }
/*! This function sets the dew state record dewProperties corresponding to the saturation data contained in the properties record. The default implementation of the setDewState function is relying on the correct behaviour of setState_ph with respect to the state input. Can be overridden in the specific solver code to get more efficient or correct handling of this situation. @param properties ExternalSaturationProperties record with saturation properties data @param phase Phase (1: one-phase, 2: two-phase) @param dewProperties ExternalThermodynamicState record where to write the dew point properties */ void FluidPropSolver::setDewState(ExternalSaturationProperties *const properties, int phase, ExternalThermodynamicState *const dewProperties){ // Set the dew state property record based on the saturation properties record double hv; if (phase == 0) hv = properties->hv; else if (phase == 1) // liquid phase hv = properties->hv+delta_h; else // two-phase mixture hv = properties->hv-delta_h; setState_ph(properties->psat, hv, phase, dewProperties); }
/*! This function sets the bubble state record bubbleProperties corresponding to the saturation data contained in the properties record. Due to current lack of direct control over the phase in FluidProp, a small delta is added to the dewpoint enthalpy to make sure the correct phase is selected. @param properties ExternalSaturationProperties record with saturation properties data @param phase Phase (1: one-phase, 2: two-phase) @param bubbleProperties ExternalThermodynamicState record where to write the bubble point properties */ void FluidPropSolver::setBubbleState(ExternalSaturationProperties *const properties, int phase, ExternalThermodynamicState *const bubbleProperties){ // Set the bubble state property record based on the saturation properties record double hl; if (phase == 0) hl = properties->hl; else if (phase == 1) // liquid phase hl = properties->hl-delta_h; else // two-phase mixture hl = properties->hl+delta_h; setState_ph(properties->psat, hl, phase, bubbleProperties); }