|
[Sponsors] |
How to add Sutherlands law to calculate the dynamic viscosity |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
September 19, 2016, 17:18 |
How to add Sutherlands law to calculate the dynamic viscosity
|
#1 |
Member
Sheikh Ahmed
Join Date: Dec 2015
Location: South Carolina, USA
Posts: 88
Rep Power: 10 |
Dear Foamers
I badly need your expertise to find an answer. I am trying to find one of my transport properties- the dynamic viscosity of a gas mixture using mixture Sutherlands Law. The version I am using now doesnot incorporate any temperature dependency in transport and just calculates transport properties using mole fractions of species in the gas mixture. I have already seen SutherlandTransport.C and SutherlandTransport.H files online, but dont know how and where to add them and how to connect that with the code. Could anyone PLEASE help me or give me any hints on it. ~Farhan /*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License This file is part of OpenFOAM. OpenFOAM is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. OpenFOAM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. \*---------------------------------------------------------------------------*/ #include "sutherlandTransport.H" #include "IOstreams.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template<class Thermo> Foam::sutherlandTransport<Thermo>::sutherlandTrans port(Istream& is) : Thermo(is), As_(readScalar(is)), Ts_(readScalar(is)) { is.check("sutherlandTransport<Thermo>::sutherlandT ransport(Istream&)"); } template<class Thermo> Foam::sutherlandTransport<Thermo>::sutherlandTrans port(const dictionary& dict) : Thermo(dict), As_(readScalar(dict.subDict("transport").lookup("A s"))), Ts_(readScalar(dict.subDict("transport").lookup("T s"))) {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<class Thermo> void Foam::sutherlandTransport<Thermo>::write(Ostream& os) const { os << this->specie::name() << endl; os << token::BEGIN_BLOCK << incrIndent << nl; Thermo::write(os); dictionary dict("transport"); dict.add("As", As_); dict.add("Ts", Ts_); os << indent << dict.dictName() << dict; os << decrIndent << token::END_BLOCK << nl; } // * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * // template<class Thermo> Foam::Ostream& Foam:perator<< ( Ostream& os, const sutherlandTransport<Thermo>& st ) { os << static_cast<const Thermo&>(st) << tab << st.As_ << tab << st.Ts_; os.check ( "Ostream& operator<<(Ostream&, const sutherlandTransport<Thermo>&)" ); return os; } /*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License This file is part of OpenFOAM. OpenFOAM is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. OpenFOAM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Class Foam::sutherlandTransport Description Transport package using Sutherland's formula. Templated into a given thermodynamics package (needed for thermal conductivity). Dynamic viscosity [kg/m.s] \f[ \mu = A_s \frac{\sqrt{T}}{1 + T_s / T} \f] SourceFiles sutherlandTransportI.H sutherlandTransport.C \*---------------------------------------------------------------------------*/ #ifndef sutherlandTransport_H #define sutherlandTransport_H // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { // Forward declaration of friend functions and operators template<class Thermo> class sutherlandTransport; template<class Thermo> inline sutherlandTransport<Thermo> operator+ ( const sutherlandTransport<Thermo>&, const sutherlandTransport<Thermo>& ); template<class Thermo> inline sutherlandTransport<Thermo> operator- ( const sutherlandTransport<Thermo>&, const sutherlandTransport<Thermo>& ); template<class Thermo> inline sutherlandTransport<Thermo> operator* ( const scalar, const sutherlandTransport<Thermo>& ); template<class Thermo> inline sutherlandTransport<Thermo> operator== ( const sutherlandTransport<Thermo>&, const sutherlandTransport<Thermo>& ); template<class Thermo> Ostream& operator<< ( Ostream&, const sutherlandTransport<Thermo>& ); /*---------------------------------------------------------------------------*\ Class sutherlandTransport Declaration \*---------------------------------------------------------------------------*/ template<class Thermo> class sutherlandTransport : public Thermo { // Private data // Sutherland's coefficients scalar As_, Ts_; // Private Member Functions //- Calculate the Sutherland coefficients // given two viscosities and temperatures inline void calcCoeffs ( const scalar mu1, const scalar T1, const scalar mu2, const scalar T2 ); public: // Constructors //- Construct from components inline sutherlandTransport ( const Thermo& t, const scalar As, const scalar Ts ); //- Construct from two viscosities inline sutherlandTransport ( const Thermo& t, const scalar mu1, const scalar T1, const scalar mu2, const scalar T2 ); //- Construct as named copy inline sutherlandTransport(const word&, const sutherlandTransport&); //- Construct from Istream sutherlandTransport(Istream&); //- Construct from dictionary sutherlandTransport(const dictionary& dict); //- Construct and return a clone inline autoPtr<sutherlandTransport> clone() const; // Selector from Istream inline static autoPtr<sutherlandTransport> New(Istream& is); // Selector from dictionary inline static autoPtr<sutherlandTransport> New(const dictionary& dict); // Member functions //- Return the instantiated type name static word typeName() { return "sutherland<" + Thermo::typeName() + '>'; } //- Dynamic viscosity [kg/ms] inline scalar mu(const scalar p, const scalar T) const; //- Thermal conductivity [W/mK] inline scalar kappa(const scalar p, const scalar T) const; //- Thermal diffusivity of enthalpy [kg/ms] inline scalar alphah(const scalar p, const scalar T) const; // Species diffusivity //inline scalar D(const scalar p, const scalar T) const; //- Write to Ostream void write(Ostream& os) const; // Member operators inline sutherlandTransport& operator=(const sutherlandTransport&); inline void operator+=(const sutherlandTransport&); inline void operator-=(const sutherlandTransport&); inline void operator*=(const scalar); // Friend operators friend sutherlandTransport operator+ <Thermo> ( const sutherlandTransport&, const sutherlandTransport& ); friend sutherlandTransport operator- <Thermo> ( const sutherlandTransport&, const sutherlandTransport& ); friend sutherlandTransport operator* <Thermo> ( const scalar, const sutherlandTransport& ); friend sutherlandTransport operator== <Thermo> ( const sutherlandTransport&, const sutherlandTransport& ); // Ostream Operator friend Ostream& operator<< <Thermo> ( Ostream&, const sutherlandTransport& ); }; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #include "sutherlandTransportI.H" #ifdef NoRepository # include "sutherlandTransport.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #endif |
|
September 20, 2016, 00:51 |
|
#2 |
Member
Sheikh Ahmed
Join Date: Dec 2015
Location: South Carolina, USA
Posts: 88
Rep Power: 10 |
This is very common topics, so I am confident that any of you might tried similar. Please help me with any of your suggestion. Waiting for your valuable comments.
|
|
September 23, 2016, 10:36 |
|
#3 |
New Member
Bill
Join Date: Aug 2016
Posts: 1
Rep Power: 0 |
Sutherland transport is compiled on installation of OF4. If you have an older installation you need to download the files and then compile. It looks like you have the source files already... To compile, run the following from the source directory with the appropriate Make files:
Code:
wmake libso |
|
Tags |
sutherlandslaw, temperature dependence, transportproperties |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Other] Add / remove cell layers (dynamic mesh) | ChristophGradl | OpenFOAM Meshing & Mesh Conversion | 9 | April 8, 2021 05:08 |
[PyFoam] and paraview | eelcovv | OpenFOAM Community Contributions | 28 | May 30, 2016 10:23 |
eddy viscosity vs dynamic viscosity?? | alpharays | Main CFD Forum | 1 | August 11, 2014 04:54 |
Add a layer of cells, UDF, dynamic mesh or ...? | Modisa | FLUENT | 0 | March 17, 2007 12:59 |
Add a layer of cells, dynamic mesh or ...? | Modisa | FLUENT | 1 | March 12, 2007 03:01 |