aboutsummaryrefslogtreecommitdiff
path: root/headers/genericElement.h
diff options
context:
space:
mode:
authorLibravatar SR Tamim <saifur.rahman.tamim1@gmail.com>2024-03-07 10:05:41 +0600
committerLibravatar SR Tamim <saifur.rahman.tamim1@gmail.com>2024-03-07 10:05:41 +0600
commit48110b812253975b6e2437fef07b84dd7382db9e (patch)
tree1ea043569604280ca8f10bb5811871a8f3c9dbbb /headers/genericElement.h
parentd9f58439b81b2505456c05dc2e64864b1cbcfde2 (diff)
downloadentropy-calc-48110b812253975b6e2437fef07b84dd7382db9e.tar.gz
entropy-calc-48110b812253975b6e2437fef07b84dd7382db9e.zip
total heat needed & entropy change
Diffstat (limited to 'headers/genericElement.h')
-rw-r--r--headers/genericElement.h79
1 files changed, 0 insertions, 79 deletions
diff --git a/headers/genericElement.h b/headers/genericElement.h
deleted file mode 100644
index 5e7044d..0000000
--- a/headers/genericElement.h
+++ /dev/null
@@ -1,79 +0,0 @@
-#ifndef GENERICELEMENT_H_INCLUDED
-#define GENERICELEMENT_H_INCLUDED
-
-
-#include <iostream>
-using namespace std;
-
-class genericElement
-{
-private:
- string elementName;
- double latentHeatOfFusion;
- double latentHeatOfVaporization;
- double specificHeatSolid;
- double specificHeatLiquid;
- double specificHeatGas;
- double meltingPoint;
- double boilingPoint;
-
-protected:
- void setElementName(string value) { elementName = value; }
- void setLatentHeatOfFusion(double value) { latentHeatOfFusion = value; }
- void setLatentHeatOfVaporization(double value) { latentHeatOfVaporization = value; }
- void setSpecificHeatSolid(double value) { specificHeatSolid = value; }
- void setSpecificHeatLiquid(double value) { specificHeatLiquid = value; }
- void setSpecificHeatGas(double value) { specificHeatGas = value; }
- void setMeltingPoint(double value) { meltingPoint = value; }
- void setBoilingPoint(double value) { boilingPoint = value; }
-
-public:
- string getElementName() { return elementName; }
- double getLatentHeatOfFusion() { return latentHeatOfFusion; }
- double getLatentHeatOfVaporization() { return latentHeatOfVaporization; }
- double getSpecificHeatSolid() { return specificHeatSolid; }
- double getSpecificHeatLiquid() { return specificHeatLiquid; }
- double getSpecificHeatGas() { return specificHeatGas; }
- double getMeltingPoint() { return meltingPoint; }
- double getBoilingPoint() { return boilingPoint; }
-
- double totalEntropyChange(double mass, double fromTemp, double toTemp)
- {
- double totalEntropy = 0;
- if (fromTemp <= meltingPoint && toTemp <= meltingPoint)
- {
- totalEntropy = mass * specificHeatSolid * (toTemp - fromTemp);
- }
- else if (fromTemp <= meltingPoint && toTemp >= meltingPoint && toTemp <= boilingPoint)
- {
- totalEntropy = mass * specificHeatSolid * (meltingPoint - fromTemp);
- totalEntropy += mass * latentHeatOfFusion / meltingPoint;
- totalEntropy += mass * specificHeatLiquid * (toTemp - meltingPoint);
- }
- else if (fromTemp <= meltingPoint && toTemp >= boilingPoint)
- {
- totalEntropy = mass * specificHeatSolid * (meltingPoint - fromTemp);
- totalEntropy += mass * latentHeatOfFusion;
- totalEntropy += mass * specificHeatLiquid * (boilingPoint - meltingPoint);
- totalEntropy += mass * latentHeatOfVaporization;
- totalEntropy += mass * specificHeatGas * (toTemp - boilingPoint);
- }
- else if (fromTemp >= meltingPoint && fromTemp <= boilingPoint && toTemp >= meltingPoint && toTemp <= boilingPoint)
- {
- totalEntropy = mass * specificHeatLiquid * (toTemp - fromTemp);
- }
- else if (fromTemp >= meltingPoint && fromTemp <= boilingPoint && toTemp >= boilingPoint)
- {
- totalEntropy = mass * specificHeatLiquid * (boilingPoint - fromTemp);
- totalEntropy += mass * latentHeatOfVaporization;
- totalEntropy += mass * specificHeatGas * (toTemp - boilingPoint);
- }
- else if (fromTemp >= boilingPoint && toTemp >= boilingPoint)
- {
- totalEntropy = mass * specificHeatGas * (toTemp - fromTemp);
- }
- return totalEntropy;
- }
-};
-
-#endif // GENERICELEMENT_H_INCLUDED