|
|
|
timeActivatedExplicitMulticomponentPointSource.HGo to the documentation of this file.00001 /*---------------------------------------------------------------------------*\ 00002 ========= | 00003 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 00004 \\ / O peration | 00005 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. 00006 \\/ M anipulation | 00007 ------------------------------------------------------------------------------- 00008 License 00009 This file is part of OpenFOAM. 00010 00011 OpenFOAM is free software; you can redistribute it and/or modify it 00012 under the terms of the GNU General Public License as published by the 00013 Free Software Foundation; either version 2 of the License, or (at your 00014 option) any later version. 00015 00016 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT 00017 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00018 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 00019 for more details. 00020 00021 You should have received a copy of the GNU General Public License 00022 along with OpenFOAM; if not, write to the Free Software Foundation, 00023 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00024 00025 Class 00026 Foam::timeActivatedExplicitMulticomponentPointSourceNew 00027 00028 Description 00029 Provides a mechanism to introduce point sources to a set of carrier fields. 00030 Carrier fields are supplied on consruction, and interrogated to provide the 00031 field indices of the sources. 00032 00033 Source values are assumed to be in <quantity>/s, and divided through by the 00034 cell volumes before being returned, e.g. for a kg/s source 00035 00036 Properties are described in a <name>Properties dictionary 00037 00038 active true; // are sources active (true/false) 00039 00040 pointSources 00041 ( 00042 source1 // source name 00043 { 00044 timeStart 0.0; 00045 duration 1.0; 00046 location (0 0 0); 00047 fieldData 00048 ( 00049 (H2O 0.1) // kg/s 00050 (O2 0.05) // kg/s 00051 ); 00052 } 00053 source2 // source name 00054 { 00055 timeStart 0.5; 00056 duration 2.0; 00057 location (1 1 1); 00058 fieldData 00059 ( 00060 (NO 0.1) // kg/s 00061 (CO2 0.05) // kg/s 00062 (H2 0.001) // kg/s 00063 ); 00064 } 00065 ); 00066 00067 00068 SourceFiles 00069 timeActivatedExplicitMulticomponentPointSourceNew.C 00070 00071 \*---------------------------------------------------------------------------*/ 00072 00073 #ifndef timeActivatedExplicitMulticomponentPointSource_H 00074 #define timeActivatedExplicitMulticomponentPointSource_H 00075 00076 #include "IOdictionary.H" 00077 #include "fvMesh.H" 00078 #include "Time.H" 00079 #include "pointSourceProperties.H" 00080 00081 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00082 00083 namespace Foam 00084 { 00085 00086 /*---------------------------------------------------------------------------*\ 00087 Class timeActivatedExplicitMulitcomponentPointSource Declaration 00088 \*---------------------------------------------------------------------------*/ 00089 00090 class timeActivatedExplicitMulticomponentPointSource 00091 : 00092 public IOdictionary 00093 { 00094 protected: 00095 00096 // Protected data 00097 00098 //- Name of the source 00099 word name_; 00100 00101 //- Reference to the mesh 00102 const fvMesh& mesh_; 00103 00104 //- Reference to time database 00105 const Time& runTime_; 00106 00107 //- Source dimensions 00108 const dimensionSet& dimensions_; 00109 00110 //- Reference to the multicomponent carrier fields 00111 const PtrList<volScalarField>& carrierFields_; 00112 00113 //- Active flag 00114 Switch active_; 00115 00116 //- List of point source properties 00117 List<pointSourceProperties> pointSources_; 00118 00119 //- List of cell owners for point source locations 00120 List<label> cellOwners_; 00121 00122 //- List of field ids for each source 00123 List<labelList> fieldIds_; 00124 00125 00126 // Protected Member Functions 00127 00128 //- Return the id of field given its name 00129 label carrierFieldId(const word& fieldName); 00130 00131 //- Update the addressing between source and carrier fields 00132 void updateAddressing(); 00133 00134 //- Disallow default bitwise copy construct 00135 timeActivatedExplicitMulticomponentPointSource 00136 ( 00137 const timeActivatedExplicitMulticomponentPointSource& 00138 ); 00139 00140 //- Disallow default bitwise assignment 00141 void operator=(const timeActivatedExplicitMulticomponentPointSource&); 00142 00143 00144 public: 00145 00146 // Constructors 00147 00148 //- Construct from components 00149 timeActivatedExplicitMulticomponentPointSource 00150 ( 00151 const word&, 00152 const fvMesh&, 00153 const PtrList<volScalarField>&, 00154 const dimensionSet& 00155 ); 00156 00157 00158 // Member Functions 00159 00160 // Access 00161 00162 //- Return a tmp field of the source for field fieldI 00163 virtual tmp<DimensionedField<scalar, volMesh> > Su 00164 ( 00165 const label fieldI 00166 ); 00167 00168 //- Return a tmp field of the total source 00169 virtual tmp<DimensionedField<scalar, volMesh> > Su(); 00170 00171 00172 //- Read properties dictionary 00173 virtual bool read(); 00174 }; 00175 00176 00177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00178 00179 } // End namespace Foam 00180 00181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00182 00183 #endif 00184 00185 // ************************************************************************* // |