From fe20510296bf8f8afda3d5472d566aaeba800a55 Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 26 Feb 2013 15:55:44 +0000 Subject: [PATCH] ENH: Documentation updates --- .../sources/derived/MRFSource/MRFSource.H | 29 ++++--- .../actuationDiskSource/actuationDiskSource.H | 54 ++++++------ .../effectivenessHeatExchangerSource.H | 80 ++++++++++-------- .../explicitPorositySource.H | 38 +++++---- .../pressureGradientExplicitSource.H | 20 +++-- .../radialActuationDiskSource.H | 64 +++++++++------ .../derived/rotorDiskSource/rotorDiskSource.H | 82 ++++++++++--------- .../sources/general/codedSource/CodedSource.H | 68 +++++++-------- 8 files changed, 234 insertions(+), 201 deletions(-) diff --git a/src/fvOptions/sources/derived/MRFSource/MRFSource.H b/src/fvOptions/sources/derived/MRFSource/MRFSource.H index f2a84dee30..7dccdf8c7c 100644 --- a/src/fvOptions/sources/derived/MRFSource/MRFSource.H +++ b/src/fvOptions/sources/derived/MRFSource/MRFSource.H @@ -8,10 +8,10 @@ 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 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 @@ -19,8 +19,7 @@ License for more details. You should have received a copy of the GNU General Public License - along with OpenFOAM; if not, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + along with OpenFOAM. If not, see . Class Foam::fv::MRFSource @@ -28,14 +27,18 @@ Class Description Multiple Reference Frame (MRF) source - Example usage: + \heading Source usage + + Example usage: + \verbatim + MRFSourceCoeffs + { + origin (0 0 0); + axis (0 0 1); + omega 104.72; + } + \endverbatim - MRFSourceCoeffs - { - origin (0 0 0); - axis (0 0 1); - omega 104.72; - } SourceFiles MRFSource.C diff --git a/src/fvOptions/sources/derived/actuationDiskSource/actuationDiskSource.H b/src/fvOptions/sources/derived/actuationDiskSource/actuationDiskSource.H index ca6734402d..3d95d8f70f 100644 --- a/src/fvOptions/sources/derived/actuationDiskSource/actuationDiskSource.H +++ b/src/fvOptions/sources/derived/actuationDiskSource/actuationDiskSource.H @@ -8,10 +8,10 @@ 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 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 @@ -19,8 +19,7 @@ License for more details. You should have received a copy of the GNU General Public License - along with OpenFOAM; if not, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + along with OpenFOAM. If not, see . Class Foam::fv::actuationDiskSource @@ -29,27 +28,36 @@ Description Actuation disk source Constant values for momentum source for actuation disk - - T = 2*rho*A*sqr(Uo)*a*(1-a) - U1 = (1 -a)Uo + \f[ + T = 2 \rho A U_{o}^2 a (1-a) + \f] + and + \f[ + U_1 = (1 - a)U_{o} + \f] where: - A: disk area - Uo: upstream velocity - a: 1 - Cp/Ct - U1: velocity at the disk + \vartable + A | disk area + U_o | upstream velocity + a | 1 - Cp/Ct + U_1 | velocity at the disk + \endvartable - Sources described by: + \heading Source usage - actuationDiskSourceCoeffs - { - fieldNames (U); // names of fields to apply source - diskDir (-1 0 0); // disk direction - Cp 0.1; // power coefficient - Ct 0.5; // thrust coefficient - diskArea 5.0; // disk area - upstreamPoint (0 0 0); // upstream point - } + Example usage: + \verbatim + actuationDiskSourceCoeffs + { + fieldNames (U); // names of fields to apply source + diskDir (-1 0 0); // disk direction + Cp 0.1; // power coefficient + Ct 0.5; // thrust coefficient + diskArea 5.0; // disk area + upstreamPoint (0 0 0); // upstream point + } + \endverbatim SourceFiles diff --git a/src/fvOptions/sources/derived/effectivenessHeatExchangerSource/effectivenessHeatExchangerSource.H b/src/fvOptions/sources/derived/effectivenessHeatExchangerSource/effectivenessHeatExchangerSource.H index 5ca26fbdbe..2f83a97ed9 100644 --- a/src/fvOptions/sources/derived/effectivenessHeatExchangerSource/effectivenessHeatExchangerSource.H +++ b/src/fvOptions/sources/derived/effectivenessHeatExchangerSource/effectivenessHeatExchangerSource.H @@ -8,10 +8,10 @@ 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 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 @@ -19,38 +19,50 @@ License for more details. You should have received a copy of the GNU General Public License - along with OpenFOAM; if not, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + along with OpenFOAM. If not, see . Class Foam::fv::effectivenessHeatExchangerSource Description - Heat exchanger source model. - The total heat exchange is given by: + Heat exchanger source model, in which the heat exchanger is defined as a + selection of cells. - Qt = e(phi, secondaryMassFlowRate) - * (secondaryInletT - primaryInletT) - * phi*Cp; + The total heat exchange source is given by: + \f[ + Q_t = e(\phi, \dot{m}_2) (T_2 - T_1) \phi c_p + \f] where: - e(phi, secondaryMassFlowRate) is a effectivenes table in function of - mass net flux coming imto the heat exchanger (phi) and - secondaryMassFlowRate + \vartable + Q_t | total heat source + e(\phi,\dot{m}_2) | effectivenes table + \phi | net mass flux entering heat exchanger [kg/s] + \dot{m}_2 | secondary mass flow rate [kg/s] + T_1 | primary inlet temperature [K] + T_2 | secondary inlet temperature [K] + c_p | specific heat capacity [J/kg/K] + \endvartable - Then the distribution inside the hear exchanger is given by: - Qcell = Vcell*|Ucell|*(Tcell - Tref)/sum(Vcell*|Ucell|*(Tcell - Tref)); + The distribution inside the hear exchanger is given by: + \f[ + Q_c = \frac{V_c |U_c| (T_c - T_{ref})}{\sum(V_c |U_c| (T_c - T_{ref}))} + \f] where: - Qcell is the source for cell - Vcell is the volume of the cell - Ucell is the local cell velocity - Tcell is the local call temperature - Tref : min(T) or max(T) in the cell zone depending on the sign of Qt + \vartable + Q_c | source for cell + V_c | volume of the cell [m3] + U_c | local cell velocity [m/s] + T_c | local call temperature [K] + T_{ref} | min or max(T) in cell zone depending on the sign of Q_t [K] + \endvartable - Example : + \heading Source usage + Example usage: + \verbatim effectivenessHeatExchangerSource1 { type effectivenessHeatExchangerSource; @@ -69,13 +81,14 @@ Description fileName "effTable"; } } + \endverbatim - Note: - the table with name "fileName" should have the same units as - secondaryMassFlowRate and kg/s for phi - faceZone is the faces at the inlet of the cellzone, it needs to be - created with flip map flags. It is used to integrate the net mass flow - rate into the heat exchanger +Note +- the table with name "fileName" should have the same units as the + secondary mass flow rate and kg/s for phi +- faceZone is the faces at the inlet of the cellzone, it needs to be + created with flip map flags. It is used to integrate the net mass flow + rate into the heat exchanger SourceFiles @@ -98,7 +111,7 @@ namespace fv { /*---------------------------------------------------------------------------*\ - Class effectivenessHeatExchangerSource Declaration + Class effectivenessHeatExchangerSource Declaration \*---------------------------------------------------------------------------*/ class effectivenessHeatExchangerSource @@ -110,7 +123,7 @@ protected: // Protected data - //- Secondary flow mass rate [Kg/s] + //- Secondary flow mass rate [kg/s] scalar secondaryMassFlowRate_; //- Inlet secondary temperature [K] @@ -119,8 +132,8 @@ protected: //- Primary air temperature at the heat exchanger inlet [K] scalar primaryInletT_; - //- 2D look up table efficiency = F(total primary mass flow rate [Kg/s] - //, secondary mass flow rate [Kg/s]) + //- 2D look up table efficiency = function of primary and secondary + // mass flow rates [kg/s] autoPtr > eTable_; //- Name of velocity field; default = U @@ -144,8 +157,7 @@ protected: //- Local list of patch ID per face labelList facePatchId_; - //- List of +1/-1 representing face flip map - // (1 use as is, -1 negate) + //- List of +1/-1 representing face flip map (1 use as is, -1 negate) labelList faceSign_; //- Area of the face zone diff --git a/src/fvOptions/sources/derived/explicitPorositySource/explicitPorositySource.H b/src/fvOptions/sources/derived/explicitPorositySource/explicitPorositySource.H index 2bd602ac1f..a89503ecf7 100644 --- a/src/fvOptions/sources/derived/explicitPorositySource/explicitPorositySource.H +++ b/src/fvOptions/sources/derived/explicitPorositySource/explicitPorositySource.H @@ -8,10 +8,10 @@ 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 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 @@ -19,8 +19,7 @@ License for more details. You should have received a copy of the GNU General Public License - along with OpenFOAM; if not, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + along with OpenFOAM. If not, see . Class Foam::fv::explicitPorositySource @@ -28,23 +27,26 @@ Class Description Explicit porosity source - Sources described by, for example using the DarcyForchheimer model: + \heading Source usage - explicitPorositySourceCoeffs + Example usage, here employing the Darcy-Forchheimer model: + \verbatim + explicitPorositySourceCoeffs + { + type DarcyForchheimer; + DarcyForchheimerCoeffs { - type DarcyForchheimer; - DarcyForchheimerCoeffs - { - d d [0 -2 0 0 0 0 0] (5e7 -1000 -1000); - f f [0 -1 0 0 0 0 0] (0 0 0); + d d [0 -2 0 0 0 0 0] (5e7 -1000 -1000); + f f [0 -1 0 0 0 0 0] (0 0 0); - coordinateSystem - { - e1 (0.70710678 0.70710678 0); - e2 (0 0 1); - } + coordinateSystem + { + e1 (0.70710678 0.70710678 0); + e2 (0 0 1); } } + } + \endverbatim Note: The porous region must be selected as a cellZone. diff --git a/src/fvOptions/sources/derived/pressureGradientExplicitSource/pressureGradientExplicitSource.H b/src/fvOptions/sources/derived/pressureGradientExplicitSource/pressureGradientExplicitSource.H index 47a48a24c0..0b8390f9f9 100644 --- a/src/fvOptions/sources/derived/pressureGradientExplicitSource/pressureGradientExplicitSource.H +++ b/src/fvOptions/sources/derived/pressureGradientExplicitSource/pressureGradientExplicitSource.H @@ -29,15 +29,17 @@ Description Note: Currently only handles kinematic pressure - Sources described by: - - pressureGradientExplicitSourceCoeffs - { - fieldNames (U); // name of velocity field - Ubar (10.0 0 0); // desired average velocity - gradPini gradPini [0 2 -2 0 0] 0; // initial pressure gradient - flowDir (1 0 0); // flow direction - } + \heading Source usage + Example usage: + \verbatim + pressureGradientExplicitSourceCoeffs + { + fieldNames (U); // name of velocity field + Ubar (10.0 0 0); // desired average velocity + gradPini gradPini [0 2 -2 0 0] 0; // initial pressure gradient + flowDir (1 0 0); // flow direction + } + \endverbatim SourceFiles diff --git a/src/fvOptions/sources/derived/radialActuationDiskSource/radialActuationDiskSource.H b/src/fvOptions/sources/derived/radialActuationDiskSource/radialActuationDiskSource.H index 02a2970e8c..3fb20e45d5 100644 --- a/src/fvOptions/sources/derived/radialActuationDiskSource/radialActuationDiskSource.H +++ b/src/fvOptions/sources/derived/radialActuationDiskSource/radialActuationDiskSource.H @@ -8,10 +8,10 @@ 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 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 @@ -19,42 +19,52 @@ License for more details. You should have received a copy of the GNU General Public License - along with OpenFOAM; if not, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + along with OpenFOAM. If not, see . Class Foam::fv::radialActuationDiskSource Description - Actuation disk zone definition. - Constant values for momentum source for actuation disk + Actuation disk source including radial thrust - T = 2*rho*A*sqr(Uo)*a*(1-a) - U1 = (1 -a)Uo + Constant values for momentum source for actuation disk + \f[ + T = 2 \rho A U_{o}^2 a (1-a) + \f] + and + \f[ + U_1 = (1 - a)U_{o} + \f] where: - A: disk area - Uo: upstream velocity - a: 1 - Cp/Ct - U1: velocity at the disk + \vartable + A | disk area + U_o | upstream velocity + a | 1 - Cp/Ct + U_1 | velocity at the disk + \endvartable The thrust is distributed by a radial function: + \f[ + thrust(r) = T (C_0 + C_1 r^2 + C_2 r^4) + \f] - thrust(r) = T*(C0 + C1*r^2 + C2*r^4) + \heading Source usage - Sources described by: - - actuationDiskSourceCoeffs - { - fieldName U; // name of field to apply source - diskDir (-1 0 0); // disk direction - Cp 0.1; // power coefficient - Ct 0.5; // thrust coefficient - diskArea 5.0; // disk area - coeffs (0.1 0.5 0.01); // radial distribution coefficients - upstreamPoint (0 0 0); // upstream point - } + Example usage: + \verbatim + actuationDiskSourceCoeffs + { + fieldName U; // name of field to apply source + diskDir (-1 0 0); // disk direction + Cp 0.1; // power coefficient + Ct 0.5; // thrust coefficient + diskArea 5.0; // disk area + coeffs (0.1 0.5 0.01); // radial distribution coefficients + upstreamPoint (0 0 0); // upstream point + } + \endverbatim SourceFiles diff --git a/src/fvOptions/sources/derived/rotorDiskSource/rotorDiskSource.H b/src/fvOptions/sources/derived/rotorDiskSource/rotorDiskSource.H index 70775644db..1ac30fcfb8 100644 --- a/src/fvOptions/sources/derived/rotorDiskSource/rotorDiskSource.H +++ b/src/fvOptions/sources/derived/rotorDiskSource/rotorDiskSource.H @@ -30,52 +30,54 @@ Description Source approximates the mean effects of rotor forces on a cylindrical region within the domain - Sources described by: + \heading Source usage - rotorDiskSourceCoeffs + Example usage: + \verbatim + rotorDiskSourceCoeffs + { + fieldNames (U); // names of fields on which to apply source + rhoName rho; // density field if compressible case + nBlades 3; // number of blades + tipEffect 0.96; // normalised radius above which lift = 0 + + inletFlowType local; // inlet flow type specification + + geometryMode auto; // geometry specification + + refDirection (-1 0 0); // reference direction + // - used as reference for psi angle + + trimModel fixed; // fixed || targetForce + + flapCoeffs { - fieldNames (U); // names of fields on which to apply source - rhoName rho; // density field if compressible case - nBlades 3; // number of blades - tipEffect 0.96; // normalised radius above which lift = 0 - - inletFlowType local; // inlet flow type specification - - geometryMode auto; // geometry specification - - refDirection (-1 0 0); // reference direction - // - used as reference for psi angle - - trimModel fixed; // fixed || targetForce - - flapCoeffs - { - beta0 0; // coning angle [deg] - beta1c 0; // lateral flapping coeff (cos coeff) - beta2s 0; // longitudinal flapping coeff (sin coeff) - } - - blade - { - ... - } - - profiles - { - ... - } + beta0 0; // coning angle [deg] + beta1c 0; // lateral flapping coeff (cos coeff) + beta2s 0; // longitudinal flapping coeff (sin coeff) } + blade + { + ... + } + + profiles + { + ... + } + } + \endverbatim + Where: + Valid options for the \c geometryMode entry include: + - auto : determine rototor co-ord system from cells + - specified : specified co-ord system - geometryMode = - auto : determine rototor co-ord system from cells - specified : specified co-ord system - - inletFlowType = - fixed : specified velocity - surfaceNormal : specified normal velocity (positive towards rotor) - local : use local flow conditions + Valid options for the \c inletFlowType entry include: + - fixed : specified velocity + - local : use local flow conditions + - surfaceNormal : specified normal velocity (positive towards rotor) SourceFiles diff --git a/src/fvOptions/sources/general/codedSource/CodedSource.H b/src/fvOptions/sources/general/codedSource/CodedSource.H index bbc93e5aec..e414bc1e02 100644 --- a/src/fvOptions/sources/general/codedSource/CodedSource.H +++ b/src/fvOptions/sources/general/codedSource/CodedSource.H @@ -25,52 +25,46 @@ Class Foam::fv::codedSource Description - Constructs on-the-fly a new fvOption. + Constructs on-the-fly source - E.g. in system/fvOptions + \heading Source usage - momentumSource + Example usage: + \verbatim + vectorCodedSourceCoeffs { - type vectorCodedSource; - active on; //on/off switch - timeStart 0.0; //start time - duration 1000000.0; //duration - selectionMode all; //cellSet // points //cellZone + fieldNames (U); + redirectType ramp; - vectorCodedSourceCoeffs - { - fieldNames (U); - redirectType ramp; + codeCorrect + #{ + Pout<< "**codeCorrect**" << endl; + #}; - codeCorrect - #{ - Pout<< "**codeCorrect**" << endl; - #}; + codeAddSup + #{ + Pout<< "**codeAddSup**" << endl; + #}; - codeAddSup - #{ - Pout<< "**codeAddSup**" << endl; - #}; + codeSetValue + #{ + Pout<< "**codeSetValue**" << endl; + #}; - codeSetValue - #{ - Pout<< "**codeSetValue**" << endl; - #}; - - // Dummy entry. Make dependent on above to trigger recompilation - code - #{ - $codeCorrect - $codeAddSup - $codeSetValue - #}; - } - - // Dummy entry - rampCoeffs - {} + // Dummy entry. Make dependent on above to trigger recompilation + code + #{ + $codeCorrect + $codeAddSup + $codeSetValue + #}; } + // Dummy entry + rampCoeffs + {} + \endverbatim + SourceFiles codedSource.C