PhaseChange.h
Go to the documentation of this file.00001 /*============================================================================== 00002 00003 O F E L I 00004 00005 Object Finite Element Library 00006 00007 ============================================================================== 00008 00009 Copyright (C) 1998 - 2008 Rachid Touzani 00010 00011 This program is free software; you can redistribute it and/or modify it under 00012 the terms of the GNU General Public License as published by the Free 00013 Software Foundation; Version 2 of the License. 00014 00015 This program is distributed in the hope that it will be useful, but WITHOUT 00016 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00017 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 00018 details. 00019 00020 You should have received a copy of the GNU General Public License 00021 along with this program; if not, write to the : 00022 00023 Free Software Foundation 00024 Inc., 59 Temple Place - Suite 330 00025 Boston, MA 02111-1307, USA 00026 00027 ============================================================================== 00028 00029 Definition of Material properties associated to phase change 00030 00031 ==============================================================================*/ 00032 00033 00034 #ifndef __PHASE_CHANGE_H 00035 #define __PHASE_CHANGE_H 00036 00037 #include "Material.h" 00038 00039 #include <string> 00040 using std::string; 00041 00042 namespace OFELI { 00043 00060 class PhaseChange 00061 { 00062 00063 public: 00064 00066 virtual ~PhaseChange() { } 00067 00074 int E2T(double &H, double &T, double &gamma); 00075 00083 virtual int EnthalpyToTemperature(double &H, double &T, double &gamma) 00084 { 00085 gamma = _material->Density()*_material->SpecificHeat(); 00086 T = H/gamma; 00087 return 0; 00088 } 00089 00091 void setMaterial(Material &m, int code); 00092 00094 Material &getMaterial() const { return *_material; } 00095 00096 protected: 00097 00098 #ifndef DOXYGEN_SHOULD_SKIP_THIS 00099 Material *_material; 00100 int _code; 00101 string _name; 00102 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 00103 }; 00104 00105 template<class C_> 00106 void setPhaseChangeLaw(C_ &c, double &H, double &T, double &gamma); 00107 00108 } /* namespace OFELI */ 00109 00110 #endif