$treeview $search $mathjax
|
Palabos
Version 1.1
$projectbrief
|
$projectbrief
|
$searchbox |
00001 /* This file is part of the Palabos library. 00002 * 00003 * Copyright (C) 2011 FlowKit Sarl 00004 * Avenue de Chailly 23 00005 * 1012 Lausanne, Switzerland 00006 * E-mail contact: contact@flowkit.com 00007 * 00008 * The most recent release of Palabos can be downloaded at 00009 * <http://www.palabos.org/> 00010 * 00011 * The library Palabos is free software: you can redistribute it and/or 00012 * modify it under the terms of the GNU Affero General Public License as 00013 * published by the Free Software Foundation, either version 3 of the 00014 * License, or (at your option) any later version. 00015 * 00016 * The library is distributed in the hope that it will be useful, 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 * GNU Affero General Public License for more details. 00020 * 00021 * You should have received a copy of the GNU Affero General Public License 00022 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00023 */ 00024 00025 #ifndef INTERPARTICLE_POTENTIAL_HH 00026 #define INTERPARTICLE_POTENTIAL_HH 00027 00028 #include "multiPhysics/interparticlePotential.h" 00029 00030 namespace plb { 00031 00032 namespace interparticlePotential { 00033 00034 template<typename T> 00035 PsiFunction<T>::~PsiFunction() 00036 { } 00037 00038 template<typename T> 00039 T PsiIsRho<T>::compute(T rho) const { 00040 return rho; 00041 } 00042 template<typename T> 00043 PsiIsRho<T>* PsiIsRho<T>::clone() const { 00044 return new PsiIsRho<T>(*this); 00045 } 00046 00047 template<typename T> 00048 PsiShanChen93<T>::PsiShanChen93(T rho_0_) 00049 : rho_0(rho_0_) 00050 { } 00051 00052 template<typename T> 00053 T PsiShanChen93<T>::compute(T rho) const { 00054 return rho_0 * ((T)1 - exp(-rho/rho_0)); 00055 } 00056 00057 template<typename T> 00058 PsiShanChen93<T>* PsiShanChen93<T>::clone() const { 00059 return new PsiShanChen93<T>(*this); 00060 } 00061 00062 template<typename T> 00063 PsiShanChen94<T>::PsiShanChen94(T psi_0_, T rho_0_) 00064 : psi_0(psi_0_), 00065 rho_0(rho_0_) 00066 { } 00067 00068 template<typename T> 00069 T PsiShanChen94<T>::compute(T rho) const { 00070 return psi_0 * exp(-rho_0/rho); 00071 } 00072 00073 template<typename T> 00074 PsiShanChen94<T>* PsiShanChen94<T>::clone() const { 00075 return new PsiShanChen94<T>(*this); 00076 } 00077 00078 template<typename T> 00079 PsiQian95<T>::PsiQian95(T rho_0_, T g_) 00080 : rho_0(rho_0_), 00081 rho_0_sqr(rho_0*rho_0), 00082 g(g_) 00083 { } 00084 00085 template<typename T> 00086 T PsiQian95<T>::compute(T rho) const { 00087 T rho_sqr = rho*rho; 00088 return g * rho_0_sqr * rho_sqr / 00089 ( (T)2*(rho_0_sqr+rho_sqr+(T)2*rho_0*rho) ); 00090 } 00091 template<typename T> 00092 PsiQian95<T>* PsiQian95<T>::clone() const { 00093 return new PsiQian95<T>(*this); 00094 } 00095 00096 } // namespace interparticlePotential 00097 00098 } // namespace plb 00099 00100 #endif // INTERPARTICLE_POTENTIAL_HH
1.6.3
1.6.3