mirror of
https://github.com/OpenFOAM/OpenFOAM-6.git
synced 2025-12-08 06:57:46 +00:00
thermophysicalModels::liquidProperties: Added initial write-to-dict functionality
Needs further work to make read and write of dictionary consistent.
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -64,7 +64,7 @@ public:
|
||||
|
||||
// Fundamental properties
|
||||
|
||||
static word name()
|
||||
static word energyName()
|
||||
{
|
||||
return "ha";
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -65,7 +65,7 @@ public:
|
||||
|
||||
// Fundamental properties
|
||||
|
||||
static word name()
|
||||
static word energyName()
|
||||
{
|
||||
return "ea";
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -64,7 +64,7 @@ public:
|
||||
|
||||
// Fundamental properties
|
||||
|
||||
static word name()
|
||||
static word energyName()
|
||||
{
|
||||
return "h";
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -65,7 +65,7 @@ public:
|
||||
|
||||
// Fundamental properties
|
||||
|
||||
static word name()
|
||||
static word energyName()
|
||||
{
|
||||
return "e";
|
||||
}
|
||||
|
||||
@ -100,7 +100,7 @@ template<class Thermo, template<class> class Type>
|
||||
inline Foam::word
|
||||
Foam::species::thermo<Thermo, Type>::heName()
|
||||
{
|
||||
return Type<thermo<Thermo, Type>>::name();
|
||||
return Type<thermo<Thermo, Type>>::energyName();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -260,6 +260,25 @@ void Foam::liquidProperties::writeData(Ostream& os) const
|
||||
}
|
||||
|
||||
|
||||
void Foam::liquidProperties::write(Ostream& os) const
|
||||
{
|
||||
thermophysicalProperties::write(os);
|
||||
|
||||
dictionary dict("liquidProperties");
|
||||
dict.add("Tc", Tc_);
|
||||
dict.add("Pc", Pc_);
|
||||
dict.add("Vc", Vc_);
|
||||
dict.add("Zc", Zc_);
|
||||
dict.add("Tt", Tt_);
|
||||
dict.add("Pt", Pt_);
|
||||
dict.add("Tb", Tb_);
|
||||
dict.add("dipm", dipm_);
|
||||
dict.add("omega", omega_);
|
||||
dict.add("delta", delta_);
|
||||
os << indent << dict.dictName() << dict;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
|
||||
|
||||
Foam::Ostream& Foam::operator<<(Ostream& os, const liquidProperties& l)
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -291,7 +291,10 @@ public:
|
||||
inline void readIfPresent(Liquid& l, const dictionary& dict);
|
||||
|
||||
//- Write the function coefficients
|
||||
virtual void writeData(Ostream& os) const = 0;;
|
||||
virtual void writeData(Ostream& os) const = 0;
|
||||
|
||||
//- Write dictionary to Ostream
|
||||
void write(Ostream& os) const;
|
||||
|
||||
//- Write the data for each of the property functions
|
||||
template<class Liquid>
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2017 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -121,6 +121,14 @@ void Foam::thermophysicalProperties::writeData(Ostream& os) const
|
||||
}
|
||||
|
||||
|
||||
void Foam::thermophysicalProperties::write(Ostream& os) const
|
||||
{
|
||||
dictionary dict("thermophysicalProperties");
|
||||
dict.add("W", W_);
|
||||
os << indent << dict.dictName() << dict;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
|
||||
|
||||
Foam::Ostream& Foam::operator<<(Ostream& os, const thermophysicalProperties& l)
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2017 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -172,6 +172,9 @@ public:
|
||||
//- Write the function coefficients
|
||||
virtual void writeData(Ostream& os) const = 0;
|
||||
|
||||
//- Write dictionary to Ostream
|
||||
void write(Ostream& os) const;
|
||||
|
||||
//- Ostream Operator
|
||||
friend Ostream& operator<<
|
||||
(
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2017 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -58,4 +58,16 @@ thermophysicalPropertiesSelector
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class ThermophysicalProperties>
|
||||
void Foam::thermophysicalPropertiesSelector<ThermophysicalProperties>::write
|
||||
(
|
||||
Ostream& os
|
||||
) const
|
||||
{
|
||||
propertiesPtr_->write(os);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2017 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -45,7 +45,7 @@ namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class thermophysicalPropertiesSelector Declaration
|
||||
Class thermophysicalPropertiesSelector Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class ThermophysicalProperties>
|
||||
@ -135,6 +135,12 @@ public:
|
||||
inline scalar S(const scalar p, const scalar T) const;
|
||||
|
||||
|
||||
// I-O
|
||||
|
||||
//- Write to Ostream
|
||||
void write(Ostream& os) const;
|
||||
|
||||
|
||||
// Physical properties
|
||||
|
||||
//- Liquid viscosity [Pa s]
|
||||
|
||||
Reference in New Issue
Block a user