├── LICENSE ├── README.md ├── autoload ├── foam.vim └── foam │ ├── 0 │ ├── BC.vim │ └── foamVariables.vim │ ├── case.vim │ ├── complete.vim │ └── constant │ ├── RASProperties.vim │ ├── dynamicMeshDict.vim │ ├── polyMesh │ ├── blockMeshDict.vim │ └── boundary.vim │ ├── radiationProperties.vim │ ├── regionProperties.vim │ ├── thermodynamicProperties.vim │ ├── transportProperties.vim │ └── turbulenceProperties.vim ├── ftdetect └── foam.vim ├── ftplugin └── foam.vim ├── syntax └── foam.vim └── test └── example ├── 0 ├── T.orig ├── U ├── alphat ├── epsilon ├── k ├── nut ├── p └── p_rgh ├── constant ├── g ├── transportProperties └── turbulenceProperties ├── minivimrc ├── system ├── blockMeshDict ├── controlDict ├── fvSchemes ├── fvSolution └── setFieldsDict ├── vimrc-inspect └── vimrc-quick /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Karl Yngve Lervåg 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # vim-foam 2 | 3 | 2022-04-03 **Project status**: I no longer expect to work with OpenFOAM. As such, I have no 4 | intention to keep this project alive. It is archived and anyone is free to fork 5 | if they are interested. 6 | 7 | This is a filetype plugin for OpenFOAM. It is currently pre-alpha, and the 8 | development will be sporadic. The initial goal is to get up to par with 9 | [vimExtensionOpenFOAM](https://bitbucket.org/shor-ty/vimextensionopenfoam.git). 10 | 11 | ## Table of contents 12 | 13 | * [Installation](#installation) 14 | * [Features](#features) 15 | * [TODO](#todo) 16 | * [Acknowledgements](#acknowledgements) 17 | 18 | ## Installation 19 | 20 | If you use [vim-plug](https://github.com/junegunn/vim-plug), then add the 21 | following line to your `vimrc` file: 22 | 23 | ```vim 24 | Plug 'lervag/vim-foam' 25 | ``` 26 | 27 | Or use some other plugin manager: 28 | - [vundle](https://github.com/gmarik/vundle) 29 | - [neobundle](https://github.com/Shougo/neobundle.vim) 30 | - [pathogen](https://github.com/tpope/vim-pathogen) 31 | 32 | ## Features 33 | 34 | These are the current features of this plugin: 35 | 36 | - Syntax highlighting 37 | - Completion (`:h omni-complete`) 38 | 39 | ## TODO 40 | 41 | - [ ] Fix completion e.g. in `fvSchemes` entries 42 | 43 | ## Acknowledgements 44 | 45 | The syntax part of this plugin is inspired by `vimExtensionOpenFOAM` which was 46 | written by _Ferdinand Leinbach_ and _Tobias Holzmann_. 47 | 48 | -------------------------------------------------------------------------------- /autoload/foam.vim: -------------------------------------------------------------------------------- 1 | function! foam#ftdetect() " {{{1 2 | if did_filetype() 3 | return 4 | endif 5 | 6 | if !empty(filter(getline(1, 15), "v:val =~# 'FoamFile'")) 7 | setfiletype foam 8 | endif 9 | endfunction 10 | 11 | " }}}1 12 | function! foam#init() " {{{1 13 | setlocal tabstop=4 14 | setlocal shiftwidth=4 15 | setlocal expandtab 16 | setlocal omnifunc=foam#complete#omnifunc 17 | 18 | let b:foam = {} 19 | let b:foam.type = s:get_foam_type() 20 | endfunction 21 | 22 | " }}}1 23 | 24 | function! s:get_foam_type() " {{{1 25 | let types = { 26 | \ 'BC' : '\v%(' . join([ 27 | \ ' h', ' T', ' U.*', 'alpha.*', 'cell.*', 28 | \ 'epsilon', 'ft', 'fu', 'G', 'hTotal', 29 | \ 'IDefault', 'k', 'kl', 'kt', 'mut', 30 | \ 'nu.*', 'omega', 'p', 'p_rgh', 'phi', 31 | \ 'point.*', 'Qr', 'rho', 'S', 'Su', 32 | \ 'Theta.*', 'Tu.*', 'Xi.*'], '|') . ');', 33 | \ 'changeDictionaryDict' : 'changeDictionaryDict', 34 | \ 'thermophysicalProperties' : 'thermophysicalProperties', 35 | \ 'dynamicMeshDict' : 'dynamicMeshDict', 36 | \} 37 | 38 | for line in getline(1, 15) 39 | for [name, re] in items(types) 40 | if line =~# re 41 | return name 42 | endif 43 | endfor 44 | endfor 45 | 46 | return 'general' 47 | endfunction 48 | 49 | " }}}1 50 | -------------------------------------------------------------------------------- /autoload/foam/0/BC.vim: -------------------------------------------------------------------------------- 1 | " Boundary types for incompressible and general condition 2 | let s:boundaryConditionGeneral = [ 3 | \ 'codedMixed', 4 | \ 'convectiveHeatTransfer', 5 | \ 'cyclic', 6 | \ 'mappedPatch', 7 | \ 'cyclicACMI', 8 | \ 'cyclicAMI', 9 | \ 'cyclicSlip', 10 | \ 'directionMixed', 11 | \ 'empty', 12 | \ 'energyJump', 13 | \ 'energyJumpAMI', 14 | \ 'externalCoupled', 15 | \ 'externalCoupledTemperature', 16 | \ 'externalWallHeatFluxTemperature', 17 | \ 'fixedEnergy', 18 | \ 'fixedJumpAMI', 19 | \ 'fixedMean', 20 | \ 'fixedUnburntEnthalpy', 21 | \ 'gradientEnergy', 22 | \ 'gradientUnburntEnthalpy', 23 | \ 'greyDiffusiveRadiation', 24 | \ 'greyDiffusiveRadiationViewFactor', 25 | \ 'mapped', 26 | \ 'mappedField', 27 | \ 'mappedFixedInternalValue', 28 | \ 'mappedFixedPushedInternalValue', 29 | \ 'mixedEnergy', 30 | \ 'mixedUnburntEnthalpy', 31 | \ 'mutLowReWallFunction', 32 | \ 'mutURoughWallFunction', 33 | \ 'mutUSpaldingWallFunction', 34 | \ 'mutUWallFunction', 35 | \ 'mutkRoughWallFunction', 36 | \ 'mutkWallFunction', 37 | \ 'nonuniformTransformCyclic', 38 | \ 'patch', 39 | \ 'phaseHydrostaticPressure', 40 | \ 'prghPressure', 41 | \ 'processor', 42 | \ 'processorCyclic', 43 | \ 'sliced', 44 | \ 'symmetry', 45 | \ 'symmetryPlane', 46 | \ 'totalFlowRateAdvectiveDiffusive', 47 | \ 'uniformFixedGradient', 48 | \ 'uniformInletOutlet', 49 | \ 'uniformJump', 50 | \ 'uniformJumpAMI', 51 | \ 'uniformTotalPressure', 52 | \ 'variableHeightFlowRate', 53 | \ 'wallHeatTransfer', 54 | \ 'waveSurfacePressure', 55 | \ 'wedge', 56 | \ 'wideBandDiffusiveRadiation', 57 | \ 'activeBaffleVelocity', 58 | \ 'activePressureForceBaffleVelocity', 59 | \ 'advective', 60 | \ 'buoyantPressure', 61 | \ 'codedFixedValue', 62 | \ 'cylindricalInletVelocity', 63 | \ 'directMappedField', 64 | \ 'directMappedFixedInternalValue', 65 | \ 'directMappedFixedPushedInternalValue', 66 | \ 'directMappedFixedValue', 67 | \ 'directMappedFlowRate', 68 | \ 'directMappedVelocityFluxFixedValue', 69 | \ 'fan', 70 | \ 'fanPressure', 71 | \ 'fixedGradient', 72 | \ 'fixedFluxPressure', 73 | \ 'fixedInternalValueFvPatchField', 74 | \ 'fixedJump', 75 | \ 'fixedLine', 76 | \ 'fixedNormalSlip', 77 | \ 'fixedPressureCompressibleDensity', 78 | \ 'fixedValue', 79 | \ 'fixedOrientation', 80 | \ 'flowRateInletVelocity', 81 | \ 'fluxCorrectedVelocity', 82 | \ 'freestream', 83 | \ 'freestreamPressure', 84 | \ 'inletOutlet', 85 | \ 'inletOutletTotalTemperature', 86 | \ 'kqRWallFunction', 87 | \ 'mixed', 88 | \ 'movingWallVelocity', 89 | \ 'MarshakRadiation', 90 | \ 'MarshakRadiationFixedTemperature', 91 | \ 'oscillatingFixedValue', 92 | \ 'outletInlet', 93 | \ 'outletMappedUniformInlet', 94 | \ 'partialSlip', 95 | \ 'pressureDirectedInletOutletVelocity', 96 | \ 'pressureDirectedInletVelocity', 97 | \ 'pressureInletOutletVelocity', 98 | \ 'pressureInletUniformVelocity', 99 | \ 'pressureInletVelocity', 100 | \ 'pressureNormalInletOutletVelocity', 101 | \ 'rotatingPressureInletOutletVelocity', 102 | \ 'rotatingTotalPressure', 103 | \ 'rotatingWallVelocity', 104 | \ 'selfContainedDirectMapped', 105 | \ 'skript', 106 | \ 'slip', 107 | \ 'supersonicFreestream', 108 | \ 'surfaceNormalFixedValue', 109 | \ 'swirlFlowRateInletVelocity', 110 | \ 'syringePressure', 111 | \ 'timeVaryingFlowRateInletVelocity', 112 | \ 'timeVaryingMappedFixedValue', 113 | \ 'timeVaryingUniformFixedValue', 114 | \ 'timeVaryingUniformTotalPressure', 115 | \ 'totalPressure', 116 | \ 'totalTemperature', 117 | \ 'translatingWallVelocity', 118 | \ 'tractionDisplacement', 119 | \ 'turbulentHeatFluxTemperature', 120 | \ 'turbulentInlet', 121 | \ 'turbulentIntensityKineticEnergyInlet', 122 | \ 'turbulentMixingLengthDissipationRateInlet', 123 | \ 'turbulentMixingLengthFrequencyInlet', 124 | \ 'uncoupledSixDoFRigidBodyDisplacement', 125 | \ 'uniformDensityHydrostaticPressure', 126 | \ 'uniformFixedValue', 127 | \ 'uniformDensityHydrostaticPressure', 128 | \ 'waveTransmissive', 129 | \ 'groovyBC', 130 | \ 'zeroGradient', 131 | \ 'epsilonWallFunction', 132 | \ 'omegaWallFunction', 133 | \ 'nutkWallFunction', 134 | \ 'timeVaryingTotalPressure', 135 | \ 'basicSymmetry', 136 | \ 'coupled', 137 | \ 'calculated', 138 | \ 'porousBafflePressure', 139 | \ 'linearSpring', 140 | \ 'SRFFreestreamVelocity', 141 | \ 'SRFVelocity', 142 | \ 'compressible::kqRWallFunction', 143 | \ 'fixedNormalInletOutletVelocity', 144 | \ 'interstitialInletVelocity', 145 | \ 'mappedFlowRate', 146 | \ 'mappedVelocityFlux', 147 | \ 'outletPhaseMeanVelocity', 148 | \ 'pressureInletOutletParSlipVelocity', 149 | \ 'variableHeightFlowRateInletVelocity', 150 | \ 'atmBoundaryLayerInletEpsilon', 151 | \ 'nutLowReWallFunction', 152 | \ 'nutTabulatedWallFunction', 153 | \ 'nutURoughWallFunction', 154 | \ 'nutUSpaldingWallFunction', 155 | \ 'nutUWallFunction', 156 | \ 'nutkAtmRoughWallFunction', 157 | \ 'nutkRoughWallFunction', 158 | \ 'alphatJayatillekeWallFunction', 159 | \ 'alphatWallFunction', 160 | \] 161 | 162 | " Boundary conditions for compressible flow 163 | let s:boundaryConditionCompressible = [ 164 | \ 'turbulentTemperatureCoupledBaffleMixed', 165 | \ 'epsilonWallFunction', 166 | \ 'kqRWallFunction', 167 | \ 'omegaWallFunction', 168 | \ 'temperatureThermoBaffle1D', 169 | \ 'temperatureThermoBaffle1D', 170 | \ 'turbulentHeatFluxTemperature', 171 | \ 'turbulentMixingLengthDissipationRateInlet', 172 | \ 'turbulentMixingLengthFrequencyInlet', 173 | \ 'turbulentTemperatureCoupledBaffle', 174 | \ 'alphatJayatillekeWallFunction', 175 | \ 'alphatWallFunction', 176 | \ 'epsilonLowReWallFunction', 177 | \ 'fWallFunction', 178 | \ 'kLowReWallFunction', 179 | \ 'thermalBaffle1D', 180 | \ 'thermalBaffle1D', 181 | \ 'v2WallFunction', 182 | \ 'turbulentTemperatureRadCoupledMixed', 183 | \] 184 | " syn match bCCompressible 185 | " \ "compressible::\{1}\(" . join(s:bCC, '\|') . '\)\{1}' 186 | 187 | let s:vals = [ 188 | \ 'uniform', 189 | \ 'code', 190 | \ 'solidThermo', 191 | \ 'fluidThermo', 192 | \ 'nonuniform', 193 | \ 'constant', 194 | \] 195 | 196 | " Constant keywords on the left side 197 | let s:keys = [ 198 | \ 'type', 199 | \ 'name', 200 | \ 'Tnbr', 201 | \ 'kappa', 202 | \ 'kappaName', 203 | \ 'kappaLayers', 204 | \ 'thicknessLayers', 205 | \ 'value', 206 | \ 'pressure', 207 | \ 'traction', 208 | \ 'inletValue', 209 | \ 'outletValue', 210 | \ 'mixingLength', 211 | \ 'mass', 212 | \ 'velocity', 213 | \ 'direction', 214 | \ 'KName', 215 | \ 'neighbourFieldName', 216 | \ 'intensity', 217 | \ 'flowRate', 218 | \ 'volumetricFlowRate', 219 | \ 'massFlowRate', 220 | \] 221 | 222 | let s:otherEntries = [ 223 | \ 'internalField', 224 | \ 'dimensions', 225 | \ 'boundaryField', 226 | \] 227 | -------------------------------------------------------------------------------- /autoload/foam/0/foamVariables.vim: -------------------------------------------------------------------------------- 1 | let s:ofVariables = [ 2 | \ 'nu', 3 | \ 'nuInf', 4 | \ 'nu0', 5 | \ 'n', 6 | \ 'm', 7 | \ 'sigma', 8 | \ 'U', 9 | \ 'p', 10 | \ 'p_rgh', 11 | \ 'k', 12 | \ 'epsilon', 13 | \ 'alpha1', 14 | \ 'alpha2', 15 | \ 'alpha3', 16 | \ 'omega', 17 | \ 'nut', 18 | \ 'mut', 19 | \ 'mu', 20 | \ 'nuTilda', 21 | \ 'R', 22 | \ 'rho', 23 | \ 'psi', 24 | \ 'gamma', 25 | \ 'phi', 26 | \ 'p0', 27 | \ 'T', 28 | \ 'muEff', 29 | \ 'h', 30 | \ 'phiU', 31 | \ 'alphaEff', 32 | \ 'DkEff', 33 | \ 'DepsilonEff', 34 | \ 'DomegaEff', 35 | \ 'DREff', 36 | \ 'rhoFinal', 37 | \ 'pFinal', 38 | \ 'p_rghFinal', 39 | \ 'Final', 40 | \ 'K', 41 | \ 'TFinal', 42 | \ 'sigmaS', 43 | \ 'emissivity', 44 | \ 'Cp', 45 | \ 'Hf', 46 | \ 'kappa', 47 | \ 'n0', 48 | \ 'Tref', 49 | \ 'C0', 50 | \ 'K0', 51 | \ 'Pr', 52 | \ 'DT', 53 | \ 'phid', 54 | \ 'phirb', 55 | \ 'alpha', 56 | \ 'thermo', 57 | \ 'meshPhi', 58 | \ 'pcorr', 59 | \ 'kFinal', 60 | \ 'epsilonFinal', 61 | \ 'omegaFinal', 62 | \ 'hFinal', 63 | \ 'eFinal', 64 | \ 'nuEff', 65 | \] 66 | -------------------------------------------------------------------------------- /autoload/foam/case.vim: -------------------------------------------------------------------------------- 1 | function! foam#case#get_keys(k1, k2) " {{{1 2 | return keys(get(get(deepcopy(g:foam#case), a:k1, {}), a:k2, {})) 3 | endfunction 4 | 5 | " }}}1 6 | function! foam#case#get_values(k1, k2, k3) " {{{1 7 | return get(get(get(deepcopy(g:foam#case), a:k1, {}), a:k2, {}), a:k3, []) 8 | endfunction 9 | 10 | " }}}1 11 | 12 | 13 | " {{{1 Script local stuff 14 | 15 | let s:bool = ['on', 'off', 'yes', 'no', 'true', 'false'] 16 | 17 | " }}}1 18 | 19 | 20 | let g:foam#case = {} 21 | 22 | " {{{1 system 23 | 24 | let g:foam#case.system = {} 25 | 26 | " {{{2 system/controlDict 27 | " 28 | " Values fetched from this documentation: 29 | " https://cfd.direct/openfoam/user-guide/controlDict/#x18-1370004.3 30 | " 31 | let g:foam#case.system.controlDict = {} 32 | let g:foam#case.system.controlDict.application = [] 33 | let g:foam#case.system.controlDict.startFrom = [ 34 | \ 'firstTime', 35 | \ 'startTime', 36 | \ 'latestTime', 37 | \] 38 | let g:foam#case.system.controlDict.startTime = [] 39 | let g:foam#case.system.controlDict.stopAt = [ 40 | \ 'endTime', 41 | \ 'writeNow', 42 | \ 'noWriteNow', 43 | \ 'nextWrite', 44 | \] 45 | let g:foam#case.system.controlDict.endTime = [] 46 | let g:foam#case.system.controlDict.deltaT = [] 47 | let g:foam#case.system.controlDict.maxDeltaT = [] 48 | let g:foam#case.system.controlDict.writeControl = [ 49 | \ 'timeStep', 50 | \ 'runTime', 51 | \ 'adjustableRunTime', 52 | \ 'cpuTime', 53 | \ 'clockTime', 54 | \] 55 | let g:foam#case.system.controlDict.writeInterval = [] 56 | let g:foam#case.system.controlDict.purgeWrite = [] 57 | let g:foam#case.system.controlDict.writeFormat = [ 58 | \ 'ascii', 59 | \ 'binary', 60 | \] 61 | let g:foam#case.system.controlDict.writePrecision = [] 62 | let g:foam#case.system.controlDict.writeCompression = s:bool 63 | let g:foam#case.system.controlDict.timeFormat = [ 64 | \ 'fixed', 65 | \ 'scientific', 66 | \ 'general', 67 | \] 68 | let g:foam#case.system.controlDict.timePrecision = [] 69 | let g:foam#case.system.controlDict.graphFormat = [ 70 | \ 'raw', 71 | \ 'gnuplot', 72 | \ 'xmgr', 73 | \ 'jplot', 74 | \] 75 | let g:foam#case.system.controlDict.adjustTimeStep = s:bool 76 | let g:foam#case.system.controlDict.maxCo = [] 77 | let g:foam#case.system.controlDict.maxAlphaCo = [] 78 | let g:foam#case.system.controlDict.runTimeModifiable = s:bool 79 | let g:foam#case.system.controlDict.libs = [] 80 | let g:foam#case.system.controlDict.functions = [] 81 | let g:foam#case.system.controlDict.setFormat = [] 82 | 83 | " }}}2 84 | " {{{2 system/fvSchemes 85 | " 86 | " Values fetched from this documentation: 87 | " https://cfd.direct/openfoam/user-guide/fvSchemes/#x19-1410004.4 88 | " 89 | let g:foam#case.system.fvSchemes = {} 90 | let g:foam#case.system.fvSchemes.ddtSchemes = {} 91 | let g:foam#case.system.fvSchemes.ddtSchemes.default = [ 92 | \ 'steadyState', 93 | \ 'Euler', 94 | \ 'backward', 95 | \ 'CrankNicolson', 96 | \ 'localEuler', 97 | \] 98 | 99 | let g:foam#case.system.fvSchemes.d2dt2Schemes = {} 100 | let g:foam#case.system.fvSchemes.d2dt2Schemes.default = [ 101 | \ 'Euler', 102 | \] 103 | 104 | let g:foam#case.system.fvSchemes.gradSchemes = {} 105 | let g:foam#case.system.fvSchemes.gradSchemes.default = [ 106 | \ 'Gauss linear', 107 | \ 'Gauss cubic', 108 | \ 'cellLimited Gauss linear 1', 109 | \ 'leastSquares', 110 | \] 111 | 112 | let g:foam#case.system.fvSchemes.divSchemes = {} 113 | let g:foam#case.system.fvSchemes.divSchemes.default = ['none'] 114 | let g:foam#case.system.fvSchemes.divSchemes.div = [ 115 | \ 'Gauss linear', 116 | \ 'Gauss linearUpwind', 117 | \ 'Gauss LUST', 118 | \ 'Gauss limitedLinear', 119 | \ 'Gauss upwind', 120 | \ 'Gauss vanLeer', 121 | \ 'Gauss multivariateSelection', 122 | \] 123 | 124 | let g:foam#case.system.fvSchemes.snGradSchemes = {} 125 | let g:foam#case.system.fvSchemes.snGradSchemes.default = [ 126 | \ 'corrected', 127 | \ 'limited corrected 0', 128 | \ 'limited corrected 0.33', 129 | \ 'limited corrected 0.5', 130 | \ 'limited corrected 1', 131 | \ 'orthogonal', 132 | \ 'uncorrected', 133 | \] 134 | 135 | let g:foam#case.system.fvSchemes.laplacianSchemes = {} 136 | let g:foam#case.system.fvSchemes.laplacianSchemes.default = [ 137 | \ 'Gauss linear corrected', 138 | \ 'Gauss linear limited corrected 0', 139 | \ 'Gauss linear limited corrected 0.33', 140 | \ 'Gauss linear limited corrected 0.5', 141 | \ 'Gauss linear limited corrected 1', 142 | \ 'Gauss linear orthogonal', 143 | \ 'Gauss linear uncorrected', 144 | \] 145 | 146 | let g:foam#case.system.fvSchemes.interpolationSchemes = {} 147 | let g:foam#case.system.fvSchemes.interpolationSchemes.default = [ 148 | \ 'linear', 149 | \ 'cubic', 150 | \] 151 | 152 | " }}}2 153 | " {{{2 system/fvOptions 154 | " 155 | " Values fetched from this documentation: 156 | " ... 157 | " 158 | 159 | " let s:fvOptions.keys = [ 160 | " \ 'active', 161 | " \ 'field', 162 | " \ 'schemesField', 163 | " \ 'autoSchemes', 164 | " \ 'nCorr', 165 | " \ 'resetOnStartUp', 166 | " \ 'selectionMode', 167 | " \ 'volumeMode', 168 | " \ 'injectionRateSuSp', 169 | " \] 170 | 171 | " let s:fvOptions.dicts = [ 172 | " \ 'functions', 173 | " \ 'injectionRateSuSp', 174 | " \ 'fvOptions', 175 | " \ '\w\+Coeffs' 176 | " \] 177 | 178 | " let s:fvOptions.values = [ 179 | " \ 'scalarTransport', 180 | " \ 'outputTime', 181 | " \ 'scalarSemiImplicitSource', 182 | " \ 'points', 183 | " \ 'specific', 184 | " \ 'absolute', 185 | " \] 186 | 187 | " }}}2 188 | " {{{2 system/fvSolution 189 | " 190 | " Values fetched from this documentation: 191 | " ... 192 | " 193 | 194 | ""- All keywords which are on the left sid 195 | "syntax keyword fvSolKeywordsLS 196 | " \ solver 197 | " \ preconditioner 198 | " \ tolerance 199 | " \ relTol 200 | " \ maxIter 201 | " \ smoother 202 | " \ cacheAgglomeration 203 | " \ nCellsInCoarsestLevel 204 | " \ agglomerator 205 | " \ mergeLevels 206 | " \ smoother 207 | " \ cacheAgglomeration 208 | " \ nCellsInCoarsestLevel 209 | " \ agglomerator 210 | " \ mergeLevels 211 | " \ momentumPredictor 212 | " \ nCorrectors 213 | " \ nNonOrthogonalCorrectors 214 | " \ nAlphaCorr 215 | " \ nAlphaSubCycles 216 | " \ cAlpha 217 | " \ pRefPoint 218 | " \ pRefCell 219 | " \ pRefValue 220 | " \ nPreSweeps 221 | " \ nPostSweeps 222 | " \ nSweeps 223 | " \ rhoMin 224 | " \ rhoMax 225 | " \ pMin 226 | " \ pMax 227 | " \ transonic 228 | " \ nFinestSweeps 229 | " \ turbOnFinalIterOnly 230 | " \ nOuterCorrectors 231 | " \ correctPhi 232 | 233 | ""- Solvers and preconditioner which can be used in FOAM 234 | "syntax keyword fvSolSolver 235 | " \ PCG 236 | " \ DIC 237 | " \ GAMG 238 | " \ GaussSeidel 239 | " \ dummy 240 | " \ faceAreaPair 241 | " \ DILU 242 | " \ PBiCG 243 | " \ smoothSolver 244 | " \ DICGaussSeidel 245 | " \ diagonal 246 | " \ PBiCCCG 247 | " \ PBiCICG 248 | " \ ICCG 249 | " \ FDIC 250 | " \ nonBlockingGaussSeidel 251 | " \ symGaussSeidel 252 | 253 | ""- Dictionarys in fvSolution file 254 | "syntax keyword fvSolDict 255 | " \ SIMPLE 256 | " \ PISO 257 | " \ PIMPLE 258 | " \ potentialFlow 259 | " \ relaxationFactors 260 | " \ solvers 261 | " \ cache 262 | " \ residualControl 263 | " \ convergence 264 | " \ equations 265 | " \ fields 266 | 267 | " }}}2 268 | " {{{2 system/decomposePar 269 | " 270 | " Values fetched from this documentation: 271 | " ... 272 | " 273 | 274 | ""- Dictionary (coefficents) of method 275 | "syntax keyword decomposeCoeffs 276 | " \ simpleCoeffs 277 | " \ hierarchicalCoeffs 278 | " \ manualCoeffs 279 | " \ structuredCoeffs 280 | " \ scotchCoeffs 281 | " \ multiLevelCoeffs 282 | " \ metisCoeffs 283 | " \ patches 284 | 285 | ""- Methods which can be used 286 | "syntax keyword decomposeMet 287 | " \ ptScotch 288 | " \ scotch 289 | " \ hierarchical 290 | " \ simple 291 | " \ metis 292 | " \ processorWeights 293 | " \ structured 294 | " \ manual 295 | " \ dsmcRhoNMean 296 | " \ multiLevel 297 | 298 | " }}}2 299 | " {{{2 system/snappyHexMeshDict 300 | " 301 | " Values fetched from this documentation: 302 | " ... 303 | " 304 | 305 | ""- keywords used on the left side 306 | "syntax keyword sHMKeyword 307 | " \ inGroups 308 | " \ file 309 | " \ refinementRegions 310 | " \ refinementSurfaces 311 | " \ maxLocalCells 312 | " \ maxGlobalCells 313 | " \ minRefinementCells 314 | " \ nCellsBetweenLevels 315 | " \ planarAngle 316 | " \ locationInMesh 317 | " \ allowFreeStandingZoneFaces 318 | " \ nSmoothPatch 319 | " \ tolerance 320 | " \ nSolveIter 321 | " \ nRelaxIter 322 | " \ nFeatureSnapIter 323 | " \ expansionRatio 324 | " \ finalLayerThickness 325 | " \ minThickness 326 | " \ nGrow 327 | " \ featureAngle 328 | " \ nRelaxIter 329 | " \ nSmoothSurfaceNormals 330 | " \ features 331 | " \ resolveFeatureAngle 332 | " \ relativeSize 333 | " \ relativeSizes 334 | " \ nSmoothNormals 335 | " \ nSmoothThickness 336 | " \ maxFaceThicknessRatio 337 | " \ maxThicknessToMedialRatio 338 | " \ minMedianAxisAngle 339 | " \ nBufferCellsNoExtrude 340 | " \ nLayerIter 341 | " \ nRelaxedIter 342 | " \ maxNonOrtho 343 | " \ maxBoundarySkewness 344 | " \ maxInternalSkewness 345 | " \ maxConcave 346 | " \ minVol 347 | " \ minTetQuality 348 | " \ minArea 349 | " \ minTwist 350 | " \ minDeterminant 351 | " \ minFaceWeight 352 | " \ minVolRatio 353 | " \ minTriangleTwist 354 | " \ nSmoothScale 355 | " \ errorReduction 356 | " \ debug 357 | " \ mergeTolerance 358 | " \ maxLoadUnbalance 359 | " \ mode 360 | " \ type 361 | " \ min 362 | " \ max 363 | " \ level 364 | " \ levels 365 | " \ nSurfaceLayers 366 | " \ radius 367 | " \ POV 368 | " \ centre 369 | " \ name 370 | " \ faceZone 371 | " \ cellZone 372 | " \ cellZoneInside 373 | " \ implicitFeatureSnap 374 | " \ explicitFeatureSnap 375 | " \ multiRegionFeatureSnap 376 | " \ handleSnapProblems 377 | " \ useTopologicalSnapDetection 378 | " \ gapLevelIncrement 379 | " \ faceType 380 | " \ detectNearSurfacesSnap 381 | " \ firstLayerThickness 382 | " \ thickness 383 | " \ minMedialAxisAngle 384 | " \ nMedialAxisIter 385 | " \ nSmoothDisplacement 386 | " \ detectExtrusionIsland 387 | " \ slipFeatureAngle 388 | " \ additionalReporting 389 | " \ maxTreeDepth 390 | " \ minVolCollapseRatio 391 | 392 | ""- Keywords used in snappyHexMesh (right side) 393 | "syntax keyword sHMType 394 | " \ file 395 | " \ inside 396 | " \ outside 397 | " \ distance 398 | " \ closedTriSurfaceMesh 399 | " \ distributedTriSurfaceMesh 400 | " \ searchableBox 401 | " \ searchableCylinder 402 | " \ searchablePlane 403 | " \ searchablePlate 404 | " \ searchableSphere 405 | " \ searchableSurfaceCollection 406 | " \ searchableSurfaceWithGaps 407 | " \ triSurfaceMesh 408 | " \ patchInfo 409 | " \ point1 410 | " \ point2 411 | " \ insidePoint 412 | " \ layerSets 413 | " \ layerFields 414 | " \ layerInfo 415 | " \ mesh 416 | " \ intersections 417 | " \ featureSeeds 418 | " \ attraction 419 | " \ scalarLevels 420 | " \ searchableDisk 421 | " \ internal 422 | " \ boundary 423 | " \ baffle 424 | " \ patch 425 | " \ wall 426 | " \ mappedWall 427 | " \ cyclic 428 | " \ symmetryPlane 429 | " \ slip 430 | " \ empty 431 | " \ wedge 432 | "highlight link sHMType foam256_sHMKeyOnRS 433 | 434 | ""- Dictionary used in snappyHexMesh 435 | "syntax keyword sHMDict 436 | " \ castellatedMesh 437 | " \ snap 438 | " \ addLayers 439 | " \ addLayersControls 440 | " \ castellatedMeshControls 441 | " \ snapControls 442 | " \ meshQualityControls 443 | " \ relaxed 444 | " \ region 445 | " \ layers 446 | " \ features 447 | " \ refinementSurfaces 448 | " \ refinementRegions 449 | " \ geometry 450 | " \ debugFlags 451 | " \ writeFlags 452 | 453 | 454 | " }}}2 455 | " {{{2 system/setFieldsDict 456 | " 457 | " Values fetched from this documentation: 458 | " https://cfd.direct/openfoam/user-guide/damBreak/#x7-520002.3 459 | " 460 | let g:foam#case.system.setFieldsDict = {} 461 | let g:foam#case.system.setFieldsDict.defaultFieldValues = {} 462 | 463 | " Special values 464 | " - volScalarFieldValue 465 | " - volVectorFieldValue 466 | " - box 467 | 468 | " Subdicts 469 | " - defaultFieldValues 470 | " - fieldValues 471 | " - boxToCell 472 | " - regions 473 | " - boundaryToFace 474 | " - boxToCell 475 | " - boxToFace 476 | " - boxToPoint 477 | " - cellToCell 478 | " - cellToFace 479 | " - cellToPoint 480 | " - cylinderAnnulusToCell 481 | " - cylinderToCell 482 | " - faceToCell 483 | " - faceToFace 484 | " - faceToPoint 485 | " - faceZoneToCell 486 | " - faceZoneToFaceZone 487 | " - fieldToCell 488 | " - labelToCell 489 | " - labelToFace 490 | " - labelToPoint 491 | " - nbrToCell 492 | " - nearestToCell 493 | " - nearestToPoint 494 | " - normalToFace 495 | " - patchToFace 496 | " - pointToCell 497 | " - pointToFace 498 | " - pointToPoint 499 | " - regionToCell 500 | " - regionToFace 501 | " - rotatedBoxToCell 502 | " - setToCellZone 503 | " - setToFaceZone 504 | " - setToPointZone 505 | " - setsToFaceZone 506 | " - shapeToCell 507 | " - sphereToCell 508 | " - surfaceToCell 509 | " - surfaceToPoint 510 | " - targetVolumeToCell 511 | " - zoneToCell 512 | " - zoneToFace 513 | " - zoneToPoint 514 | 515 | " }}}2 516 | -------------------------------------------------------------------------------- /autoload/foam/complete.vim: -------------------------------------------------------------------------------- 1 | function! foam#complete#omnifunc(findstart, base) " {{{1 2 | if a:findstart 3 | if exists('s:completer') | unlet s:completer | endif 4 | 5 | let l:pos = col('.') - 1 6 | let l:line = getline('.')[:l:pos-1] 7 | for l:completer in s:completers 8 | if !get(l:completer, 'enabled', 1) | continue | endif 9 | 10 | for l:pattern in l:completer.patterns 11 | if l:line =~# l:pattern 12 | let s:completer = l:completer 13 | return s:completer.context(l:line, l:pos) 14 | endif 15 | endfor 16 | endfor 17 | return -3 18 | else 19 | if !exists('s:completer') | return [] | endif 20 | 21 | return s:completer.complete(a:base) 22 | endif 23 | endfunction 24 | 25 | " }}}1 26 | 27 | 28 | let s:completer_key = { 29 | \ 'patterns' : [ 30 | \ '^\w*$', 31 | \ ], 32 | \} 33 | function! s:completer_key.context(line, pos) dict abort " {{{1 34 | return 0 35 | endfunction 36 | 37 | function! s:completer_key.complete(regex) dict abort " {{{1 38 | return filter(self.gather_candidates(), 'v:val.word =~? ''^'' . a:regex') 39 | endfunction 40 | 41 | function! s:completer_key.gather_candidates() dict abort " {{{1 42 | let [l:folder, l:file] = split(expand('%:p'), '/')[-2:] 43 | 44 | return map(foam#case#get_keys(folder, file), '{ 45 | \ ''word'' : v:val, 46 | \ ''abbr'' : v:val, 47 | \ ''menu'' : '' [key]'', 48 | \}') 49 | endfunction 50 | 51 | " }}}1 52 | 53 | let s:completer_keyval = { 54 | \ 'patterns' : [ 55 | \ '^\w\+\s\+\w*$', 56 | \ ], 57 | \} 58 | function! s:completer_keyval.context(line, pos) dict abort " {{{1 59 | let l:words = split(a:line) 60 | let self.key = l:words[0] 61 | 62 | return strlen(matchstr(a:line, '^\w*\s*')) 63 | endfunction 64 | 65 | function! s:completer_keyval.complete(regex) dict abort " {{{1 66 | return filter(self.gather_candidates(), 'v:val.word =~? ''^'' . a:regex') 67 | endfunction 68 | 69 | function! s:completer_keyval.gather_candidates() dict abort " {{{1 70 | let [l:folder, l:file] = split(expand('%:p'), '/')[-2:] 71 | 72 | return map(foam#case#get_values(folder, file, self.key), '{ 73 | \ ''word'' : v:val, 74 | \ ''abbr'' : v:val, 75 | \ ''menu'' : '' [keyval]'', 76 | \}') 77 | endfunction 78 | 79 | " }}}1 80 | 81 | 82 | " {{{1 Initialize module 83 | 84 | let s:completers = map( 85 | \ filter(items(s:), 'v:val[0] =~# ''^completer_'''), 86 | \ 'v:val[1]') 87 | 88 | let g:foam#complete#re_refresh_ncm = [ 89 | \ '^[A-Za-z]+\s+[A-Za-z]*', 90 | \ '^[A-Za-z]*', 91 | \] 92 | 93 | let g:foam#complete#re_refresh_deoplete = g:foam#complete#re_refresh_ncm 94 | 95 | " }}}1 96 | -------------------------------------------------------------------------------- /autoload/foam/constant/RASProperties.vim: -------------------------------------------------------------------------------- 1 | "- Special keywords 2 | syn keyword RASPropertiesSpecial 3 | \ printCoeffs 4 | \ turbulence 5 | highlight link RASPropertiesSpecial foam256_keyOnLeftSide 6 | 7 | "- Modeltyp keyword 8 | syn match PropertiesModelKey 9 | \ "RAS" 10 | highlight link PropertiesModelKey foam256_RASPropKey 11 | 12 | "- Modeltyp keyword 13 | syn match PropertiesModelKey 14 | \ "laminar" 15 | highlight link PropertiesModelKey foam256_RASPropKey 16 | 17 | "- Modeltyp keyword 18 | syn match PropertiesModelKey 19 | \ "LES" 20 | highlight link PropertiesModelKey foam256_RASPropKey 21 | 22 | "- RASModels which are available 23 | syn keyword PropertiesModels 24 | \ v2f 25 | \ realizableKE 26 | \ kkLOmega 27 | \ NonlinearKEShih 28 | \ LaunderSharmaKE 29 | \ LaunderGibsonRSTM 30 | \ LamBremhorstKE 31 | \ kOmega 32 | \ kOmegaSST 33 | \ kEpsilon 34 | \ qZeta 35 | \ realizeableKE 36 | \ SpalartAllmaras 37 | \ RNGkEpsilon 38 | \ NonelinearKEShih 39 | \ LRR 40 | \ LamBremhorsteKE 41 | \ LounderGibsonRSTM 42 | \ LounderSharmaKE 43 | \ LienCubicKE 44 | \ LienCubicKELowRe 45 | \ LienLeschzinerLowRe 46 | highlight link PropertiesModels foam256_RASModels 47 | -------------------------------------------------------------------------------- /autoload/foam/constant/dynamicMeshDict.vim: -------------------------------------------------------------------------------- 1 | "- Constant words 2 | syn keyword dynamicFvMesh 3 | \ dynamicFvMesh 4 | \ motionSolverLibs 5 | \ solver 6 | \ sixDoFRigidBodyMotionCoeffs 7 | \ dynamicInkJetFvMeshCoeffs 8 | \ dynamicMotionSolverFvMeshCoeffs 9 | \ dynamicRefineFvMeshCoeffs 10 | \ movingConeTopoFvMeshCoeffs 11 | \ multiSolidBodyMotionFvMeshCoeffs 12 | \ rawTopoChangerFvMeshCoeffs 13 | \ solidBodyMotionFvMeshCoeffs 14 | \ staticFvMeshCoeffs 15 | \ patches 16 | \ innerDistance 17 | \ outerDistance 18 | \ rhoInf 19 | \ mass 20 | \ momentOfInertia 21 | \ centreOfMass 22 | \ orientation 23 | \ velocity 24 | \ acceleration 25 | \ angularMomentum 26 | \ torque 27 | \ report 28 | \ accelerationRelaxation 29 | \ accelerationDumping 30 | \ type 31 | \ g 32 | \ constraints 33 | \ restraints 34 | \ sixDoFRigidBodyMotionConstraint 35 | \ sixDoFRigidBodyMotionRestraint 36 | 37 | "- DynamicFvMesh 38 | syn keyword dynamicFvMeshSolver 39 | \ dynamicMotionSolverFvMesh 40 | \ dynamicInkJetFvMesh 41 | \ dynamicMotionSolverFvMesh 42 | \ dynamicRefineFvMesh 43 | \ movingConeTopoFvMesh 44 | \ multiSolidBodyMotionFvMesh 45 | \ rawTopoChangerFvMesh 46 | \ solidBodyMotionFvMesh 47 | \ staticFvMesh 48 | \ Newmark 49 | \ Crank-Nicolsen 50 | 51 | "- Solvers that can be used 52 | syn keyword dynamicFvMeshSolver 53 | \ sixDoFRigidBodyMotion 54 | \ dynamicInkJetFvMesh 55 | \ dynamicMotionSolverFvMesh 56 | \ dynamicRefineFvMesh 57 | \ movingConeTopoFvMesh 58 | \ multiSolidBodyMotionFvMesh 59 | \ rawTopoChangerFvMesh 60 | \ solidBodyMotionFvMesh 61 | \ staticFvMesh 62 | \ axis 63 | \ point 64 | \ sphericalAngularDamper 65 | \ linearDamper 66 | \ coeff 67 | 68 | "- Dictionary 69 | syn keyword solverCoeffs 70 | \ twoPhase 71 | \ phase1 72 | \ phase2 73 | \ CrossPowerLawCoeffs 74 | \ BirdCarreauCoeffs 75 | -------------------------------------------------------------------------------- /autoload/foam/constant/polyMesh/blockMeshDict.vim: -------------------------------------------------------------------------------- 1 | syn keyword blockMeshDictDict 2 | \ vertices 3 | \ blocks 4 | \ edges 5 | \ boundary 6 | \ mergePatchPairs 7 | 8 | syn keyword blockMeshDictKeywords 9 | \ convertToMeters 10 | \ hex 11 | \ simpleGrading 12 | \ faces 13 | -------------------------------------------------------------------------------- /autoload/foam/constant/polyMesh/boundary.vim: -------------------------------------------------------------------------------- 1 | "- Boundary types 2 | syn keyword blockMeshDictTypes 3 | \ patch 4 | \ wall 5 | \ symmetryPlane 6 | \ symmetry 7 | \ empty 8 | \ slip 9 | \ cyclic 10 | \ mappedWall 11 | \ cyclicAMI 12 | \ cyclicACMI 13 | \ noOrdering 14 | \ coincidentFullMatch 15 | \ rotational 16 | \ translational 17 | \ unknown 18 | 19 | syn keyword blockMeshDictKeys 20 | \ inGroups 21 | \ type 22 | \ arc 23 | \ nFaces 24 | \ startFace 25 | \ offsetMode 26 | \ sampleMode 27 | \ sampleRegion 28 | \ samplePatch 29 | \ offset 30 | \ matchTolerance 31 | \ transform 32 | \ neighbourPatch 33 | 34 | syn keyword blockMeshDictSpecialKeys 35 | \ nearestPatchFace 36 | \ nearestCell 37 | \ nearestFace 38 | \ nearestPatchFaceAMI 39 | \ nearestPatchPoint 40 | \ noOrdering 41 | \ coincidentFullMatch 42 | \ rotational 43 | \ translational 44 | \ unknown 45 | -------------------------------------------------------------------------------- /autoload/foam/constant/radiationProperties.vim: -------------------------------------------------------------------------------- 1 | "- Keywords in radiation properties 2 | syn match radiationFixedKeywords 3 | \ "^radiationModel 4 | \ \|^radiation" 5 | hi link radiationFixedKeywords foam256_keyOnLeftSide 6 | 7 | "- Keywords in radiation properties 8 | syn keyword radiationKeywords 9 | \ solverFreq 10 | \ absorptionEmissionModel 11 | \ scatterModel 12 | \ sootModel 13 | \ model1 14 | hi link radiationKeywords foam256_keyOnLeftSide 15 | 16 | "- 17 | syn keyword radiationSpecialKey 18 | \ noRadiation 19 | \ smoothing 20 | \ constantEmissivity 21 | hi link radiationSpecialKey foam256_specialEntry 22 | 23 | "- Radiation and absorption models 24 | syn keyword radModels 25 | \ P1 26 | \ P1 27 | \ fvDOM 28 | \ opaqueSolid 29 | \ viewFactor 30 | \ constantAbsorptionEmission 31 | \ binaryAbsorptionEmission 32 | \ greyMeanAbsorptionEmission 33 | \ greyMeanSolidAbsorptionEmission 34 | \ wideBandAbsorptionEmission 35 | hi link radModels foam256_keyOnRightSide 36 | 37 | "- Radiation models coefficient dictionary 38 | syn keyword radModelsCoeffDict 39 | \ constantAbsorptionEmissionCoeffs 40 | \ binaryAbsorptionEmissionCoeffs 41 | \ greyMeanAbsorptionEmissionCoeffs 42 | \ greyMeanSolidAbsorptionEmissionCoeffs 43 | \ wideBandAbsorptionEmissionCoeffs 44 | \ fvDOMCoeffs 45 | \ viewFactorCoeffs 46 | hi link radModelsCoeffDict foam256_dictionary 47 | -------------------------------------------------------------------------------- /autoload/foam/constant/regionProperties.vim: -------------------------------------------------------------------------------- 1 | syn match regionPropertiesDict 2 | \ "fluid\{1} \{1} 3 | \ \|solid\{1} \{1}" 4 | hi link regionPropertiesDict foam256_keyOnLeftSide 5 | -------------------------------------------------------------------------------- /autoload/foam/constant/thermodynamicProperties.vim: -------------------------------------------------------------------------------- 1 | "- Special behavior of specie mixture 2 | syn match thermodynamicSpecie2 3 | \ " \=specie\{1} \= 4 | \\| \=mixture\{1} \=" 5 | hi link thermodynamicSpecie2 foam256_keyOnLeftSide 6 | 7 | "- Special behavior of specie at the end 8 | syn match thermodynamicSpecie1 9 | \ " \{1}specie\{1};\{1}" 10 | hi link thermodynamicSpecie1 foam256_keyOnRightSide 11 | 12 | "- Dictionarys (main) 13 | syn match thermodynamicDict 14 | \ "^thermoType 15 | \\|^mixture" 16 | hi link thermodynamicDict foam256_dictionary 17 | 18 | "- Special keywords on the left side 19 | syn keyword thermodynamicKeys 20 | \ thermo 21 | \ equationOfState 22 | \ energy 23 | \ thermodynamics 24 | \ transport 25 | hi link thermodynamicKeys foam256_keyOnLeftSide 26 | 27 | "- Thermodynamic models etc. 28 | syn keyword thermodynamicSettings 29 | \ nMoles 30 | \ molWeight 31 | \ Tlow 32 | \ Tcommon 33 | \ Thigh 34 | \ highCpCoeffs 35 | \ lowCpCoeffs 36 | \ CpCoeffs 37 | \ muCoeffs 38 | \ kappaCoeffs 39 | \ rhoCoeffs 40 | \ psiThermo 41 | \ hePsiThermo 42 | \ pureMixture 43 | \ hConst 44 | \ heRhoThermo 45 | \ heSolidThermo 46 | \ constIso 47 | \ constAnIso 48 | \ exponential 49 | \ hExponential 50 | \ rhoConst 51 | \ rhoThermo 52 | \ perfectGas 53 | \ perfectFluid 54 | \ sensibleEnthalpy 55 | \ absolutEnthalpy 56 | \ sensibleInternalEnergy 57 | \ absolutInternalEnergy 58 | \ sutherland 59 | \ icoPolynomial 60 | \ hIcoPolynomial 61 | \ polynomial 62 | \ hPolynomial 63 | \ reactingMixture 64 | \ homogeneousMixture 65 | \ inhomogeneousMixture 66 | \ multiComponentMixture 67 | \ singleStepReactionMixture 68 | \ veryInhomogeneousMixture 69 | \ egrMixture 70 | \ janaf 71 | \ const 72 | hi link thermodynamicSettings foam256_keyOnRightSide 73 | -------------------------------------------------------------------------------- /autoload/foam/constant/transportProperties.vim: -------------------------------------------------------------------------------- 1 | "- Main keyword 2 | syn keyword transportKeyword 3 | \ transportModel 4 | \ phases 5 | hi link transportKeyword foam256_keyOnLeftSide 6 | 7 | "- Models which can be used 8 | syn keyword transportModels 9 | \ Newtonian 10 | \ BirdCarreau 11 | \ CrossPowerLaw 12 | \ powerLaw 13 | \ HerschelBulkley 14 | hi link transportModels foam256_tranportModels 15 | 16 | "- Dictionary 17 | syn keyword transportDict 18 | \ twoPhase 19 | \ phase1 20 | \ phase2 21 | \ CrossPowerLawCoeffs 22 | \ BirdCarreauCoeffs 23 | hi link transportDict foam256_dictionary 24 | -------------------------------------------------------------------------------- /autoload/foam/constant/turbulenceProperties.vim: -------------------------------------------------------------------------------- 1 | syn keyword turbProperties 2 | \ simulationType 3 | highlight link turbProperties foam256_turbPropKey 4 | 5 | syn match turbModel 6 | \ " RASModel 7 | \\| LESModel 8 | \\| laminar" 9 | highlight link turbModel foam256_turbPropModel 10 | -------------------------------------------------------------------------------- /ftdetect/foam.vim: -------------------------------------------------------------------------------- 1 | augroup ftdetect 2 | autocmd! BufRead * call foam#ftdetect() 3 | augroup END 4 | -------------------------------------------------------------------------------- /ftplugin/foam.vim: -------------------------------------------------------------------------------- 1 | if exists('b:foam') 2 | finish 3 | endif 4 | 5 | call foam#init() 6 | -------------------------------------------------------------------------------- /syntax/foam.vim: -------------------------------------------------------------------------------- 1 | if exists('b:current_syntax') 2 | finish 3 | endif 4 | 5 | syntax region foamCommentLine start=/\/\// end=/\n/ 6 | syntax region foamCommentBlock start=/\/\*/ end=/\*\// 7 | 8 | syntax region foamHeader start=/FoamFile/ end=/\}/ 9 | \ contains=foamHeaderField 10 | syntax match foamHeaderFieldKey '^\s\+\w\+' 11 | \ containedin=foamHeader 12 | \ nextgroup=foamHeaderFieldValue 13 | syntax match foamHeaderFieldValue '\s\+\w\+' 14 | \ contained 15 | \ contains=foamNumber 16 | 17 | syntax match foamNumber 18 | \ "-\=[0-9]\+\.\=[0-9]*-\=[eE]\=-\=[0-9]*\.\=[0-9]*" 19 | 20 | syntax match foamOperators 21 | \ "+\|\*\|:\|,\|<\|>\|&\||\|!\|\~\|%\|=\|\.\|\[\|\]\|\"" 22 | 23 | syntax keyword foamBools 24 | \ true 25 | \ false 26 | \ TRUE 27 | \ FALSE 28 | \ yes 29 | \ no 30 | \ YES 31 | \ NO 32 | \ none 33 | \ NONE 34 | \ on 35 | \ off 36 | \ ON 37 | \ OFF 38 | 39 | syntax keyword foamVariables 40 | \ nu 41 | \ nuInf 42 | \ nPhi 43 | \ n 44 | \ m 45 | \ nTheta 46 | \ Sf 47 | \ S 48 | \ nu0 49 | \ sigma 50 | \ E 51 | \ U 52 | \ p 53 | \ p_rgh 54 | \ k 55 | \ epsilon 56 | \ alpha 57 | \ beta 58 | \ omega 59 | \ nut 60 | \ mut 61 | \ mu 62 | \ nuTilda 63 | \ R 64 | \ rho 65 | \ rhok 66 | \ psi 67 | \ gamma 68 | \ phi 69 | \ p0 70 | \ T 71 | \ h 72 | \ phiU 73 | \ K 74 | \ sigmaS 75 | \ emissivity 76 | \ absorptivity 77 | \ Cp 78 | \ Hf 79 | \ kappa 80 | \ n0 81 | \ TRef 82 | \ C0 83 | \ K0 84 | \ Pr 85 | \ Prt 86 | \ DT 87 | \ phid 88 | \ phirb 89 | \ alpha 90 | \ thermo 91 | \ meshPhi 92 | \ pcorr 93 | \ b 94 | \ Su 95 | \ Xi 96 | \ ha 97 | \ hau 98 | \ Final 99 | \ Eff 100 | 101 | syntax match foamVariables "[a-zA-Z\.]\+\(Final\|Eff\)\{1}" 102 | 103 | syntax match foamUserDefVar "\$\{1}[A-Za-z0-9\-\_]\+" 104 | 105 | syntax match foamIncluded "\#include\{1}\ \{1}" 106 | syntax match foamIncludeFile 107 | \ "\"\{1}[A-Za-z]\+[A-Za-z0-9\_\-\/\.]*\"\{1}" 108 | 109 | " {{{1 Default highlighting 110 | 111 | highlight link foamCommentLine Comment 112 | highlight link foamCommentBlock Comment 113 | highlight link foamHeader Title 114 | highlight link foamNumber Number 115 | highlight link foamOperators Operator 116 | highlight link foamBools Boolean 117 | highlight link foamUserDefVar ModeMsg 118 | highlight link foamInclude Include 119 | highlight link foamIncludeFile Include 120 | highlight link foamVariables Type 121 | highlight link foamHeaderFieldKey Type 122 | highlight link foamHeaderFieldValue Identifier 123 | 124 | " }}}1 125 | 126 | let b:current_syntax = 'foam' 127 | -------------------------------------------------------------------------------- /test/example/0/T.orig: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 5 | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class volScalarField; 13 | object T; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | dimensions [0 0 0 1 0 0 0]; 18 | 19 | internalField uniform 300; 20 | 21 | boundaryField 22 | { 23 | floor 24 | { 25 | type fixedValue; 26 | value uniform 350; 27 | } 28 | ceiling 29 | { 30 | type fixedValue; 31 | value uniform 300; 32 | } 33 | fixedWalls 34 | { 35 | type zeroGradient; 36 | } 37 | } 38 | 39 | // ************************************************************************* // 40 | -------------------------------------------------------------------------------- /test/example/0/U: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 5 | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class volVectorField; 13 | object U; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | dimensions [0 1 -1 0 0 0 0]; 18 | 19 | internalField uniform (0 0 0); 20 | 21 | boundaryField 22 | { 23 | floor 24 | { 25 | type noSlip; 26 | } 27 | 28 | ceiling 29 | { 30 | type noSlip; 31 | } 32 | 33 | fixedWalls 34 | { 35 | type noSlip; 36 | } 37 | } 38 | 39 | // ************************************************************************* // 40 | -------------------------------------------------------------------------------- /test/example/0/alphat: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 5 | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class volScalarField; 13 | location "0"; 14 | object alphat; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | dimensions [0 2 -1 0 0 0 0]; 19 | 20 | internalField uniform 0; 21 | 22 | boundaryField 23 | { 24 | floor 25 | { 26 | type alphatJayatillekeWallFunction; 27 | Prt 0.85; 28 | value uniform 0; 29 | } 30 | ceiling 31 | { 32 | type alphatJayatillekeWallFunction; 33 | Prt 0.85; 34 | value uniform 0; 35 | } 36 | fixedWalls 37 | { 38 | type alphatJayatillekeWallFunction; 39 | Prt 0.85; 40 | value uniform 0; 41 | } 42 | } 43 | 44 | 45 | // ************************************************************************* // 46 | -------------------------------------------------------------------------------- /test/example/0/epsilon: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 5 | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class volScalarField; 13 | location "0"; 14 | object epsilon; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | dimensions [0 2 -3 0 0 0 0]; 19 | 20 | internalField uniform 0.01; 21 | 22 | boundaryField 23 | { 24 | floor 25 | { 26 | type epsilonWallFunction; 27 | value uniform 0.01; 28 | } 29 | ceiling 30 | { 31 | type epsilonWallFunction; 32 | value uniform 0.01; 33 | } 34 | fixedWalls 35 | { 36 | type epsilonWallFunction; 37 | value uniform 0.01; 38 | } 39 | } 40 | 41 | 42 | // ************************************************************************* // 43 | -------------------------------------------------------------------------------- /test/example/0/k: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 5 | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class volScalarField; 13 | location "0"; 14 | object k; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | dimensions [0 2 -2 0 0 0 0]; 19 | 20 | internalField uniform 0.1; 21 | 22 | boundaryField 23 | { 24 | floor 25 | { 26 | type kqRWallFunction; 27 | value uniform 0.1; 28 | } 29 | ceiling 30 | { 31 | type kqRWallFunction; 32 | value uniform 0.1; 33 | } 34 | fixedWalls 35 | { 36 | type kqRWallFunction; 37 | value uniform 0.1; 38 | } 39 | } 40 | 41 | 42 | // ************************************************************************* // 43 | -------------------------------------------------------------------------------- /test/example/0/nut: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 5 | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class volScalarField; 13 | location "0"; 14 | object nut; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | dimensions [0 2 -1 0 0 0 0]; 19 | 20 | internalField uniform 0; 21 | 22 | boundaryField 23 | { 24 | floor 25 | { 26 | type nutkWallFunction; 27 | value uniform 0; 28 | } 29 | ceiling 30 | { 31 | type nutkWallFunction; 32 | value uniform 0; 33 | } 34 | fixedWalls 35 | { 36 | type nutkWallFunction; 37 | value uniform 0; 38 | } 39 | } 40 | 41 | 42 | // ************************************************************************* // 43 | -------------------------------------------------------------------------------- /test/example/0/p: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 5 | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class volScalarField; 13 | object p; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | dimensions [0 2 -2 0 0 0 0]; 18 | 19 | internalField uniform 0; 20 | 21 | boundaryField 22 | { 23 | floor 24 | { 25 | type calculated; 26 | value $internalField; 27 | } 28 | 29 | ceiling 30 | { 31 | type calculated; 32 | value $internalField; 33 | } 34 | 35 | fixedWalls 36 | { 37 | type calculated; 38 | value $internalField; 39 | } 40 | } 41 | 42 | // ************************************************************************* // 43 | -------------------------------------------------------------------------------- /test/example/0/p_rgh: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 5 | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class volScalarField; 13 | object p_rgh; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | dimensions [0 2 -2 0 0 0 0]; 18 | 19 | internalField uniform 0; 20 | 21 | boundaryField 22 | { 23 | floor 24 | { 25 | type fixedFluxPressure; 26 | rho rhok; 27 | value uniform 0; 28 | } 29 | 30 | ceiling 31 | { 32 | type fixedFluxPressure; 33 | rho rhok; 34 | value uniform 0; 35 | } 36 | 37 | fixedWalls 38 | { 39 | type fixedFluxPressure; 40 | rho rhok; 41 | value uniform 0; 42 | } 43 | } 44 | 45 | // ************************************************************************* // 46 | -------------------------------------------------------------------------------- /test/example/constant/g: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 5 | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class uniformDimensionedVectorField; 13 | location "constant"; 14 | object g; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | dimensions [0 1 -2 0 0 0 0]; 19 | value (0 -9.81 0); 20 | 21 | 22 | // ************************************************************************* // 23 | -------------------------------------------------------------------------------- /test/example/constant/transportProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 5 | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | object transportProperties; 14 | } 15 | 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | transportModel Newtonian; 19 | 20 | // Laminar viscosity 21 | nu [0 2 -1 0 0 0 0] 4.3e-05; 22 | 23 | // Thermal expansion coefficient 24 | beta [0 0 0 -1 0 0 0] 7.3e-04; 25 | 26 | // Reference temperature 27 | TRef [0 0 0 1 0 0 0] 300; 28 | 29 | // Laminar Prandtl number 30 | Pr [0 0 0 0 0 0 0] 537.5; 31 | 32 | // Turbulent Prandtl number 33 | Prt [0 0 0 0 0 0 0] 537.5; 34 | 35 | // ************************************************************************* // 36 | -------------------------------------------------------------------------------- /test/example/constant/turbulenceProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 5 | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | location "constant"; 14 | object turbulenceProperties; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | simulationType RAS; 19 | 20 | RAS 21 | { 22 | RASModel kEpsilon; 23 | 24 | turbulence off; 25 | 26 | printCoeffs on; 27 | } 28 | 29 | 30 | // ************************************************************************* // 31 | -------------------------------------------------------------------------------- /test/example/minivimrc: -------------------------------------------------------------------------------- 1 | set nocompatible 2 | let &runtimepath = '~/.vim/bundle/vim-foam,' . &runtimepath 3 | filetype plugin indent on 4 | syntax enable 5 | 6 | nnoremap q :qall! 7 | -------------------------------------------------------------------------------- /test/example/system/blockMeshDict: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 5 | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | object blockMeshDict; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | convertToMeters 0.1; 18 | 19 | vertices 20 | ( 21 | (0 0 0) 22 | (10 0 0) 23 | (10 5 0) 24 | (0 5 0) 25 | (0 0 10) 26 | (10 0 10) 27 | (10 5 10) 28 | (0 5 10) 29 | ); 30 | 31 | blocks 32 | ( 33 | hex (0 1 2 3 4 5 6 7) (80 40 80) simpleGrading (1 1 1) 34 | // 32000 108000 35 | ); 36 | 37 | edges 38 | ( 39 | ); 40 | 41 | boundary 42 | ( 43 | floor 44 | { 45 | type wall; 46 | faces 47 | ( 48 | (1 5 4 0) 49 | ); 50 | } 51 | ceiling 52 | { 53 | type wall; 54 | faces 55 | ( 56 | (3 7 6 2) 57 | ); 58 | } 59 | fixedWalls 60 | { 61 | type wall; 62 | faces 63 | ( 64 | (0 4 7 3) 65 | (2 6 5 1) 66 | (0 3 2 1) 67 | (4 5 6 7) 68 | ); 69 | } 70 | ); 71 | 72 | mergePatchPairs 73 | ( 74 | ); 75 | 76 | // ************************************************************************* // 77 | -------------------------------------------------------------------------------- /test/example/system/controlDict: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 5 | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | location "system"; 14 | object controlDict; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | application buoyantBoussinesqPimpleFoam; 19 | 20 | startFrom startTime; 21 | 22 | startTime 0; 23 | 24 | stopAt endTime; 25 | 26 | endTime 40000; 27 | 28 | deltaT 0.05; 29 | 30 | // writeControl timeStep; 31 | // writeInterval 1; 32 | 33 | writeControl adjustableRunTime; 34 | writeInterval 500.0; 35 | 36 | purgeWrite 0; 37 | 38 | writeFormat ascii; 39 | 40 | writePrecision 6; 41 | 42 | writeCompression off; 43 | 44 | timeFormat general; 45 | 46 | timePrecision 6; 47 | 48 | runTimeModifiable true; 49 | 50 | adjustTimeStep on; 51 | 52 | maxCo 0.5; 53 | 54 | // ************************************************************************* // 55 | -------------------------------------------------------------------------------- /test/example/system/fvSchemes: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 5 | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | location "system"; 14 | object fvSchemes; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | ddtSchemes 19 | { 20 | default Euler; 21 | } 22 | 23 | gradSchemes 24 | { 25 | default Gauss linear; 26 | } 27 | 28 | divSchemes 29 | { 30 | default none; 31 | 32 | div(phi,U) Gauss upwind; 33 | div(phi,T) Gauss upwind; 34 | div(phi,k) Gauss upwind; 35 | div(phi,epsilon) Gauss upwind; 36 | div(phi,R) Gauss upwind; 37 | div(R) Gauss linear; 38 | div((nuEff*dev2(T(grad(U))))) Gauss linear; 39 | } 40 | 41 | laplacianSchemes 42 | { 43 | default Gauss linear uncorrected; 44 | } 45 | 46 | interpolationSchemes 47 | { 48 | default linear; 49 | } 50 | 51 | snGradSchemes 52 | { 53 | default uncorrected; 54 | } 55 | 56 | 57 | // ************************************************************************* // 58 | -------------------------------------------------------------------------------- /test/example/system/fvSolution: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 5 | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | location "system"; 14 | object fvSolution; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | solvers 19 | { 20 | p_rgh 21 | { 22 | solver PCG; 23 | preconditioner DIC; 24 | tolerance 1e-8; 25 | relTol 0.01; 26 | } 27 | 28 | p_rghFinal 29 | { 30 | $p_rgh; 31 | relTol 0; 32 | } 33 | 34 | "(U|T|k|epsilon|R)" 35 | { 36 | solver PBiCGStab; 37 | preconditioner DILU; 38 | tolerance 1e-6; 39 | relTol 0.1; 40 | } 41 | 42 | "(U|T|k|epsilon|R)Final" 43 | { 44 | $U; 45 | relTol 0; 46 | } 47 | } 48 | 49 | PIMPLE 50 | { 51 | momentumPredictor no; 52 | nOuterCorrectors 1; 53 | nCorrectors 2; 54 | nNonOrthogonalCorrectors 0; 55 | pRefCell 0; 56 | pRefValue 0; 57 | } 58 | 59 | relaxationFactors 60 | { 61 | equations 62 | { 63 | "(U|T|k|epsilon|R)" 1; 64 | "(U|T|k|epsilon|R)Final" 1; 65 | } 66 | } 67 | 68 | // ************************************************************************* // 69 | -------------------------------------------------------------------------------- /test/example/system/setFieldsDict: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 5 | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | object setFieldsDict; 14 | } 15 | 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | defaultFieldValues 19 | ( 20 | volScalarFieldValue T 300 21 | ); 22 | 23 | regions 24 | ( 25 | /* Set patch values (using ==) 26 | boxToFace 27 | { 28 | box (4.5 -1000 4.5) (5.5 1e-5 5.5); 29 | 30 | fieldValues 31 | ( 32 | volScalarFieldValue T 600 33 | ); 34 | } 35 | */ 36 | ); 37 | 38 | // ************************************************************************* // 39 | -------------------------------------------------------------------------------- /test/example/vimrc-inspect: -------------------------------------------------------------------------------- 1 | set nocompatible 2 | let &runtimepath = '~/.vim/bundle/vim-foam,' . &runtimepath 3 | filetype plugin indent on 4 | syntax enable 5 | 6 | nnoremap q :qall! 7 | nnoremap zS :echo SynNames() 8 | 9 | function! SynNames() 10 | return join(map(synstack(line('.'), col('.')), 11 | \ 'synIDattr(v:val, ''name'')'), ' -> ') 12 | endfunction 13 | 14 | silent edit constant/transportProperties 15 | -------------------------------------------------------------------------------- /test/example/vimrc-quick: -------------------------------------------------------------------------------- 1 | source vimrc-inspect 2 | 3 | for s:line in split(execute('syntax'), "\n") 4 | echo s:line 5 | endfor 6 | 7 | for s:line in filter(split(execute('scriptnames'), "\n"), 'v:val =~# ''foam''') 8 | echo s:line 9 | endfor 10 | 11 | echo b:current_syntax 12 | echo '' 13 | 14 | quit 15 | --------------------------------------------------------------------------------