From cc56153426904755ceb6d5531374fe91551974b5 Mon Sep 17 00:00:00 2001
From: Henry <Henry>
Date: Mon, 25 Mar 2013 15:12:08 +0000
Subject: [PATCH] thermophysicalModels/specie/transport: completed set of
 member operators in const and sutherland

---
 .../specie/transport/const/constTransport.H   | 11 +++--
 .../specie/transport/const/constTransportI.H  | 46 +++++++++++++++++++
 .../sutherland/sutherlandTransport.H          | 11 +++--
 .../sutherland/sutherlandTransportI.H         | 46 +++++++++++++++++++
 4 files changed, 106 insertions(+), 8 deletions(-)

diff --git a/src/thermophysicalModels/specie/transport/const/constTransport.H b/src/thermophysicalModels/specie/transport/const/constTransport.H
index c1e3120000c..ec6bb657373 100644
--- a/src/thermophysicalModels/specie/transport/const/constTransport.H
+++ b/src/thermophysicalModels/specie/transport/const/constTransport.H
@@ -161,10 +161,13 @@ public:
 
     // Member operators
 
-        inline constTransport& operator=
-        (
-            const constTransport&
-        );
+        inline constTransport& operator=(const constTransport&);
+
+        inline void operator+=(const constTransport&);
+
+        inline void operator-=(const constTransport&);
+
+        inline void operator*=(const scalar);
 
 
     // Friend operators
diff --git a/src/thermophysicalModels/specie/transport/const/constTransportI.H b/src/thermophysicalModels/specie/transport/const/constTransportI.H
index e58aa79efa9..1581de144ef 100644
--- a/src/thermophysicalModels/specie/transport/const/constTransportI.H
+++ b/src/thermophysicalModels/specie/transport/const/constTransportI.H
@@ -143,6 +143,52 @@ inline Foam::constTransport<Thermo>& Foam::constTransport<Thermo>::operator=
 }
 
 
+template<class Thermo>
+inline void Foam::constTransport<Thermo>::operator+=
+(
+    const constTransport<Thermo>& st
+)
+{
+    scalar molr1 = this->nMoles();
+
+    Thermo::operator+=(st);
+
+    molr1 /= this->nMoles();
+    scalar molr2 = st.nMoles()/this->nMoles();
+
+    mu_ = molr1*mu_ + molr2*st.mu_;
+    rPr_ = molr1*rPr_ + molr2*st.rPr_;
+}
+
+
+template<class Thermo>
+inline void Foam::constTransport<Thermo>::operator-=
+(
+    const constTransport<Thermo>& st
+)
+{
+    scalar molr1 = this->nMoles();
+
+    Thermo::operator-=(st);
+
+    molr1 /= this->nMoles();
+    scalar molr2 = st.nMoles()/this->nMoles();
+
+    mu_ = molr1*mu_ - molr2*st.mu_;
+    rPr_ = molr1*rPr_ - molr2*st.rPr_;
+}
+
+
+template<class Thermo>
+inline void Foam::constTransport<Thermo>::operator*=
+(
+    const scalar s
+)
+{
+    Thermo::operator*=(s);
+}
+
+
 // * * * * * * * * * * * * * * * Friend Operators  * * * * * * * * * * * * * //
 
 template<class Thermo>
diff --git a/src/thermophysicalModels/specie/transport/sutherland/sutherlandTransport.H b/src/thermophysicalModels/specie/transport/sutherland/sutherlandTransport.H
index f8ac0722dd6..55f5f27e5a2 100644
--- a/src/thermophysicalModels/specie/transport/sutherland/sutherlandTransport.H
+++ b/src/thermophysicalModels/specie/transport/sutherland/sutherlandTransport.H
@@ -180,10 +180,13 @@ public:
 
     // Member operators
 
-        inline sutherlandTransport& operator=
-        (
-            const sutherlandTransport&
-        );
+        inline sutherlandTransport& operator=(const sutherlandTransport&);
+
+        inline void operator+=(const sutherlandTransport&);
+
+        inline void operator-=(const sutherlandTransport&);
+
+        inline void operator*=(const scalar);
 
 
     // Friend operators
diff --git a/src/thermophysicalModels/specie/transport/sutherland/sutherlandTransportI.H b/src/thermophysicalModels/specie/transport/sutherland/sutherlandTransportI.H
index ac79418ed34..56fcaf6e8f0 100644
--- a/src/thermophysicalModels/specie/transport/sutherland/sutherlandTransportI.H
+++ b/src/thermophysicalModels/specie/transport/sutherland/sutherlandTransportI.H
@@ -180,6 +180,52 @@ Foam::sutherlandTransport<Thermo>::operator=
 }
 
 
+template<class Thermo>
+inline void Foam::sutherlandTransport<Thermo>::operator+=
+(
+    const sutherlandTransport<Thermo>& st
+)
+{
+    scalar molr1 = this->nMoles();
+
+    Thermo::operator+=(st);
+
+    molr1 /= this->nMoles();
+    scalar molr2 = st.nMoles()/this->nMoles();
+
+    As_ = molr1*As_ + molr2*st.As_;
+    Ts_ = molr1*Ts_ + molr2*st.Ts_;
+}
+
+
+template<class Thermo>
+inline void Foam::sutherlandTransport<Thermo>::operator-=
+(
+    const sutherlandTransport<Thermo>& st
+)
+{
+    scalar molr1 = this->nMoles();
+
+    Thermo::operator-=(st);
+
+    molr1 /= this->nMoles();
+    scalar molr2 = st.nMoles()/this->nMoles();
+
+    As_ = molr1*As_ - molr2*st.As_;
+    Ts_ = molr1*Ts_ - molr2*st.Ts_;
+}
+
+
+template<class Thermo>
+inline void Foam::sutherlandTransport<Thermo>::operator*=
+(
+    const scalar s
+)
+{
+    Thermo::operator*=(s);
+}
+
+
 // * * * * * * * * * * * * * * * Friend Operators  * * * * * * * * * * * * * //
 
 template<class Thermo>
-- 
GitLab