Skip to content

Commit

Permalink
Updated formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
portyanikhin committed Oct 11, 2023
1 parent 6248a4d commit f22ef4f
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 145 deletions.
34 changes: 9 additions & 25 deletions src/SharpProp/Extensions/FluidsListExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,52 +5,40 @@ public static class FluidsListExtensions
/// <summary>
/// CoolProp internal name.
/// </summary>
/// <param name="member">
/// The <see cref="FluidsList"/> member.
/// </param>
/// <param name="member">The <see cref="FluidsList"/> member.</param>
/// <returns>CoolProp internal name.</returns>
public static string CoolPropName(this FluidsList member) =>
member.GetAttributes()!.Get<FluidInfoAttribute>()!.Name;

/// <summary>
/// CoolProp backend type.
/// </summary>
/// <param name="member">
/// The <see cref="FluidsList"/> member.
/// </param>
/// <param name="member">The <see cref="FluidsList"/> member.</param>
/// <returns>CoolProp backend type.</returns>
public static string CoolPropBackend(this FluidsList member) =>
member.GetAttributes()!.Get<FluidInfoAttribute>()!.Backend;

/// <summary>
/// <c>true</c> if the fluid pure of pseudo-pure.
/// </summary>
/// <param name="member">
/// The <see cref="FluidsList"/> member.
/// </param>
/// <param name="member">The <see cref="FluidsList"/> member.</param>
/// <returns><c>true</c> if the fluid pure of pseudo-pure.</returns>
public static bool Pure(this FluidsList member) =>
member.GetAttributes()!.Get<FluidInfoAttribute>()!.Pure;

/// <summary>
/// Mixture type.
/// </summary>
/// <param name="member">
/// The <see cref="FluidsList"/> member.
/// </param>
/// <param name="member">The <see cref="FluidsList"/> member.</param>
/// <returns>Mixture type.</returns>
public static Mix MixType(this FluidsList member) =>
member.GetAttributes()!.Get<FluidInfoAttribute>()!.MixType;

/// <summary>
/// Minimum possible fraction.
/// </summary>
/// <param name="member">
/// The <see cref="FluidsList"/> member.
/// </param>
/// <returns>
/// Minimum possible fraction (by default, %).
/// </returns>
/// <param name="member">The <see cref="FluidsList"/> member.</param>
/// <returns>Minimum possible fraction (by default, %).</returns>
public static Ratio FractionMin(this FluidsList member) =>
Ratio
.FromDecimalFractions(
Expand All @@ -61,16 +49,12 @@ public static class FluidsListExtensions
/// <summary>
/// Maximum possible fraction.
/// </summary>
/// <param name="member">
/// The <see cref="FluidsList"/> member.
/// </param>
/// <returns>
/// Maximum possible fraction (by default, %).
/// </returns>
/// <param name="member">The <see cref="FluidsList"/> member.</param>
/// <returns>Maximum possible fraction (by default, %).</returns>
public static Ratio FractionMax(this FluidsList member) =>
Ratio
.FromDecimalFractions(
member.GetAttributes()!.Get<FluidInfoAttribute>()!.FractionMax
)
.ToUnit(RatioUnit.Percent);
}
}
5 changes: 2 additions & 3 deletions src/SharpProp/Fluids/Fluid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ public class Fluid : AbstractFluid, IFluid
/// </param>
/// <exception cref="ArgumentException">
/// Invalid fraction value! It should be in
/// [{fractionMin};{fractionMax}] %.
/// Entered value = {fraction} %.
/// [{fractionMin};{fractionMax}] %. Entered value = {fraction} %.
/// </exception>
/// <exception cref="ArgumentException">
/// Need to define the fraction!
Expand Down Expand Up @@ -171,4 +170,4 @@ private void SetFraction()
else
Backend.SetVolumeFractions(fractionsVector);
}
}
}
62 changes: 16 additions & 46 deletions src/SharpProp/Fluids/IFluid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ public interface IFluid
/// </summary>
/// <param name="firstInput">First input property.</param>
/// <param name="secondInput">Second input property.</param>
/// <returns>
/// A new fluid instance with a defined state.
/// </returns>
/// <returns>A new fluid instance with a defined state.</returns>
/// <exception cref="ArgumentException">
/// Need to define 2 unique inputs!
/// </exception>
Expand Down Expand Up @@ -56,9 +54,7 @@ IKeyedInput<Parameters> secondInput
/// <param name="isentropicEfficiency">
/// Compressor isentropic efficiency.
/// </param>
/// <returns>
/// The state of the fluid at the end of the process.
/// </returns>
/// <returns>The state of the fluid at the end of the process.</returns>
/// <exception cref="ArgumentException">
/// Compressor outlet pressure should be higher than inlet pressure!
/// </exception>
Expand All @@ -71,9 +67,7 @@ IKeyedInput<Parameters> secondInput
/// The process of isenthalpic expansion to a given pressure.
/// </summary>
/// <param name="pressure">Pressure.</param>
/// <returns>
/// The state of the fluid at the end of the process.
/// </returns>
/// <returns>The state of the fluid at the end of the process.</returns>
/// <exception cref="ArgumentException">
/// Expansion valve outlet pressure should be lower than inlet pressure!
/// </exception>
Expand All @@ -83,9 +77,7 @@ IKeyedInput<Parameters> secondInput
/// The process of isentropic expansion to a given pressure.
/// </summary>
/// <param name="pressure">Pressure.</param>
/// <returns>
/// The state of the fluid at the end of the process.
/// </returns>
/// <returns>The state of the fluid at the end of the process.</returns>
/// <exception cref="ArgumentException">
/// Expander outlet pressure should be lower than inlet pressure!
/// </exception>
Expand All @@ -98,9 +90,7 @@ IKeyedInput<Parameters> secondInput
/// <param name="isentropicEfficiency">
/// Expander isentropic efficiency.
/// </param>
/// <returns>
/// The state of the fluid at the end of the process.
/// </returns>
/// <returns>The state of the fluid at the end of the process.</returns>
/// <exception cref="ArgumentException">
/// Expander outlet pressure should be lower than inlet pressure!
/// </exception>
Expand All @@ -116,9 +106,7 @@ IKeyedInput<Parameters> secondInput
/// <param name="pressureDrop">
/// Pressure drop in the heat exchanger (optional).
/// </param>
/// <returns>
/// The state of the fluid at the end of the process.
/// </returns>
/// <returns>The state of the fluid at the end of the process.</returns>
/// <exception cref="ArgumentException">
/// During the cooling process, the temperature should decrease!
/// </exception>
Expand All @@ -137,9 +125,7 @@ IKeyedInput<Parameters> secondInput
/// <param name="pressureDrop">
/// Pressure drop in the heat exchanger (optional).
/// </param>
/// <returns>
/// The state of the fluid at the end of the process.
/// </returns>
/// <returns>The state of the fluid at the end of the process.</returns>
/// <exception cref="ArgumentException">
/// During the cooling process, the enthalpy should decrease!
/// </exception>
Expand All @@ -158,9 +144,7 @@ IKeyedInput<Parameters> secondInput
/// <param name="pressureDrop">
/// Pressure drop in the heat exchanger (optional).
/// </param>
/// <returns>
/// The state of the fluid at the end of the process.
/// </returns>
/// <returns>The state of the fluid at the end of the process.</returns>
/// <exception cref="ArgumentException">
/// During the heating process, the temperature should increase!
/// </exception>
Expand All @@ -179,9 +163,7 @@ IKeyedInput<Parameters> secondInput
/// <param name="pressureDrop">
/// Pressure drop in the heat exchanger (optional).
/// </param>
/// <returns>
/// The state of the fluid at the end of the process.
/// </returns>
/// <returns>The state of the fluid at the end of the process.</returns>
/// <exception cref="ArgumentException">
/// During the heating process, the enthalpy should increase!
/// </exception>
Expand All @@ -197,46 +179,36 @@ IKeyedInput<Parameters> secondInput
/// Returns a bubble point at a given pressure.
/// </summary>
/// <param name="pressure">Pressure.</param>
/// <returns>
/// A bubble point at a given pressure.
/// </returns>
/// <returns>A bubble point at a given pressure.</returns>
public IFluid BubblePointAt(Pressure pressure);

/// <summary>
/// Returns a bubble point at a given temperature.
/// </summary>
/// <param name="temperature">Temperature.</param>
/// <returns>
/// A bubble point at a given temperature.
/// </returns>
/// <returns>A bubble point at a given temperature.</returns>
public IFluid BubblePointAt(Temperature temperature);

/// <summary>
/// Returns a dew point at a given pressure.
/// </summary>
/// <param name="pressure">Pressure.</param>
/// <returns>
/// A dew point at a given pressure.
/// </returns>
/// <returns>A dew point at a given pressure.</returns>
public IFluid DewPointAt(Pressure pressure);

/// <summary>
/// Returns a dew point at a given temperature.
/// </summary>
/// <param name="temperature">Temperature.</param>
/// <returns>
/// A dew point at a given temperature.
/// </returns>
/// <returns>A dew point at a given temperature.</returns>
public IFluid DewPointAt(Temperature temperature);

/// <summary>
/// Returns a two-phase point at a given pressure.
/// </summary>
/// <param name="pressure">Pressure.</param>
/// <param name="quality">Vapor quality.</param>
/// <returns>
/// Two-phase point at a given pressure.
/// </returns>
/// <returns>Two-phase point at a given pressure.</returns>
public IFluid TwoPhasePointAt(Pressure pressure, Ratio quality);

/// <summary>
Expand All @@ -250,9 +222,7 @@ IKeyedInput<Parameters> secondInput
/// Specific mass flow rate of the fluid at the second state.
/// </param>
/// <param name="second">Fluid at the second state.</param>
/// <returns>
/// The state of the fluid at the end of the process.
/// </returns>
/// <returns>The state of the fluid at the end of the process.</returns>
/// <exception cref="ArgumentException">
/// The mixing process is possible only for the same fluids!
/// </exception>
Expand All @@ -265,4 +235,4 @@ IKeyedInput<Parameters> secondInput
Ratio secondSpecificMassFlow,
IFluid second
);
}
}
14 changes: 4 additions & 10 deletions src/SharpProp/Fluids/IMixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ public interface IMixture
/// </summary>
/// <param name="firstInput">First input property.</param>
/// <param name="secondInput">Second input property.</param>
/// <returns>
/// A new mixture instance with a defined state.
/// </returns>
/// <returns>A new mixture instance with a defined state.</returns>
/// <exception cref="ArgumentException">
/// Need to define 2 unique inputs!
/// </exception>
Expand All @@ -43,9 +41,7 @@ IKeyedInput<Parameters> secondInput
/// <param name="pressureDrop">
/// Pressure drop in the heat exchanger (optional).
/// </param>
/// <returns>
/// The state of the mixture at the end of the process.
/// </returns>
/// <returns>The state of the mixture at the end of the process.</returns>
/// <exception cref="ArgumentException">
/// During the cooling process, the temperature should decrease!
/// </exception>
Expand All @@ -64,9 +60,7 @@ IKeyedInput<Parameters> secondInput
/// <param name="pressureDrop">
/// Pressure drop in the heat exchanger (optional).
/// </param>
/// <returns>
/// The state of the mixture at the end of the process.
/// </returns>
/// <returns>The state of the mixture at the end of the process.</returns>
/// <exception cref="ArgumentException">
/// During the heating process, the temperature should increase!
/// </exception>
Expand All @@ -77,4 +71,4 @@ IKeyedInput<Parameters> secondInput
Temperature temperature,
Pressure? pressureDrop = null
);
}
}
10 changes: 3 additions & 7 deletions src/SharpProp/Fluids/Mixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,8 @@ public class Mixture : AbstractFluid, IMixture
/// <summary>
/// Mass-based mixture of pure fluids.
/// </summary>
/// <param name="fluids">
/// List of selected names of pure fluids.
/// </param>
/// <param name="fractions">
/// List of mass-based fractions.
/// </param>
/// <param name="fluids">List of selected names of pure fluids.</param>
/// <param name="fractions">List of mass-based fractions.</param>
/// <exception cref="ArgumentException">
/// Invalid input! Fluids and Fractions should be of the same length.
/// </exception>
Expand Down Expand Up @@ -119,4 +115,4 @@ public bool Equals(IMixture? other)

protected override AbstractFluid CreateInstance() =>
new Mixture(Fluids, Fractions);
}
}

0 comments on commit f22ef4f

Please sign in to comment.