├── README.md ├── SpalartAllmaras2012 ├── SpalartAllmaras.C ├── SpalartAllmaras.C~ ├── SpalartAllmaras.H └── SpalartAllmaras.H~ ├── SpalartAllmaras2012SARCM ├── SpalartAllmaras.C ├── SpalartAllmaras.C~ ├── SpalartAllmaras.H └── SpalartAllmaras.H~ ├── SpalartAllmarasOpenFOAM2.2 ├── SpalartAllmaras.C ├── SpalartAllmaras.C~ ├── SpalartAllmaras.H └── SpalartAllmaras.H~ ├── cycloRamp ├── INSTRUCTIONS ├── Make │ ├── files │ └── options ├── compiling new OpenFOAM source ├── cycloRamp.C ├── cycloRamp.H └── remake ├── nestedRotationMotion ├── Make │ ├── files │ ├── linux64GccDPOpt │ │ ├── dependencies │ │ ├── dependencyFiles │ │ ├── dontIncludeDeps │ │ ├── files │ │ ├── filesMacros │ │ ├── includeDeps │ │ ├── localObjectFiles │ │ ├── nestedRotationMotion.o │ │ ├── objectFiles │ │ ├── options │ │ └── sourceFiles │ └── options ├── axisRotationMotion.C ├── axisRotationMotion.H ├── compiling new OpenFOAM source ├── lnInclude │ ├── axisRotationMotion.C │ ├── axisRotationMotion.H │ ├── nestedRotationMotion.C │ ├── nestedRotationMotion.H │ └── uptodate ├── nestedRotationMotion.C ├── nestedRotationMotion.C~ ├── nestedRotationMotion.H ├── nestedRotationMotion.dep └── remake └── rampedAxisRotationMotion ├── Make ├── files ├── linux64GccDPOpt │ ├── dependencies │ ├── dependencyFiles │ ├── dontIncludeDeps │ ├── files │ ├── filesMacros │ ├── includeDeps │ ├── localObjectFiles │ ├── objectFiles │ ├── options │ ├── rampedAxisRotationMotion.o │ └── sourceFiles └── options ├── compiling new OpenFOAM source ├── lnInclude ├── rampedAxisRotationMotion.C ├── rampedAxisRotationMotion.H └── uptodate ├── rampedAxisRotationMotion.C ├── rampedAxisRotationMotion.H ├── rampedAxisRotationMotion.dep └── remake /README.md: -------------------------------------------------------------------------------- 1 | OpenFOAM_Additions 2 | ================== 3 | 4 | OpenFOAM Additions; Code that was geared to specific purposes and meant to be easily used by others. 5 | 6 | These can be installed into your computer by running ./remake in the source directory. 7 | -------------------------------------------------------------------------------- /SpalartAllmaras2012/SpalartAllmaras.C: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*\ 2 | ========= | 3 | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 4 | \\ / O peration | 5 | \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation 6 | \\/ M anipulation | 7 | ------------------------------------------------------------------------------- 8 | License 9 | This file is part of OpenFOAM. 10 | 11 | OpenFOAM is free software: you can redistribute it and/or modify it 12 | under the terms of the GNU General Public License as published by 13 | the Free Software Foundation, either version 3 of the License, or 14 | (at your option) any later version. 15 | 16 | OpenFOAM is distributed in the hope that it will be useful, but WITHOUT 17 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 18 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 19 | for more details. 20 | 21 | You should have received a copy of the GNU General Public License 22 | along with OpenFOAM. If not, see . 23 | 24 | \*---------------------------------------------------------------------------*/ 25 | 26 | /* 27 | This version is according to the 2012 paper by Allmaras, Johnson, and Spalart: 28 | "Modifications and Clarifications for the Implementation of the Spalart-Allmaras Turbulence Model", 29 | As well as the NASA Turbulence Modeling Resource Webpage on the Spalart-Allmaras Turbulence Model. 30 | */ 31 | 32 | #include "SpalartAllmaras.H" 33 | #include "addToRunTimeSelectionTable.H" 34 | 35 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 36 | 37 | namespace Foam 38 | { 39 | namespace incompressible 40 | { 41 | namespace RASModels 42 | { 43 | 44 | // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // 45 | 46 | defineTypeNameAndDebug(SpalartAllmaras, 0); 47 | addToRunTimeSelectionTable(RASModel, SpalartAllmaras, dictionary); 48 | 49 | // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // 50 | 51 | tmp SpalartAllmaras::chi() const 52 | { 53 | return nuTilda_/nu(); 54 | } 55 | 56 | 57 | tmp SpalartAllmaras::fv1(const volScalarField& chi) const 58 | { 59 | const volScalarField chi3(pow3(chi)); 60 | return chi3/(chi3 + pow3(Cv1_)); 61 | } 62 | 63 | 64 | tmp SpalartAllmaras::fv2 65 | ( 66 | const volScalarField& chi, 67 | const volScalarField& fv1 68 | ) const 69 | { 70 | return 1.0-chi/(scalar(1) + chi*fv1); 71 | //return 1.0/pow3(scalar(1) + chi/Cv2_); 72 | } 73 | 74 | /* 75 | tmp SpalartAllmaras::fv3 76 | ( 77 | const volScalarField& chi, 78 | const volScalarField& fv1 79 | ) const 80 | { 81 | const volScalarField chiByCv2((1/Cv2_)*chi); 82 | 83 | return 84 | (scalar(1) + chi*fv1) 85 | *(1/Cv2_) 86 | *(3*(scalar(1) + chiByCv2) + sqr(chiByCv2)) 87 | /pow3(scalar(1) + chiByCv2); 88 | } 89 | */ 90 | 91 | tmp SpalartAllmaras::fw(const volScalarField& Stilda) const 92 | { 93 | volScalarField r 94 | ( 95 | min 96 | ( 97 | nuTilda_ 98 | /( 99 | max 100 | ( 101 | Stilda, 102 | dimensionedScalar("SMALL", Stilda.dimensions(), SMALL) 103 | ) 104 | *sqr(kappa_*d_) 105 | ), 106 | scalar(10.0) 107 | ) 108 | ); 109 | r.boundaryField() == 0.0; 110 | 111 | const volScalarField g(r + Cw2_*(pow6(r) - r)); 112 | 113 | return g*pow((1.0 + pow6(Cw3_))/(pow6(g) + pow6(Cw3_)), 1.0/6.0); 114 | } 115 | 116 | 117 | // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // 118 | 119 | SpalartAllmaras::SpalartAllmaras 120 | ( 121 | const volVectorField& U, 122 | const surfaceScalarField& phi, 123 | transportModel& transport, 124 | const word& turbulenceModelName, 125 | const word& modelName 126 | ) 127 | : 128 | RASModel(modelName, U, phi, transport, turbulenceModelName), 129 | 130 | sigmaNut_ 131 | ( 132 | dimensioned::lookupOrAddToDict 133 | ( 134 | "sigmaNut", 135 | coeffDict_, 136 | 0.66666 137 | ) 138 | ), 139 | kappa_ 140 | ( 141 | dimensioned::lookupOrAddToDict 142 | ( 143 | "kappa", 144 | coeffDict_, 145 | 0.41 146 | ) 147 | ), 148 | 149 | Cb1_ 150 | ( 151 | dimensioned::lookupOrAddToDict 152 | ( 153 | "Cb1", 154 | coeffDict_, 155 | 0.1355 156 | ) 157 | ), 158 | Cb2_ 159 | ( 160 | dimensioned::lookupOrAddToDict 161 | ( 162 | "Cb2", 163 | coeffDict_, 164 | 0.622 165 | ) 166 | ), 167 | Cw1_(Cb1_/sqr(kappa_) + (1.0 + Cb2_)/sigmaNut_), 168 | Cw2_ 169 | ( 170 | dimensioned::lookupOrAddToDict 171 | ( 172 | "Cw2", 173 | coeffDict_, 174 | 0.3 175 | ) 176 | ), 177 | Cw3_ 178 | ( 179 | dimensioned::lookupOrAddToDict 180 | ( 181 | "Cw3", 182 | coeffDict_, 183 | 2.0 184 | ) 185 | ), 186 | Cv1_ 187 | ( 188 | dimensioned::lookupOrAddToDict 189 | ( 190 | "Cv1", 191 | coeffDict_, 192 | 7.1 193 | ) 194 | ), 195 | Cv2_ 196 | ( 197 | dimensioned::lookupOrAddToDict 198 | ( 199 | "Cv2", 200 | coeffDict_, 201 | 5.0 202 | ) 203 | ), 204 | 205 | nuTilda_ 206 | ( 207 | IOobject 208 | ( 209 | "nuTilda", 210 | runTime_.timeName(), 211 | mesh_, 212 | IOobject::MUST_READ, 213 | IOobject::AUTO_WRITE 214 | ), 215 | mesh_ 216 | ), 217 | 218 | nut_ 219 | ( 220 | IOobject 221 | ( 222 | "nut", 223 | runTime_.timeName(), 224 | mesh_, 225 | IOobject::MUST_READ, 226 | IOobject::AUTO_WRITE 227 | ), 228 | mesh_ 229 | ), 230 | 231 | d_(mesh_) 232 | { 233 | printCoeffs(); 234 | } 235 | 236 | 237 | // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // 238 | 239 | tmp SpalartAllmaras::DnuTildaEff(const volScalarField& chi) const 240 | { 241 | //New quantity fn (for negative-nuTilda Spalart-Allmaras model) 242 | volScalarField fn ( (16+pow3(chi))/(16-pow3(chi)) ); 243 | return tmp 244 | ( 245 | //new volScalarField("DnuTildaEff", (nuTilda_ + nu())/sigmaNut_) 246 | new volScalarField("DnuTildaEff", (nuTilda_ + nu()*(pos(nuTilda_)+(1-pos(nuTilda_))*fn))/sigmaNut_) 247 | ); 248 | } 249 | 250 | 251 | tmp SpalartAllmaras::k() const 252 | { 253 | WarningIn("tmp SpalartAllmaras::k() const") 254 | << "Turbulence kinetic energy not defined for Spalart-Allmaras model. " 255 | << "Returning zero field" << endl; 256 | 257 | return tmp 258 | ( 259 | new volScalarField 260 | ( 261 | IOobject 262 | ( 263 | "k", 264 | runTime_.timeName(), 265 | mesh_ 266 | ), 267 | mesh_, 268 | dimensionedScalar("0", dimensionSet(0, 2, -2, 0, 0), 0) 269 | ) 270 | ); 271 | } 272 | 273 | 274 | tmp SpalartAllmaras::epsilon() const 275 | { 276 | WarningIn("tmp SpalartAllmaras::epsilon() const") 277 | << "Turbulence kinetic energy dissipation rate not defined for " 278 | << "Spalart-Allmaras model. Returning zero field" 279 | << endl; 280 | 281 | return tmp 282 | ( 283 | new volScalarField 284 | ( 285 | IOobject 286 | ( 287 | "epsilon", 288 | runTime_.timeName(), 289 | mesh_ 290 | ), 291 | mesh_, 292 | dimensionedScalar("0", dimensionSet(0, 2, -3, 0, 0), 0) 293 | ) 294 | ); 295 | } 296 | 297 | 298 | tmp SpalartAllmaras::R() const 299 | { 300 | return tmp 301 | ( 302 | new volSymmTensorField 303 | ( 304 | IOobject 305 | ( 306 | "R", 307 | runTime_.timeName(), 308 | mesh_, 309 | IOobject::NO_READ, 310 | IOobject::NO_WRITE 311 | ), 312 | ((2.0/3.0)*I)*k() - nut()*twoSymm(fvc::grad(U_)) 313 | ) 314 | ); 315 | } 316 | 317 | 318 | tmp SpalartAllmaras::devReff() const 319 | { 320 | return tmp 321 | ( 322 | new volSymmTensorField 323 | ( 324 | IOobject 325 | ( 326 | "devRhoReff", 327 | runTime_.timeName(), 328 | mesh_, 329 | IOobject::NO_READ, 330 | IOobject::NO_WRITE 331 | ), 332 | -nuEff()*dev(twoSymm(fvc::grad(U_))) 333 | ) 334 | ); 335 | } 336 | 337 | 338 | tmp SpalartAllmaras::divDevReff(volVectorField& U) const 339 | { 340 | const volScalarField nuEff_(nuEff()); 341 | 342 | return 343 | ( 344 | - fvm::laplacian(nuEff_, U) 345 | - fvc::div(nuEff_*dev(T(fvc::grad(U)))) 346 | ); 347 | } 348 | 349 | 350 | tmp SpalartAllmaras::divDevRhoReff 351 | ( 352 | const volScalarField& rho, 353 | volVectorField& U 354 | ) const 355 | { 356 | volScalarField muEff("muEff", rho*nuEff()); 357 | 358 | return 359 | ( 360 | - fvm::laplacian(muEff, U) 361 | - fvc::div(muEff*dev(T(fvc::grad(U)))) 362 | ); 363 | } 364 | 365 | 366 | bool SpalartAllmaras::read() 367 | { 368 | if (RASModel::read()) 369 | { 370 | sigmaNut_.readIfPresent(coeffDict()); 371 | kappa_.readIfPresent(coeffDict()); 372 | 373 | Cb1_.readIfPresent(coeffDict()); 374 | Cb2_.readIfPresent(coeffDict()); 375 | Cw1_ = Cb1_/sqr(kappa_) + (1.0 + Cb2_)/sigmaNut_; 376 | Cw2_.readIfPresent(coeffDict()); 377 | Cw3_.readIfPresent(coeffDict()); 378 | Cv1_.readIfPresent(coeffDict()); 379 | Cv2_.readIfPresent(coeffDict()); 380 | 381 | return true; 382 | } 383 | else 384 | { 385 | return false; 386 | } 387 | } 388 | 389 | 390 | void SpalartAllmaras::correct() 391 | { 392 | RASModel::correct(); 393 | 394 | if (!turbulence_) 395 | { 396 | // Re-calculate viscosity 397 | nut_ = nuTilda_*fv1(this->chi()); 398 | nut_.correctBoundaryConditions(); 399 | 400 | return; 401 | } 402 | 403 | if (mesh_.changing()) 404 | { 405 | d_.correct(); 406 | } 407 | 408 | const volScalarField chi(this->chi()); 409 | const volScalarField fv1(this->fv1(chi)); 410 | //New quantities for Modified Vorticity Stilda 411 | volScalarField Smag ( sqrt(2.0)*mag(skew(fvc::grad(U_))) ); 412 | volScalarField Sbar ( fv2(chi, fv1)*nuTilda_/sqr(kappa_*d_) ); 413 | const volScalarField Stilda 414 | ( 415 | //New expression for Modified Vorticity Stilda 416 | Smag 417 | +pos(Sbar+0.7*Smag)*Sbar 418 | +(1-pos(Sbar+0.7*Smag))*Smag*(0.49*Smag+0.9*Sbar)/(-0.5*Smag-Sbar) 419 | /* 420 | //fv3(chi, fv1)*::sqrt(2.0)*mag(skew(fvc::grad(U_))) 421 | sqrt(2.0)*mag(skew(fvc::grad(U_))) 422 | + fv2(chi, fv1)*nuTilda_/sqr(kappa_*d_) 423 | */ 424 | ); 425 | 426 | tmp nuTildaEqn 427 | ( 428 | fvm::ddt(nuTilda_) 429 | + fvm::div(phi_, nuTilda_) 430 | //DnuTildaEff now requires chi for Negative SA Model 431 | - fvm::laplacian(DnuTildaEff(chi), nuTilda_) 432 | - Cb2_/sigmaNut_*magSqr(fvc::grad(nuTilda_)) 433 | == 434 | //New expression as part of Negative SA Model 435 | Cb1_*nuTilda_*(pos(nuTilda_)*Stilda+(1-pos(nuTilda_))*-0.2*Smag) 436 | - fvm::Sp(Cw1_*nuTilda_/sqr(d_)*(pos(nuTilda_)*fw(Stilda)-(1-pos(nuTilda_))), nuTilda_) 437 | // Cb1_*Stilda*nuTilda_ 438 | // - fvm::Sp(Cw1_*fw(Stilda)*nuTilda_/sqr(d_), nuTilda_) 439 | ); 440 | 441 | nuTildaEqn().relax(); 442 | solve(nuTildaEqn); 443 | bound(nuTilda_, dimensionedScalar("0", nuTilda_.dimensions(), 0.0)); 444 | nuTilda_.correctBoundaryConditions(); 445 | 446 | // Re-calculate viscosity 447 | nut_.internalField() = fv1*nuTilda_.internalField(); 448 | nut_.correctBoundaryConditions(); 449 | } 450 | 451 | 452 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 453 | 454 | } // End namespace RASModels 455 | } // End namespace incompressible 456 | } // End namespace Foam 457 | 458 | // ************************************************************************* // 459 | -------------------------------------------------------------------------------- /SpalartAllmaras2012/SpalartAllmaras.C~: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*\ 2 | ========= | 3 | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 4 | \\ / O peration | 5 | \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation 6 | \\/ M anipulation | 7 | ------------------------------------------------------------------------------- 8 | License 9 | This file is part of OpenFOAM. 10 | 11 | OpenFOAM is free software: you can redistribute it and/or modify it 12 | under the terms of the GNU General Public License as published by 13 | the Free Software Foundation, either version 3 of the License, or 14 | (at your option) any later version. 15 | 16 | OpenFOAM is distributed in the hope that it will be useful, but WITHOUT 17 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 18 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 19 | for more details. 20 | 21 | You should have received a copy of the GNU General Public License 22 | along with OpenFOAM. If not, see . 23 | 24 | \*---------------------------------------------------------------------------*/ 25 | 26 | /* 27 | This version is according to the 2012 paper by Allmaras, Johnson, and Spalart: 28 | "Modifications and Clarifications for the Implementation of the Spalart-Allmaras Turbulence Model", 29 | As well as the NASA Turbulence Modeling Resource Webpage on the Spalart-Allmaras Turbulence Model. 30 | */ 31 | 32 | #include "SpalartAllmaras.H" 33 | #include "addToRunTimeSelectionTable.H" 34 | 35 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 36 | 37 | namespace Foam 38 | { 39 | namespace incompressible 40 | { 41 | namespace RASModels 42 | { 43 | 44 | // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // 45 | 46 | defineTypeNameAndDebug(SpalartAllmaras, 0); 47 | addToRunTimeSelectionTable(RASModel, SpalartAllmaras, dictionary); 48 | 49 | // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // 50 | 51 | tmp SpalartAllmaras::chi() const 52 | { 53 | return nuTilda_/nu(); 54 | } 55 | 56 | 57 | tmp SpalartAllmaras::fv1(const volScalarField& chi) const 58 | { 59 | const volScalarField chi3(pow3(chi)); 60 | return chi3/(chi3 + pow3(Cv1_)); 61 | } 62 | 63 | 64 | tmp SpalartAllmaras::fv2 65 | ( 66 | const volScalarField& chi, 67 | const volScalarField& fv1 68 | ) const 69 | { 70 | return 1.0-chi/(scalar(1) + chi*fv1); 71 | //return 1.0/pow3(scalar(1) + chi/Cv2_); 72 | } 73 | 74 | /* 75 | tmp SpalartAllmaras::fv3 76 | ( 77 | const volScalarField& chi, 78 | const volScalarField& fv1 79 | ) const 80 | { 81 | const volScalarField chiByCv2((1/Cv2_)*chi); 82 | 83 | return 84 | (scalar(1) + chi*fv1) 85 | *(1/Cv2_) 86 | *(3*(scalar(1) + chiByCv2) + sqr(chiByCv2)) 87 | /pow3(scalar(1) + chiByCv2); 88 | } 89 | */ 90 | 91 | tmp SpalartAllmaras::fw(const volScalarField& Stilda) const 92 | { 93 | volScalarField r 94 | ( 95 | min 96 | ( 97 | nuTilda_ 98 | /( 99 | max 100 | ( 101 | Stilda, 102 | dimensionedScalar("SMALL", Stilda.dimensions(), SMALL) 103 | ) 104 | *sqr(kappa_*d_) 105 | ), 106 | scalar(10.0) 107 | ) 108 | ); 109 | r.boundaryField() == 0.0; 110 | 111 | const volScalarField g(r + Cw2_*(pow6(r) - r)); 112 | 113 | return g*pow((1.0 + pow6(Cw3_))/(pow6(g) + pow6(Cw3_)), 1.0/6.0); 114 | } 115 | 116 | 117 | // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // 118 | 119 | SpalartAllmaras::SpalartAllmaras 120 | ( 121 | const volVectorField& U, 122 | const surfaceScalarField& phi, 123 | transportModel& transport, 124 | const word& turbulenceModelName, 125 | const word& modelName 126 | ) 127 | : 128 | RASModel(modelName, U, phi, transport, turbulenceModelName), 129 | 130 | sigmaNut_ 131 | ( 132 | dimensioned::lookupOrAddToDict 133 | ( 134 | "sigmaNut", 135 | coeffDict_, 136 | 0.66666 137 | ) 138 | ), 139 | kappa_ 140 | ( 141 | dimensioned::lookupOrAddToDict 142 | ( 143 | "kappa", 144 | coeffDict_, 145 | 0.41 146 | ) 147 | ), 148 | 149 | Cb1_ 150 | ( 151 | dimensioned::lookupOrAddToDict 152 | ( 153 | "Cb1", 154 | coeffDict_, 155 | 0.1355 156 | ) 157 | ), 158 | Cb2_ 159 | ( 160 | dimensioned::lookupOrAddToDict 161 | ( 162 | "Cb2", 163 | coeffDict_, 164 | 0.622 165 | ) 166 | ), 167 | Cw1_(Cb1_/sqr(kappa_) + (1.0 + Cb2_)/sigmaNut_), 168 | Cw2_ 169 | ( 170 | dimensioned::lookupOrAddToDict 171 | ( 172 | "Cw2", 173 | coeffDict_, 174 | 0.3 175 | ) 176 | ), 177 | Cw3_ 178 | ( 179 | dimensioned::lookupOrAddToDict 180 | ( 181 | "Cw3", 182 | coeffDict_, 183 | 2.0 184 | ) 185 | ), 186 | Cv1_ 187 | ( 188 | dimensioned::lookupOrAddToDict 189 | ( 190 | "Cv1", 191 | coeffDict_, 192 | 7.1 193 | ) 194 | ), 195 | Cv2_ 196 | ( 197 | dimensioned::lookupOrAddToDict 198 | ( 199 | "Cv2", 200 | coeffDict_, 201 | 5.0 202 | ) 203 | ), 204 | 205 | nuTilda_ 206 | ( 207 | IOobject 208 | ( 209 | "nuTilda", 210 | runTime_.timeName(), 211 | mesh_, 212 | IOobject::MUST_READ, 213 | IOobject::AUTO_WRITE 214 | ), 215 | mesh_ 216 | ), 217 | 218 | nut_ 219 | ( 220 | IOobject 221 | ( 222 | "nut", 223 | runTime_.timeName(), 224 | mesh_, 225 | IOobject::MUST_READ, 226 | IOobject::AUTO_WRITE 227 | ), 228 | mesh_ 229 | ), 230 | 231 | d_(mesh_) 232 | { 233 | printCoeffs(); 234 | } 235 | 236 | 237 | // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // 238 | 239 | tmp SpalartAllmaras::DnuTildaEff(const volScalarField& chi) const 240 | { 241 | //New quantity fn (for negative-nuTilda Spalart-Allmaras model) 242 | volScalarField fn ( (16+pow3(chi))/(16-pow3(chi)) ); 243 | return tmp 244 | ( 245 | //new volScalarField("DnuTildaEff", (nuTilda_ + nu())/sigmaNut_) 246 | new volScalarField("DnuTildaEff", (nuTilda_ + nu()*(pos(nuTilda_)+(1-pos(nuTilda_))*fn))/sigmaNut_) 247 | ); 248 | } 249 | 250 | 251 | tmp SpalartAllmaras::k() const 252 | { 253 | WarningIn("tmp SpalartAllmaras::k() const") 254 | << "Turbulence kinetic energy not defined for Spalart-Allmaras model. " 255 | << "Returning zero field" << endl; 256 | 257 | return tmp 258 | ( 259 | new volScalarField 260 | ( 261 | IOobject 262 | ( 263 | "k", 264 | runTime_.timeName(), 265 | mesh_ 266 | ), 267 | mesh_, 268 | dimensionedScalar("0", dimensionSet(0, 2, -2, 0, 0), 0) 269 | ) 270 | ); 271 | } 272 | 273 | 274 | tmp SpalartAllmaras::epsilon() const 275 | { 276 | WarningIn("tmp SpalartAllmaras::epsilon() const") 277 | << "Turbulence kinetic energy dissipation rate not defined for " 278 | << "Spalart-Allmaras model. Returning zero field" 279 | << endl; 280 | 281 | return tmp 282 | ( 283 | new volScalarField 284 | ( 285 | IOobject 286 | ( 287 | "epsilon", 288 | runTime_.timeName(), 289 | mesh_ 290 | ), 291 | mesh_, 292 | dimensionedScalar("0", dimensionSet(0, 2, -3, 0, 0), 0) 293 | ) 294 | ); 295 | } 296 | 297 | 298 | tmp SpalartAllmaras::R() const 299 | { 300 | return tmp 301 | ( 302 | new volSymmTensorField 303 | ( 304 | IOobject 305 | ( 306 | "R", 307 | runTime_.timeName(), 308 | mesh_, 309 | IOobject::NO_READ, 310 | IOobject::NO_WRITE 311 | ), 312 | ((2.0/3.0)*I)*k() - nut()*twoSymm(fvc::grad(U_)) 313 | ) 314 | ); 315 | } 316 | 317 | 318 | tmp SpalartAllmaras::devReff() const 319 | { 320 | return tmp 321 | ( 322 | new volSymmTensorField 323 | ( 324 | IOobject 325 | ( 326 | "devRhoReff", 327 | runTime_.timeName(), 328 | mesh_, 329 | IOobject::NO_READ, 330 | IOobject::NO_WRITE 331 | ), 332 | -nuEff()*dev(twoSymm(fvc::grad(U_))) 333 | ) 334 | ); 335 | } 336 | 337 | 338 | tmp SpalartAllmaras::divDevReff(volVectorField& U) const 339 | { 340 | const volScalarField nuEff_(nuEff()); 341 | 342 | return 343 | ( 344 | - fvm::laplacian(nuEff_, U) 345 | - fvc::div(nuEff_*dev(T(fvc::grad(U)))) 346 | ); 347 | } 348 | 349 | 350 | tmp SpalartAllmaras::divDevRhoReff 351 | ( 352 | const volScalarField& rho, 353 | volVectorField& U 354 | ) const 355 | { 356 | volScalarField muEff("muEff", rho*nuEff()); 357 | 358 | return 359 | ( 360 | - fvm::laplacian(muEff, U) 361 | - fvc::div(muEff*dev(T(fvc::grad(U)))) 362 | ); 363 | } 364 | 365 | 366 | bool SpalartAllmaras::read() 367 | { 368 | if (RASModel::read()) 369 | { 370 | sigmaNut_.readIfPresent(coeffDict()); 371 | kappa_.readIfPresent(coeffDict()); 372 | 373 | Cb1_.readIfPresent(coeffDict()); 374 | Cb2_.readIfPresent(coeffDict()); 375 | Cw1_ = Cb1_/sqr(kappa_) + (1.0 + Cb2_)/sigmaNut_; 376 | Cw2_.readIfPresent(coeffDict()); 377 | Cw3_.readIfPresent(coeffDict()); 378 | Cv1_.readIfPresent(coeffDict()); 379 | Cv2_.readIfPresent(coeffDict()); 380 | 381 | return true; 382 | } 383 | else 384 | { 385 | return false; 386 | } 387 | } 388 | 389 | 390 | void SpalartAllmaras::correct() 391 | { 392 | RASModel::correct(); 393 | 394 | if (!turbulence_) 395 | { 396 | // Re-calculate viscosity 397 | nut_ = nuTilda_*fv1(this->chi()); 398 | nut_.correctBoundaryConditions(); 399 | 400 | return; 401 | } 402 | 403 | if (mesh_.changing()) 404 | { 405 | d_.correct(); 406 | } 407 | 408 | const volScalarField chi(this->chi()); 409 | const volScalarField fv1(this->fv1(chi)); 410 | //New quantities for Modified Vorticity Stilda 411 | volScalarField Smag ( sqrt(2.0)*mag(skew(fvc::grad(U_))) ); 412 | volScalarField Sbar ( fv2(chi, fv1)*nuTilda_/sqr(kappa_*d_) ); 413 | const volScalarField Stilda 414 | ( 415 | //New expression for Modified Vorticity Stilda 416 | Smag 417 | +pos(Sbar+0.7*Smag)*Sbar 418 | +(1-pos(Sbar+0.7*Smag))*Smag*(0.49*Smag+0.9*Sbar)/(-0.5*Smag-Sbar) 419 | /* 420 | //fv3(chi, fv1)*::sqrt(2.0)*mag(skew(fvc::grad(U_))) 421 | sqrt(2.0)*mag(skew(fvc::grad(U_))) 422 | + fv2(chi, fv1)*nuTilda_/sqr(kappa_*d_) 423 | */ 424 | ); 425 | 426 | tmp nuTildaEqn 427 | ( 428 | fvm::ddt(nuTilda_) 429 | + fvm::div(phi_, nuTilda_) 430 | //DnuTildaEff now requires chi for Negative SA Model 431 | - fvm::laplacian(DnuTildaEff(chi), nuTilda_) 432 | - Cb2_/sigmaNut_*magSqr(fvc::grad(nuTilda_)) 433 | == 434 | //New expression as part of Negative SA Model 435 | Cb1_*nuTilda_*(pos(nuTilda_)*Stilda+(1-pos(nuTilda_))*-0.2*Smag) 436 | - fvm::Sp(Cw1_*nuTilda_/sqr(d_)*(pos(nuTilda_)*fw(Stilda)-(1-pos(nuTilda_))), nuTilda_) 437 | // Cb1_*Stilda*nuTilda_ 438 | // - fvm::Sp(Cw1_*fw(Stilda)*nuTilda_/sqr(d_), nuTilda_) 439 | ); 440 | 441 | nuTildaEqn().relax(); 442 | solve(nuTildaEqn); 443 | bound(nuTilda_, dimensionedScalar("0", nuTilda_.dimensions(), 0.0)); 444 | nuTilda_.correctBoundaryConditions(); 445 | 446 | // Re-calculate viscosity 447 | nut_.internalField() = fv1*nuTilda_.internalField(); 448 | nut_.correctBoundaryConditions(); 449 | } 450 | 451 | 452 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 453 | 454 | } // End namespace RASModels 455 | } // End namespace incompressible 456 | } // End namespace Foam 457 | 458 | // ************************************************************************* // 459 | -------------------------------------------------------------------------------- /SpalartAllmaras2012/SpalartAllmaras.H: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*\ 2 | ========= | 3 | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 4 | \\ / O peration | 5 | \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation 6 | \\/ M anipulation | 7 | ------------------------------------------------------------------------------- 8 | License 9 | This file is part of OpenFOAM. 10 | 11 | OpenFOAM is free software: you can redistribute it and/or modify it 12 | under the terms of the GNU General Public License as published by 13 | the Free Software Foundation, either version 3 of the License, or 14 | (at your option) any later version. 15 | 16 | OpenFOAM is distributed in the hope that it will be useful, but WITHOUT 17 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 18 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 19 | for more details. 20 | 21 | You should have received a copy of the GNU General Public License 22 | along with OpenFOAM. If not, see . 23 | 24 | Class 25 | Foam::incompressible::RASModels::SpalartAllmaras 26 | 27 | Group 28 | grpIcoRASTurbulence 29 | 30 | Description 31 | Spalart-Allmaras 1-eqn mixing-length model for incompressible external 32 | flows. 33 | 34 | References: 35 | \verbatim 36 | "A One-Equation Turbulence Model for Aerodynamic Flows" 37 | P.R. Spalart, 38 | S.R. Allmaras, 39 | La Recherche Aerospatiale, No. 1, 1994, pp. 5-21. 40 | 41 | Extended according to: 42 | 43 | "An Unstructured Grid Generation and Adaptive Solution Technique 44 | for High Reynolds Number Compressible Flows" 45 | G.A. Ashford, 46 | Ph.D. thesis, University of Michigan, 1996. 47 | \endverbatim 48 | 49 | The default model coefficients correspond to the following: 50 | \verbatim 51 | SpalartAllmarasCoeffs 52 | { 53 | Cb1 0.1355; 54 | Cb2 0.622; 55 | Cw2 0.3; 56 | Cw3 2.0; 57 | Cv1 7.1; 58 | Cv2 5.0; 59 | sigmaNut 0.66666; 60 | kappa 0.41; 61 | } 62 | \endverbatim 63 | 64 | SourceFiles 65 | SpalartAllmaras.C 66 | 67 | \*---------------------------------------------------------------------------*/ 68 | 69 | #ifndef SpalartAllmaras_H 70 | #define SpalartAllmaras_H 71 | 72 | #include "RASModel.H" 73 | #include "wallDist.H" 74 | 75 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 76 | 77 | namespace Foam 78 | { 79 | namespace incompressible 80 | { 81 | namespace RASModels 82 | { 83 | 84 | /*---------------------------------------------------------------------------*\ 85 | Class SpalartAllmaras Declaration 86 | \*---------------------------------------------------------------------------*/ 87 | 88 | class SpalartAllmaras 89 | : 90 | public RASModel 91 | { 92 | 93 | protected: 94 | 95 | // Protected data 96 | 97 | // Model coefficients 98 | 99 | dimensionedScalar sigmaNut_; 100 | dimensionedScalar kappa_; 101 | 102 | dimensionedScalar Cb1_; 103 | dimensionedScalar Cb2_; 104 | dimensionedScalar Cw1_; 105 | dimensionedScalar Cw2_; 106 | dimensionedScalar Cw3_; 107 | dimensionedScalar Cv1_; 108 | dimensionedScalar Cv2_; 109 | 110 | 111 | // Fields 112 | 113 | volScalarField nuTilda_; 114 | volScalarField nut_; 115 | 116 | wallDist d_; 117 | 118 | 119 | // Protected Member Functions 120 | 121 | tmp chi() const; 122 | 123 | tmp fv1(const volScalarField& chi) const; 124 | 125 | tmp fv2 126 | ( 127 | const volScalarField& chi, 128 | const volScalarField& fv1 129 | ) const; 130 | 131 | tmp fv3 132 | ( 133 | const volScalarField& chi, 134 | const volScalarField& fv1 135 | ) const; 136 | 137 | tmp fw(const volScalarField& Stilda) const; 138 | 139 | 140 | public: 141 | 142 | //- Runtime type information 143 | TypeName("SpalartAllmaras"); 144 | 145 | 146 | // Constructors 147 | 148 | //- Construct from components 149 | SpalartAllmaras 150 | ( 151 | const volVectorField& U, 152 | const surfaceScalarField& phi, 153 | transportModel& transport, 154 | const word& turbulenceModelName = turbulenceModel::typeName, 155 | const word& modelName = typeName 156 | ); 157 | 158 | 159 | //- Destructor 160 | virtual ~SpalartAllmaras() 161 | {} 162 | 163 | 164 | // Member Functions 165 | 166 | //- Return the turbulence viscosity 167 | virtual tmp nut() const 168 | { 169 | return nut_; 170 | } 171 | 172 | //- Return the effective diffusivity for nuTilda 173 | //DnuTildaEff now requires chi for Negative SA Model 174 | tmp DnuTildaEff(const volScalarField& chi) const; 175 | //tmp DnuTildaEff() const; 176 | 177 | //- Return the turbulence kinetic energy 178 | virtual tmp k() const; 179 | 180 | //- Return the turbulence kinetic energy dissipation rate 181 | virtual tmp epsilon() const; 182 | 183 | //- Return the Reynolds stress tensor 184 | virtual tmp R() const; 185 | 186 | //- Return the effective stress tensor including the laminar stress 187 | virtual tmp devReff() const; 188 | 189 | //- Return the source term for the momentum equation 190 | virtual tmp divDevReff(volVectorField& U) const; 191 | 192 | //- Return the source term for the momentum equation 193 | virtual tmp divDevRhoReff 194 | ( 195 | const volScalarField& rho, 196 | volVectorField& U 197 | ) const; 198 | 199 | //- Solve the turbulence equations and correct the turbulence viscosity 200 | virtual void correct(); 201 | 202 | //- Read RASProperties dictionary 203 | virtual bool read(); 204 | }; 205 | 206 | 207 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 208 | 209 | } // End namespace RASModels 210 | } // End namespace incompressible 211 | } // End namespace Foam 212 | 213 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 214 | 215 | #endif 216 | 217 | // ************************************************************************* // 218 | -------------------------------------------------------------------------------- /SpalartAllmaras2012/SpalartAllmaras.H~: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*\ 2 | ========= | 3 | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 4 | \\ / O peration | 5 | \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation 6 | \\/ M anipulation | 7 | ------------------------------------------------------------------------------- 8 | License 9 | This file is part of OpenFOAM. 10 | 11 | OpenFOAM is free software: you can redistribute it and/or modify it 12 | under the terms of the GNU General Public License as published by 13 | the Free Software Foundation, either version 3 of the License, or 14 | (at your option) any later version. 15 | 16 | OpenFOAM is distributed in the hope that it will be useful, but WITHOUT 17 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 18 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 19 | for more details. 20 | 21 | You should have received a copy of the GNU General Public License 22 | along with OpenFOAM. If not, see . 23 | 24 | Class 25 | Foam::incompressible::RASModels::SpalartAllmaras 26 | 27 | Group 28 | grpIcoRASTurbulence 29 | 30 | Description 31 | Spalart-Allmaras 1-eqn mixing-length model for incompressible external 32 | flows. 33 | 34 | References: 35 | \verbatim 36 | "A One-Equation Turbulence Model for Aerodynamic Flows" 37 | P.R. Spalart, 38 | S.R. Allmaras, 39 | La Recherche Aerospatiale, No. 1, 1994, pp. 5-21. 40 | 41 | Extended according to: 42 | 43 | "An Unstructured Grid Generation and Adaptive Solution Technique 44 | for High Reynolds Number Compressible Flows" 45 | G.A. Ashford, 46 | Ph.D. thesis, University of Michigan, 1996. 47 | \endverbatim 48 | 49 | The default model coefficients correspond to the following: 50 | \verbatim 51 | SpalartAllmarasCoeffs 52 | { 53 | Cb1 0.1355; 54 | Cb2 0.622; 55 | Cw2 0.3; 56 | Cw3 2.0; 57 | Cv1 7.1; 58 | Cv2 5.0; 59 | sigmaNut 0.66666; 60 | kappa 0.41; 61 | } 62 | \endverbatim 63 | 64 | SourceFiles 65 | SpalartAllmaras.C 66 | 67 | \*---------------------------------------------------------------------------*/ 68 | 69 | #ifndef SpalartAllmaras_H 70 | #define SpalartAllmaras_H 71 | 72 | #include "RASModel.H" 73 | #include "wallDist.H" 74 | 75 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 76 | 77 | namespace Foam 78 | { 79 | namespace incompressible 80 | { 81 | namespace RASModels 82 | { 83 | 84 | /*---------------------------------------------------------------------------*\ 85 | Class SpalartAllmaras Declaration 86 | \*---------------------------------------------------------------------------*/ 87 | 88 | class SpalartAllmaras 89 | : 90 | public RASModel 91 | { 92 | 93 | protected: 94 | 95 | // Protected data 96 | 97 | // Model coefficients 98 | 99 | dimensionedScalar sigmaNut_; 100 | dimensionedScalar kappa_; 101 | 102 | dimensionedScalar Cb1_; 103 | dimensionedScalar Cb2_; 104 | dimensionedScalar Cw1_; 105 | dimensionedScalar Cw2_; 106 | dimensionedScalar Cw3_; 107 | dimensionedScalar Cv1_; 108 | dimensionedScalar Cv2_; 109 | 110 | 111 | // Fields 112 | 113 | volScalarField nuTilda_; 114 | volScalarField nut_; 115 | 116 | wallDist d_; 117 | 118 | 119 | // Protected Member Functions 120 | 121 | tmp chi() const; 122 | 123 | tmp fv1(const volScalarField& chi) const; 124 | 125 | tmp fv2 126 | ( 127 | const volScalarField& chi, 128 | const volScalarField& fv1 129 | ) const; 130 | 131 | tmp fv3 132 | ( 133 | const volScalarField& chi, 134 | const volScalarField& fv1 135 | ) const; 136 | 137 | tmp fw(const volScalarField& Stilda) const; 138 | 139 | 140 | public: 141 | 142 | //- Runtime type information 143 | TypeName("SpalartAllmaras"); 144 | 145 | 146 | // Constructors 147 | 148 | //- Construct from components 149 | SpalartAllmaras 150 | ( 151 | const volVectorField& U, 152 | const surfaceScalarField& phi, 153 | transportModel& transport, 154 | const word& turbulenceModelName = turbulenceModel::typeName, 155 | const word& modelName = typeName 156 | ); 157 | 158 | 159 | //- Destructor 160 | virtual ~SpalartAllmaras() 161 | {} 162 | 163 | 164 | // Member Functions 165 | 166 | //- Return the turbulence viscosity 167 | virtual tmp nut() const 168 | { 169 | return nut_; 170 | } 171 | 172 | //- Return the effective diffusivity for nuTilda 173 | //DnuTildaEff now requires chi for Negative SA Model 174 | tmp DnuTildaEff(const volScalarField& chi) const; 175 | //tmp DnuTildaEff() const; 176 | 177 | //- Return the turbulence kinetic energy 178 | virtual tmp k() const; 179 | 180 | //- Return the turbulence kinetic energy dissipation rate 181 | virtual tmp epsilon() const; 182 | 183 | //- Return the Reynolds stress tensor 184 | virtual tmp R() const; 185 | 186 | //- Return the effective stress tensor including the laminar stress 187 | virtual tmp devReff() const; 188 | 189 | //- Return the source term for the momentum equation 190 | virtual tmp divDevReff(volVectorField& U) const; 191 | 192 | //- Return the source term for the momentum equation 193 | virtual tmp divDevRhoReff 194 | ( 195 | const volScalarField& rho, 196 | volVectorField& U 197 | ) const; 198 | 199 | //- Solve the turbulence equations and correct the turbulence viscosity 200 | virtual void correct(); 201 | 202 | //- Read RASProperties dictionary 203 | virtual bool read(); 204 | }; 205 | 206 | 207 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 208 | 209 | } // End namespace RASModels 210 | } // End namespace incompressible 211 | } // End namespace Foam 212 | 213 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 214 | 215 | #endif 216 | 217 | // ************************************************************************* // 218 | -------------------------------------------------------------------------------- /SpalartAllmaras2012SARCM/SpalartAllmaras.C: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*\ 2 | ========= | 3 | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 4 | \\ / O peration | 5 | \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation 6 | \\/ M anipulation | 7 | ------------------------------------------------------------------------------- 8 | License 9 | This file is part of OpenFOAM. 10 | 11 | OpenFOAM is free software: you can redistribute it and/or modify it 12 | under the terms of the GNU General Public License as published by 13 | the Free Software Foundation, either version 3 of the License, or 14 | (at your option) any later version. 15 | 16 | OpenFOAM is distributed in the hope that it will be useful, but WITHOUT 17 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 18 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 19 | for more details. 20 | 21 | You should have received a copy of the GNU General Public License 22 | along with OpenFOAM. If not, see . 23 | 24 | \*---------------------------------------------------------------------------*/ 25 | 26 | /* 27 | This version is according to the 2012 paper by Allmaras, Johnson, and Spalart: 28 | "Modifications and Clarifications for the Implementation of the Spalart-Allmaras Turbulence Model", 29 | As well as the NASA Turbulence Modeling Resource Webpage on the Spalart-Allmaras Turbulence Model. 30 | In addition, a Rotation/Curvature Correction (RCC) method is applied, according to the 2012 paper by Qiang and Yong: 31 | "A New, Simpler Rotation/Curvature Correction Method for the Spalart-Allmaras Turbulence Model" 32 | The model with RCC applied is referred to as SARCM. 33 | */ 34 | 35 | #include "SpalartAllmaras.H" 36 | #include "addToRunTimeSelectionTable.H" 37 | 38 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 39 | 40 | namespace Foam 41 | { 42 | namespace incompressible 43 | { 44 | namespace RASModels 45 | { 46 | 47 | // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // 48 | 49 | defineTypeNameAndDebug(SpalartAllmaras, 0); 50 | addToRunTimeSelectionTable(RASModel, SpalartAllmaras, dictionary); 51 | 52 | // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // 53 | 54 | tmp SpalartAllmaras::chi() const 55 | { 56 | return nuTilda_/nu(); 57 | } 58 | 59 | 60 | tmp SpalartAllmaras::fv1(const volScalarField& chi) const 61 | { 62 | const volScalarField chi3(pow3(chi)); 63 | return chi3/(chi3 + pow3(Cv1_)); 64 | } 65 | 66 | 67 | tmp SpalartAllmaras::fv2 68 | ( 69 | const volScalarField& chi, 70 | const volScalarField& fv1 71 | ) const 72 | { 73 | return 1.0-chi/(scalar(1) + chi*fv1); 74 | //return 1.0/pow3(scalar(1) + chi/Cv2_); 75 | } 76 | 77 | /* 78 | tmp SpalartAllmaras::fv3 79 | ( 80 | const volScalarField& chi, 81 | const volScalarField& fv1 82 | ) const 83 | { 84 | const volScalarField chiByCv2((1/Cv2_)*chi); 85 | 86 | return 87 | (scalar(1) + chi*fv1) 88 | *(1/Cv2_) 89 | *(3*(scalar(1) + chiByCv2) + sqr(chiByCv2)) 90 | /pow3(scalar(1) + chiByCv2); 91 | } 92 | */ 93 | 94 | tmp SpalartAllmaras::fw(const volScalarField& Stilda) const 95 | { 96 | volScalarField r 97 | ( 98 | min 99 | ( 100 | nuTilda_ 101 | /( 102 | max 103 | ( 104 | Stilda, 105 | dimensionedScalar("SMALL", Stilda.dimensions(), SMALL) 106 | ) 107 | *sqr(kappa_*d_) 108 | ), 109 | scalar(10.0) 110 | ) 111 | ); 112 | r.boundaryField() == 0.0; 113 | 114 | const volScalarField g(r + Cw2_*(pow6(r) - r)); 115 | 116 | return g*pow((1.0 + pow6(Cw3_))/(pow6(g) + pow6(Cw3_)), 1.0/6.0); 117 | } 118 | 119 | 120 | // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // 121 | 122 | SpalartAllmaras::SpalartAllmaras 123 | ( 124 | const volVectorField& U, 125 | const surfaceScalarField& phi, 126 | transportModel& transport, 127 | const word& turbulenceModelName, 128 | const word& modelName 129 | ) 130 | : 131 | RASModel(modelName, U, phi, transport, turbulenceModelName), 132 | 133 | sigmaNut_ 134 | ( 135 | dimensioned::lookupOrAddToDict 136 | ( 137 | "sigmaNut", 138 | coeffDict_, 139 | 0.66666 140 | ) 141 | ), 142 | kappa_ 143 | ( 144 | dimensioned::lookupOrAddToDict 145 | ( 146 | "kappa", 147 | coeffDict_, 148 | 0.41 149 | ) 150 | ), 151 | 152 | Cb1_ 153 | ( 154 | dimensioned::lookupOrAddToDict 155 | ( 156 | "Cb1", 157 | coeffDict_, 158 | 0.1355 159 | ) 160 | ), 161 | Cb2_ 162 | ( 163 | dimensioned::lookupOrAddToDict 164 | ( 165 | "Cb2", 166 | coeffDict_, 167 | 0.622 168 | ) 169 | ), 170 | Cw1_(Cb1_/sqr(kappa_) + (1.0 + Cb2_)/sigmaNut_), 171 | Cw2_ 172 | ( 173 | dimensioned::lookupOrAddToDict 174 | ( 175 | "Cw2", 176 | coeffDict_, 177 | 0.3 178 | ) 179 | ), 180 | Cw3_ 181 | ( 182 | dimensioned::lookupOrAddToDict 183 | ( 184 | "Cw3", 185 | coeffDict_, 186 | 2.0 187 | ) 188 | ), 189 | Cv1_ 190 | ( 191 | dimensioned::lookupOrAddToDict 192 | ( 193 | "Cv1", 194 | coeffDict_, 195 | 7.1 196 | ) 197 | ), 198 | Cv2_ 199 | ( 200 | dimensioned::lookupOrAddToDict 201 | ( 202 | "Cv2", 203 | coeffDict_, 204 | 5.0 205 | ) 206 | ), 207 | 208 | nuTilda_ 209 | ( 210 | IOobject 211 | ( 212 | "nuTilda", 213 | runTime_.timeName(), 214 | mesh_, 215 | IOobject::MUST_READ, 216 | IOobject::AUTO_WRITE 217 | ), 218 | mesh_ 219 | ), 220 | 221 | nut_ 222 | ( 223 | IOobject 224 | ( 225 | "nut", 226 | runTime_.timeName(), 227 | mesh_, 228 | IOobject::MUST_READ, 229 | IOobject::AUTO_WRITE 230 | ), 231 | mesh_ 232 | ), 233 | 234 | d_(mesh_) 235 | { 236 | printCoeffs(); 237 | } 238 | 239 | 240 | // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // 241 | 242 | tmp SpalartAllmaras::DnuTildaEff(const volScalarField& chi) const 243 | { 244 | //New quantity fn (for negative-nuTilda Spalart-Allmaras model) 245 | volScalarField fn ( (16+pow3(chi))/(16-pow3(chi)) ); 246 | return tmp 247 | ( 248 | //new volScalarField("DnuTildaEff", (nuTilda_ + nu())/sigmaNut_) 249 | new volScalarField("DnuTildaEff", (nuTilda_ + nu()*(pos(nuTilda_)+(1-pos(nuTilda_))*fn))/sigmaNut_) 250 | ); 251 | } 252 | 253 | 254 | tmp SpalartAllmaras::k() const 255 | { 256 | WarningIn("tmp SpalartAllmaras::k() const") 257 | << "Turbulence kinetic energy not defined for Spalart-Allmaras model. " 258 | << "Returning zero field" << endl; 259 | 260 | return tmp 261 | ( 262 | new volScalarField 263 | ( 264 | IOobject 265 | ( 266 | "k", 267 | runTime_.timeName(), 268 | mesh_ 269 | ), 270 | mesh_, 271 | dimensionedScalar("0", dimensionSet(0, 2, -2, 0, 0), 0) 272 | ) 273 | ); 274 | } 275 | 276 | 277 | tmp SpalartAllmaras::epsilon() const 278 | { 279 | WarningIn("tmp SpalartAllmaras::epsilon() const") 280 | << "Turbulence kinetic energy dissipation rate not defined for " 281 | << "Spalart-Allmaras model. Returning zero field" 282 | << endl; 283 | 284 | return tmp 285 | ( 286 | new volScalarField 287 | ( 288 | IOobject 289 | ( 290 | "epsilon", 291 | runTime_.timeName(), 292 | mesh_ 293 | ), 294 | mesh_, 295 | dimensionedScalar("0", dimensionSet(0, 2, -3, 0, 0), 0) 296 | ) 297 | ); 298 | } 299 | 300 | 301 | tmp SpalartAllmaras::R() const 302 | { 303 | return tmp 304 | ( 305 | new volSymmTensorField 306 | ( 307 | IOobject 308 | ( 309 | "R", 310 | runTime_.timeName(), 311 | mesh_, 312 | IOobject::NO_READ, 313 | IOobject::NO_WRITE 314 | ), 315 | ((2.0/3.0)*I)*k() - nut()*twoSymm(fvc::grad(U_)) 316 | ) 317 | ); 318 | } 319 | 320 | 321 | tmp SpalartAllmaras::devReff() const 322 | { 323 | return tmp 324 | ( 325 | new volSymmTensorField 326 | ( 327 | IOobject 328 | ( 329 | "devRhoReff", 330 | runTime_.timeName(), 331 | mesh_, 332 | IOobject::NO_READ, 333 | IOobject::NO_WRITE 334 | ), 335 | -nuEff()*dev(twoSymm(fvc::grad(U_))) 336 | ) 337 | ); 338 | } 339 | 340 | 341 | tmp SpalartAllmaras::divDevReff(volVectorField& U) const 342 | { 343 | const volScalarField nuEff_(nuEff()); 344 | 345 | return 346 | ( 347 | - fvm::laplacian(nuEff_, U) 348 | - fvc::div(nuEff_*dev(T(fvc::grad(U)))) 349 | ); 350 | } 351 | 352 | 353 | tmp SpalartAllmaras::divDevRhoReff 354 | ( 355 | const volScalarField& rho, 356 | volVectorField& U 357 | ) const 358 | { 359 | volScalarField muEff("muEff", rho*nuEff()); 360 | 361 | return 362 | ( 363 | - fvm::laplacian(muEff, U) 364 | - fvc::div(muEff*dev(T(fvc::grad(U)))) 365 | ); 366 | } 367 | 368 | 369 | bool SpalartAllmaras::read() 370 | { 371 | if (RASModel::read()) 372 | { 373 | sigmaNut_.readIfPresent(coeffDict()); 374 | kappa_.readIfPresent(coeffDict()); 375 | 376 | Cb1_.readIfPresent(coeffDict()); 377 | Cb2_.readIfPresent(coeffDict()); 378 | Cw1_ = Cb1_/sqr(kappa_) + (1.0 + Cb2_)/sigmaNut_; 379 | Cw2_.readIfPresent(coeffDict()); 380 | Cw3_.readIfPresent(coeffDict()); 381 | Cv1_.readIfPresent(coeffDict()); 382 | Cv2_.readIfPresent(coeffDict()); 383 | 384 | return true; 385 | } 386 | else 387 | { 388 | return false; 389 | } 390 | } 391 | 392 | 393 | void SpalartAllmaras::correct() 394 | { 395 | RASModel::correct(); 396 | 397 | if (!turbulence_) 398 | { 399 | // Re-calculate viscosity 400 | nut_ = nuTilda_*fv1(this->chi()); 401 | nut_.correctBoundaryConditions(); 402 | 403 | return; 404 | } 405 | 406 | if (mesh_.changing()) 407 | { 408 | d_.correct(); 409 | } 410 | 411 | const volScalarField chi(this->chi()); 412 | const volScalarField fv1(this->fv1(chi)); 413 | //New quantities for Modified Vorticity Stilda 414 | volScalarField Smag ( sqrt(2.0)*mag(skew(fvc::grad(U_))) ); 415 | volScalarField Sbar ( fv2(chi, fv1)*nuTilda_/sqr(kappa_*d_) ); 416 | 417 | //START SARCM: New quantities for SARCM 418 | volScalarField SSmag ( sqrt(2.0)*mag(symm(fvc::grad(U_))) ); 419 | volScalarField rStar ( SSmag/Smag ); 420 | volScalarField rTilda ( (1-rStar)/(rStar*rStar) ); 421 | //Two sets of the three constants are included (respectively: the default, and another suggested by Qiang and Yong) 422 | //scalar Cr1=1,Cr2=12,Cr3=0.6; 423 | scalar Cr1=1,Cr2=2,Cr3=1; 424 | volScalarField fr1 ( 425 | (1+Cr1)*2*rStar/(rStar+1)*(1-Cr3*atan(Cr2*rTilda))-Cr1 426 | ); 427 | //END SARCM: Now have fr1 from SARCM to use in the production term. 428 | 429 | const volScalarField Stilda 430 | ( 431 | //New expression for Modified Vorticity Stilda 432 | Smag 433 | +pos(Sbar+0.7*Smag)*Sbar 434 | +(1-pos(Sbar+0.7*Smag))*Smag*(0.49*Smag+0.9*Sbar)/(-0.5*Smag-Sbar) 435 | /* 436 | //fv3(chi, fv1)*::sqrt(2.0)*mag(skew(fvc::grad(U_))) 437 | sqrt(2.0)*mag(skew(fvc::grad(U_))) 438 | + fv2(chi, fv1)*nuTilda_/sqr(kappa_*d_) 439 | */ 440 | ); 441 | 442 | 443 | tmp nuTildaEqn 444 | ( 445 | fvm::ddt(nuTilda_) 446 | + fvm::div(phi_, nuTilda_) 447 | //DnuTildaEff now requires chi for Negative SA Model 448 | - fvm::laplacian(DnuTildaEff(chi), nuTilda_) 449 | - Cb2_/sigmaNut_*magSqr(fvc::grad(nuTilda_)) 450 | == 451 | //New expression as part of Negative SA Model 452 | fr1*Cb1_*nuTilda_*(pos(nuTilda_)*Stilda+(1-pos(nuTilda_))*-0.2*Smag) 453 | - fvm::Sp(Cw1_*nuTilda_/sqr(d_)*(pos(nuTilda_)*fw(Stilda)-(1-pos(nuTilda_))), nuTilda_) 454 | // Cb1_*Stilda*nuTilda_ 455 | // - fvm::Sp(Cw1_*fw(Stilda)*nuTilda_/sqr(d_), nuTilda_) 456 | ); 457 | 458 | nuTildaEqn().relax(); 459 | solve(nuTildaEqn); 460 | bound(nuTilda_, dimensionedScalar("0", nuTilda_.dimensions(), 0.0)); 461 | nuTilda_.correctBoundaryConditions(); 462 | 463 | // Re-calculate viscosity 464 | nut_.internalField() = fv1*nuTilda_.internalField(); 465 | nut_.correctBoundaryConditions(); 466 | } 467 | 468 | 469 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 470 | 471 | } // End namespace RASModels 472 | } // End namespace incompressible 473 | } // End namespace Foam 474 | 475 | // ************************************************************************* // 476 | -------------------------------------------------------------------------------- /SpalartAllmaras2012SARCM/SpalartAllmaras.C~: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*\ 2 | ========= | 3 | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 4 | \\ / O peration | 5 | \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation 6 | \\/ M anipulation | 7 | ------------------------------------------------------------------------------- 8 | License 9 | This file is part of OpenFOAM. 10 | 11 | OpenFOAM is free software: you can redistribute it and/or modify it 12 | under the terms of the GNU General Public License as published by 13 | the Free Software Foundation, either version 3 of the License, or 14 | (at your option) any later version. 15 | 16 | OpenFOAM is distributed in the hope that it will be useful, but WITHOUT 17 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 18 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 19 | for more details. 20 | 21 | You should have received a copy of the GNU General Public License 22 | along with OpenFOAM. If not, see . 23 | 24 | \*---------------------------------------------------------------------------*/ 25 | 26 | /* 27 | This version is according to the 2012 paper by Allmaras, Johnson, and Spalart: 28 | "Modifications and Clarifications for the Implementation of the Spalart-Allmaras Turbulence Model", 29 | As well as the NASA Turbulence Modeling Resource Webpage on the Spalart-Allmaras Turbulence Model. 30 | In addition, a Rotation/Curvature Correction (RCC) method is applied, according to the 2012 paper by Qiang and Yong: 31 | "A New, Simpler Rotation/Curvature Correction Method for the Spalart-Allmaras Turbulence Model" 32 | The model with RCC applied is referred to as SARCM. 33 | */ 34 | 35 | #include "SpalartAllmaras.H" 36 | #include "addToRunTimeSelectionTable.H" 37 | 38 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 39 | 40 | namespace Foam 41 | { 42 | namespace incompressible 43 | { 44 | namespace RASModels 45 | { 46 | 47 | // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // 48 | 49 | defineTypeNameAndDebug(SpalartAllmaras, 0); 50 | addToRunTimeSelectionTable(RASModel, SpalartAllmaras, dictionary); 51 | 52 | // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // 53 | 54 | tmp SpalartAllmaras::chi() const 55 | { 56 | return nuTilda_/nu(); 57 | } 58 | 59 | 60 | tmp SpalartAllmaras::fv1(const volScalarField& chi) const 61 | { 62 | const volScalarField chi3(pow3(chi)); 63 | return chi3/(chi3 + pow3(Cv1_)); 64 | } 65 | 66 | 67 | tmp SpalartAllmaras::fv2 68 | ( 69 | const volScalarField& chi, 70 | const volScalarField& fv1 71 | ) const 72 | { 73 | return 1.0-chi/(scalar(1) + chi*fv1); 74 | //return 1.0/pow3(scalar(1) + chi/Cv2_); 75 | } 76 | 77 | /* 78 | tmp SpalartAllmaras::fv3 79 | ( 80 | const volScalarField& chi, 81 | const volScalarField& fv1 82 | ) const 83 | { 84 | const volScalarField chiByCv2((1/Cv2_)*chi); 85 | 86 | return 87 | (scalar(1) + chi*fv1) 88 | *(1/Cv2_) 89 | *(3*(scalar(1) + chiByCv2) + sqr(chiByCv2)) 90 | /pow3(scalar(1) + chiByCv2); 91 | } 92 | */ 93 | 94 | tmp SpalartAllmaras::fw(const volScalarField& Stilda) const 95 | { 96 | volScalarField r 97 | ( 98 | min 99 | ( 100 | nuTilda_ 101 | /( 102 | max 103 | ( 104 | Stilda, 105 | dimensionedScalar("SMALL", Stilda.dimensions(), SMALL) 106 | ) 107 | *sqr(kappa_*d_) 108 | ), 109 | scalar(10.0) 110 | ) 111 | ); 112 | r.boundaryField() == 0.0; 113 | 114 | const volScalarField g(r + Cw2_*(pow6(r) - r)); 115 | 116 | return g*pow((1.0 + pow6(Cw3_))/(pow6(g) + pow6(Cw3_)), 1.0/6.0); 117 | } 118 | 119 | 120 | // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // 121 | 122 | SpalartAllmaras::SpalartAllmaras 123 | ( 124 | const volVectorField& U, 125 | const surfaceScalarField& phi, 126 | transportModel& transport, 127 | const word& turbulenceModelName, 128 | const word& modelName 129 | ) 130 | : 131 | RASModel(modelName, U, phi, transport, turbulenceModelName), 132 | 133 | sigmaNut_ 134 | ( 135 | dimensioned::lookupOrAddToDict 136 | ( 137 | "sigmaNut", 138 | coeffDict_, 139 | 0.66666 140 | ) 141 | ), 142 | kappa_ 143 | ( 144 | dimensioned::lookupOrAddToDict 145 | ( 146 | "kappa", 147 | coeffDict_, 148 | 0.41 149 | ) 150 | ), 151 | 152 | Cb1_ 153 | ( 154 | dimensioned::lookupOrAddToDict 155 | ( 156 | "Cb1", 157 | coeffDict_, 158 | 0.1355 159 | ) 160 | ), 161 | Cb2_ 162 | ( 163 | dimensioned::lookupOrAddToDict 164 | ( 165 | "Cb2", 166 | coeffDict_, 167 | 0.622 168 | ) 169 | ), 170 | Cw1_(Cb1_/sqr(kappa_) + (1.0 + Cb2_)/sigmaNut_), 171 | Cw2_ 172 | ( 173 | dimensioned::lookupOrAddToDict 174 | ( 175 | "Cw2", 176 | coeffDict_, 177 | 0.3 178 | ) 179 | ), 180 | Cw3_ 181 | ( 182 | dimensioned::lookupOrAddToDict 183 | ( 184 | "Cw3", 185 | coeffDict_, 186 | 2.0 187 | ) 188 | ), 189 | Cv1_ 190 | ( 191 | dimensioned::lookupOrAddToDict 192 | ( 193 | "Cv1", 194 | coeffDict_, 195 | 7.1 196 | ) 197 | ), 198 | Cv2_ 199 | ( 200 | dimensioned::lookupOrAddToDict 201 | ( 202 | "Cv2", 203 | coeffDict_, 204 | 5.0 205 | ) 206 | ), 207 | 208 | nuTilda_ 209 | ( 210 | IOobject 211 | ( 212 | "nuTilda", 213 | runTime_.timeName(), 214 | mesh_, 215 | IOobject::MUST_READ, 216 | IOobject::AUTO_WRITE 217 | ), 218 | mesh_ 219 | ), 220 | 221 | nut_ 222 | ( 223 | IOobject 224 | ( 225 | "nut", 226 | runTime_.timeName(), 227 | mesh_, 228 | IOobject::MUST_READ, 229 | IOobject::AUTO_WRITE 230 | ), 231 | mesh_ 232 | ), 233 | 234 | d_(mesh_) 235 | { 236 | printCoeffs(); 237 | } 238 | 239 | 240 | // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // 241 | 242 | tmp SpalartAllmaras::DnuTildaEff(const volScalarField& chi) const 243 | { 244 | //New quantity fn (for negative-nuTilda Spalart-Allmaras model) 245 | volScalarField fn ( (16+pow3(chi))/(16-pow3(chi)) ); 246 | return tmp 247 | ( 248 | //new volScalarField("DnuTildaEff", (nuTilda_ + nu())/sigmaNut_) 249 | new volScalarField("DnuTildaEff", (nuTilda_ + nu()*(pos(nuTilda_)+(1-pos(nuTilda_))*fn))/sigmaNut_) 250 | ); 251 | } 252 | 253 | 254 | tmp SpalartAllmaras::k() const 255 | { 256 | WarningIn("tmp SpalartAllmaras::k() const") 257 | << "Turbulence kinetic energy not defined for Spalart-Allmaras model. " 258 | << "Returning zero field" << endl; 259 | 260 | return tmp 261 | ( 262 | new volScalarField 263 | ( 264 | IOobject 265 | ( 266 | "k", 267 | runTime_.timeName(), 268 | mesh_ 269 | ), 270 | mesh_, 271 | dimensionedScalar("0", dimensionSet(0, 2, -2, 0, 0), 0) 272 | ) 273 | ); 274 | } 275 | 276 | 277 | tmp SpalartAllmaras::epsilon() const 278 | { 279 | WarningIn("tmp SpalartAllmaras::epsilon() const") 280 | << "Turbulence kinetic energy dissipation rate not defined for " 281 | << "Spalart-Allmaras model. Returning zero field" 282 | << endl; 283 | 284 | return tmp 285 | ( 286 | new volScalarField 287 | ( 288 | IOobject 289 | ( 290 | "epsilon", 291 | runTime_.timeName(), 292 | mesh_ 293 | ), 294 | mesh_, 295 | dimensionedScalar("0", dimensionSet(0, 2, -3, 0, 0), 0) 296 | ) 297 | ); 298 | } 299 | 300 | 301 | tmp SpalartAllmaras::R() const 302 | { 303 | return tmp 304 | ( 305 | new volSymmTensorField 306 | ( 307 | IOobject 308 | ( 309 | "R", 310 | runTime_.timeName(), 311 | mesh_, 312 | IOobject::NO_READ, 313 | IOobject::NO_WRITE 314 | ), 315 | ((2.0/3.0)*I)*k() - nut()*twoSymm(fvc::grad(U_)) 316 | ) 317 | ); 318 | } 319 | 320 | 321 | tmp SpalartAllmaras::devReff() const 322 | { 323 | return tmp 324 | ( 325 | new volSymmTensorField 326 | ( 327 | IOobject 328 | ( 329 | "devRhoReff", 330 | runTime_.timeName(), 331 | mesh_, 332 | IOobject::NO_READ, 333 | IOobject::NO_WRITE 334 | ), 335 | -nuEff()*dev(twoSymm(fvc::grad(U_))) 336 | ) 337 | ); 338 | } 339 | 340 | 341 | tmp SpalartAllmaras::divDevReff(volVectorField& U) const 342 | { 343 | const volScalarField nuEff_(nuEff()); 344 | 345 | return 346 | ( 347 | - fvm::laplacian(nuEff_, U) 348 | - fvc::div(nuEff_*dev(T(fvc::grad(U)))) 349 | ); 350 | } 351 | 352 | 353 | tmp SpalartAllmaras::divDevRhoReff 354 | ( 355 | const volScalarField& rho, 356 | volVectorField& U 357 | ) const 358 | { 359 | volScalarField muEff("muEff", rho*nuEff()); 360 | 361 | return 362 | ( 363 | - fvm::laplacian(muEff, U) 364 | - fvc::div(muEff*dev(T(fvc::grad(U)))) 365 | ); 366 | } 367 | 368 | 369 | bool SpalartAllmaras::read() 370 | { 371 | if (RASModel::read()) 372 | { 373 | sigmaNut_.readIfPresent(coeffDict()); 374 | kappa_.readIfPresent(coeffDict()); 375 | 376 | Cb1_.readIfPresent(coeffDict()); 377 | Cb2_.readIfPresent(coeffDict()); 378 | Cw1_ = Cb1_/sqr(kappa_) + (1.0 + Cb2_)/sigmaNut_; 379 | Cw2_.readIfPresent(coeffDict()); 380 | Cw3_.readIfPresent(coeffDict()); 381 | Cv1_.readIfPresent(coeffDict()); 382 | Cv2_.readIfPresent(coeffDict()); 383 | 384 | return true; 385 | } 386 | else 387 | { 388 | return false; 389 | } 390 | } 391 | 392 | 393 | void SpalartAllmaras::correct() 394 | { 395 | RASModel::correct(); 396 | 397 | if (!turbulence_) 398 | { 399 | // Re-calculate viscosity 400 | nut_ = nuTilda_*fv1(this->chi()); 401 | nut_.correctBoundaryConditions(); 402 | 403 | return; 404 | } 405 | 406 | if (mesh_.changing()) 407 | { 408 | d_.correct(); 409 | } 410 | 411 | const volScalarField chi(this->chi()); 412 | const volScalarField fv1(this->fv1(chi)); 413 | //New quantities for Modified Vorticity Stilda 414 | volScalarField Smag ( sqrt(2.0)*mag(skew(fvc::grad(U_))) ); 415 | volScalarField Sbar ( fv2(chi, fv1)*nuTilda_/sqr(kappa_*d_) ); 416 | 417 | //START SARCM: New quantities for SARCM 418 | volScalarField SSmag ( sqrt(2.0)*mag(symm(fvc::grad(U_))) ); 419 | volScalarField rStar ( SSmag/Smag ); 420 | volScalarField rTilda ( (1-rStar)/(rStar*rStar) ); 421 | //Two sets of the three constants are included (respectively: the default, and another suggested by Qiang and Yong) 422 | //scalar Cr1=1,Cr2=12,Cr3=0.6; 423 | scalar Cr1=1,Cr2=2,Cr3=1; 424 | volScalarField fr1 ( 425 | (1+Cr1)*2*rStar/(rStar+1)*(1-Cr3*atan(Cr2*rTilda))-Cr1 426 | ); 427 | //END SARCM: Now have fr1 from SARCM to use in the production term. 428 | 429 | const volScalarField Stilda 430 | ( 431 | //New expression for Modified Vorticity Stilda 432 | Smag 433 | +pos(Sbar+0.7*Smag)*Sbar 434 | +(1-pos(Sbar+0.7*Smag))*Smag*(0.49*Smag+0.9*Sbar)/(-0.5*Smag-Sbar) 435 | /* 436 | //fv3(chi, fv1)*::sqrt(2.0)*mag(skew(fvc::grad(U_))) 437 | sqrt(2.0)*mag(skew(fvc::grad(U_))) 438 | + fv2(chi, fv1)*nuTilda_/sqr(kappa_*d_) 439 | */ 440 | ); 441 | 442 | 443 | tmp nuTildaEqn 444 | ( 445 | fvm::ddt(nuTilda_) 446 | + fvm::div(phi_, nuTilda_) 447 | //DnuTildaEff now requires chi for Negative SA Model 448 | - fvm::laplacian(DnuTildaEff(chi), nuTilda_) 449 | - Cb2_/sigmaNut_*magSqr(fvc::grad(nuTilda_)) 450 | == 451 | //New expression as part of Negative SA Model 452 | fr1*Cb1_*nuTilda_*(pos(nuTilda_)*Stilda+(1-pos(nuTilda_))*-0.2*Smag) 453 | - fvm::Sp(Cw1_*nuTilda_/sqr(d_)*(pos(nuTilda_)*fw(Stilda)-(1-pos(nuTilda_))), nuTilda_) 454 | // Cb1_*Stilda*nuTilda_ 455 | // - fvm::Sp(Cw1_*fw(Stilda)*nuTilda_/sqr(d_), nuTilda_) 456 | ); 457 | 458 | nuTildaEqn().relax(); 459 | solve(nuTildaEqn); 460 | bound(nuTilda_, dimensionedScalar("0", nuTilda_.dimensions(), 0.0)); 461 | nuTilda_.correctBoundaryConditions(); 462 | 463 | // Re-calculate viscosity 464 | nut_.internalField() = fv1*nuTilda_.internalField(); 465 | nut_.correctBoundaryConditions(); 466 | } 467 | 468 | 469 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 470 | 471 | } // End namespace RASModels 472 | } // End namespace incompressible 473 | } // End namespace Foam 474 | 475 | // ************************************************************************* // 476 | -------------------------------------------------------------------------------- /SpalartAllmaras2012SARCM/SpalartAllmaras.H: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*\ 2 | ========= | 3 | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 4 | \\ / O peration | 5 | \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation 6 | \\/ M anipulation | 7 | ------------------------------------------------------------------------------- 8 | License 9 | This file is part of OpenFOAM. 10 | 11 | OpenFOAM is free software: you can redistribute it and/or modify it 12 | under the terms of the GNU General Public License as published by 13 | the Free Software Foundation, either version 3 of the License, or 14 | (at your option) any later version. 15 | 16 | OpenFOAM is distributed in the hope that it will be useful, but WITHOUT 17 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 18 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 19 | for more details. 20 | 21 | You should have received a copy of the GNU General Public License 22 | along with OpenFOAM. If not, see . 23 | 24 | Class 25 | Foam::incompressible::RASModels::SpalartAllmaras 26 | 27 | Group 28 | grpIcoRASTurbulence 29 | 30 | Description 31 | Spalart-Allmaras 1-eqn mixing-length model for incompressible external 32 | flows. 33 | 34 | References: 35 | \verbatim 36 | "A One-Equation Turbulence Model for Aerodynamic Flows" 37 | P.R. Spalart, 38 | S.R. Allmaras, 39 | La Recherche Aerospatiale, No. 1, 1994, pp. 5-21. 40 | 41 | Extended according to: 42 | 43 | "An Unstructured Grid Generation and Adaptive Solution Technique 44 | for High Reynolds Number Compressible Flows" 45 | G.A. Ashford, 46 | Ph.D. thesis, University of Michigan, 1996. 47 | \endverbatim 48 | 49 | The default model coefficients correspond to the following: 50 | \verbatim 51 | SpalartAllmarasCoeffs 52 | { 53 | Cb1 0.1355; 54 | Cb2 0.622; 55 | Cw2 0.3; 56 | Cw3 2.0; 57 | Cv1 7.1; 58 | Cv2 5.0; 59 | sigmaNut 0.66666; 60 | kappa 0.41; 61 | } 62 | \endverbatim 63 | 64 | SourceFiles 65 | SpalartAllmaras.C 66 | 67 | \*---------------------------------------------------------------------------*/ 68 | 69 | #ifndef SpalartAllmaras_H 70 | #define SpalartAllmaras_H 71 | 72 | #include "RASModel.H" 73 | #include "wallDist.H" 74 | 75 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 76 | 77 | namespace Foam 78 | { 79 | namespace incompressible 80 | { 81 | namespace RASModels 82 | { 83 | 84 | /*---------------------------------------------------------------------------*\ 85 | Class SpalartAllmaras Declaration 86 | \*---------------------------------------------------------------------------*/ 87 | 88 | class SpalartAllmaras 89 | : 90 | public RASModel 91 | { 92 | 93 | protected: 94 | 95 | // Protected data 96 | 97 | // Model coefficients 98 | 99 | dimensionedScalar sigmaNut_; 100 | dimensionedScalar kappa_; 101 | 102 | dimensionedScalar Cb1_; 103 | dimensionedScalar Cb2_; 104 | dimensionedScalar Cw1_; 105 | dimensionedScalar Cw2_; 106 | dimensionedScalar Cw3_; 107 | dimensionedScalar Cv1_; 108 | dimensionedScalar Cv2_; 109 | 110 | 111 | // Fields 112 | 113 | volScalarField nuTilda_; 114 | volScalarField nut_; 115 | 116 | wallDist d_; 117 | 118 | 119 | // Protected Member Functions 120 | 121 | tmp chi() const; 122 | 123 | tmp fv1(const volScalarField& chi) const; 124 | 125 | tmp fv2 126 | ( 127 | const volScalarField& chi, 128 | const volScalarField& fv1 129 | ) const; 130 | 131 | tmp fv3 132 | ( 133 | const volScalarField& chi, 134 | const volScalarField& fv1 135 | ) const; 136 | 137 | tmp fw(const volScalarField& Stilda) const; 138 | 139 | 140 | public: 141 | 142 | //- Runtime type information 143 | TypeName("SpalartAllmaras"); 144 | 145 | 146 | // Constructors 147 | 148 | //- Construct from components 149 | SpalartAllmaras 150 | ( 151 | const volVectorField& U, 152 | const surfaceScalarField& phi, 153 | transportModel& transport, 154 | const word& turbulenceModelName = turbulenceModel::typeName, 155 | const word& modelName = typeName 156 | ); 157 | 158 | 159 | //- Destructor 160 | virtual ~SpalartAllmaras() 161 | {} 162 | 163 | 164 | // Member Functions 165 | 166 | //- Return the turbulence viscosity 167 | virtual tmp nut() const 168 | { 169 | return nut_; 170 | } 171 | 172 | //- Return the effective diffusivity for nuTilda 173 | //DnuTildaEff now requires chi for Negative SA Model 174 | tmp DnuTildaEff(const volScalarField& chi) const; 175 | //tmp DnuTildaEff() const; 176 | 177 | //- Return the turbulence kinetic energy 178 | virtual tmp k() const; 179 | 180 | //- Return the turbulence kinetic energy dissipation rate 181 | virtual tmp epsilon() const; 182 | 183 | //- Return the Reynolds stress tensor 184 | virtual tmp R() const; 185 | 186 | //- Return the effective stress tensor including the laminar stress 187 | virtual tmp devReff() const; 188 | 189 | //- Return the source term for the momentum equation 190 | virtual tmp divDevReff(volVectorField& U) const; 191 | 192 | //- Return the source term for the momentum equation 193 | virtual tmp divDevRhoReff 194 | ( 195 | const volScalarField& rho, 196 | volVectorField& U 197 | ) const; 198 | 199 | //- Solve the turbulence equations and correct the turbulence viscosity 200 | virtual void correct(); 201 | 202 | //- Read RASProperties dictionary 203 | virtual bool read(); 204 | }; 205 | 206 | 207 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 208 | 209 | } // End namespace RASModels 210 | } // End namespace incompressible 211 | } // End namespace Foam 212 | 213 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 214 | 215 | #endif 216 | 217 | // ************************************************************************* // 218 | -------------------------------------------------------------------------------- /SpalartAllmaras2012SARCM/SpalartAllmaras.H~: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*\ 2 | ========= | 3 | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 4 | \\ / O peration | 5 | \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation 6 | \\/ M anipulation | 7 | ------------------------------------------------------------------------------- 8 | License 9 | This file is part of OpenFOAM. 10 | 11 | OpenFOAM is free software: you can redistribute it and/or modify it 12 | under the terms of the GNU General Public License as published by 13 | the Free Software Foundation, either version 3 of the License, or 14 | (at your option) any later version. 15 | 16 | OpenFOAM is distributed in the hope that it will be useful, but WITHOUT 17 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 18 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 19 | for more details. 20 | 21 | You should have received a copy of the GNU General Public License 22 | along with OpenFOAM. If not, see . 23 | 24 | Class 25 | Foam::incompressible::RASModels::SpalartAllmaras 26 | 27 | Group 28 | grpIcoRASTurbulence 29 | 30 | Description 31 | Spalart-Allmaras 1-eqn mixing-length model for incompressible external 32 | flows. 33 | 34 | References: 35 | \verbatim 36 | "A One-Equation Turbulence Model for Aerodynamic Flows" 37 | P.R. Spalart, 38 | S.R. Allmaras, 39 | La Recherche Aerospatiale, No. 1, 1994, pp. 5-21. 40 | 41 | Extended according to: 42 | 43 | "An Unstructured Grid Generation and Adaptive Solution Technique 44 | for High Reynolds Number Compressible Flows" 45 | G.A. Ashford, 46 | Ph.D. thesis, University of Michigan, 1996. 47 | \endverbatim 48 | 49 | The default model coefficients correspond to the following: 50 | \verbatim 51 | SpalartAllmarasCoeffs 52 | { 53 | Cb1 0.1355; 54 | Cb2 0.622; 55 | Cw2 0.3; 56 | Cw3 2.0; 57 | Cv1 7.1; 58 | Cv2 5.0; 59 | sigmaNut 0.66666; 60 | kappa 0.41; 61 | } 62 | \endverbatim 63 | 64 | SourceFiles 65 | SpalartAllmaras.C 66 | 67 | \*---------------------------------------------------------------------------*/ 68 | 69 | #ifndef SpalartAllmaras_H 70 | #define SpalartAllmaras_H 71 | 72 | #include "RASModel.H" 73 | #include "wallDist.H" 74 | 75 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 76 | 77 | namespace Foam 78 | { 79 | namespace incompressible 80 | { 81 | namespace RASModels 82 | { 83 | 84 | /*---------------------------------------------------------------------------*\ 85 | Class SpalartAllmaras Declaration 86 | \*---------------------------------------------------------------------------*/ 87 | 88 | class SpalartAllmaras 89 | : 90 | public RASModel 91 | { 92 | 93 | protected: 94 | 95 | // Protected data 96 | 97 | // Model coefficients 98 | 99 | dimensionedScalar sigmaNut_; 100 | dimensionedScalar kappa_; 101 | 102 | dimensionedScalar Cb1_; 103 | dimensionedScalar Cb2_; 104 | dimensionedScalar Cw1_; 105 | dimensionedScalar Cw2_; 106 | dimensionedScalar Cw3_; 107 | dimensionedScalar Cv1_; 108 | dimensionedScalar Cv2_; 109 | 110 | 111 | // Fields 112 | 113 | volScalarField nuTilda_; 114 | volScalarField nut_; 115 | 116 | wallDist d_; 117 | 118 | 119 | // Protected Member Functions 120 | 121 | tmp chi() const; 122 | 123 | tmp fv1(const volScalarField& chi) const; 124 | 125 | tmp fv2 126 | ( 127 | const volScalarField& chi, 128 | const volScalarField& fv1 129 | ) const; 130 | 131 | tmp fv3 132 | ( 133 | const volScalarField& chi, 134 | const volScalarField& fv1 135 | ) const; 136 | 137 | tmp fw(const volScalarField& Stilda) const; 138 | 139 | 140 | public: 141 | 142 | //- Runtime type information 143 | TypeName("SpalartAllmaras"); 144 | 145 | 146 | // Constructors 147 | 148 | //- Construct from components 149 | SpalartAllmaras 150 | ( 151 | const volVectorField& U, 152 | const surfaceScalarField& phi, 153 | transportModel& transport, 154 | const word& turbulenceModelName = turbulenceModel::typeName, 155 | const word& modelName = typeName 156 | ); 157 | 158 | 159 | //- Destructor 160 | virtual ~SpalartAllmaras() 161 | {} 162 | 163 | 164 | // Member Functions 165 | 166 | //- Return the turbulence viscosity 167 | virtual tmp nut() const 168 | { 169 | return nut_; 170 | } 171 | 172 | //- Return the effective diffusivity for nuTilda 173 | //DnuTildaEff now requires chi for Negative SA Model 174 | tmp DnuTildaEff(const volScalarField& chi) const; 175 | //tmp DnuTildaEff() const; 176 | 177 | //- Return the turbulence kinetic energy 178 | virtual tmp k() const; 179 | 180 | //- Return the turbulence kinetic energy dissipation rate 181 | virtual tmp epsilon() const; 182 | 183 | //- Return the Reynolds stress tensor 184 | virtual tmp R() const; 185 | 186 | //- Return the effective stress tensor including the laminar stress 187 | virtual tmp devReff() const; 188 | 189 | //- Return the source term for the momentum equation 190 | virtual tmp divDevReff(volVectorField& U) const; 191 | 192 | //- Return the source term for the momentum equation 193 | virtual tmp divDevRhoReff 194 | ( 195 | const volScalarField& rho, 196 | volVectorField& U 197 | ) const; 198 | 199 | //- Solve the turbulence equations and correct the turbulence viscosity 200 | virtual void correct(); 201 | 202 | //- Read RASProperties dictionary 203 | virtual bool read(); 204 | }; 205 | 206 | 207 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 208 | 209 | } // End namespace RASModels 210 | } // End namespace incompressible 211 | } // End namespace Foam 212 | 213 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 214 | 215 | #endif 216 | 217 | // ************************************************************************* // 218 | -------------------------------------------------------------------------------- /SpalartAllmarasOpenFOAM2.2/SpalartAllmaras.C: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*\ 2 | ========= | 3 | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 4 | \\ / O peration | 5 | \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation 6 | \\/ M anipulation | 7 | ------------------------------------------------------------------------------- 8 | License 9 | This file is part of OpenFOAM. 10 | 11 | OpenFOAM is free software: you can redistribute it and/or modify it 12 | under the terms of the GNU General Public License as published by 13 | the Free Software Foundation, either version 3 of the License, or 14 | (at your option) any later version. 15 | 16 | OpenFOAM is distributed in the hope that it will be useful, but WITHOUT 17 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 18 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 19 | for more details. 20 | 21 | You should have received a copy of the GNU General Public License 22 | along with OpenFOAM. If not, see . 23 | 24 | \*---------------------------------------------------------------------------*/ 25 | 26 | #include "SpalartAllmaras.H" 27 | #include "addToRunTimeSelectionTable.H" 28 | 29 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 30 | 31 | namespace Foam 32 | { 33 | namespace incompressible 34 | { 35 | namespace RASModels 36 | { 37 | 38 | // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // 39 | 40 | defineTypeNameAndDebug(SpalartAllmaras, 0); 41 | addToRunTimeSelectionTable(RASModel, SpalartAllmaras, dictionary); 42 | 43 | // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // 44 | 45 | tmp SpalartAllmaras::chi() const 46 | { 47 | return nuTilda_/nu(); 48 | } 49 | 50 | 51 | tmp SpalartAllmaras::fv1(const volScalarField& chi) const 52 | { 53 | const volScalarField chi3(pow3(chi)); 54 | return chi3/(chi3 + pow3(Cv1_)); 55 | } 56 | 57 | 58 | tmp SpalartAllmaras::fv2 59 | ( 60 | const volScalarField& chi, 61 | const volScalarField& fv1 62 | ) const 63 | { 64 | return 1.0/pow3(scalar(1) + chi/Cv2_); 65 | } 66 | 67 | 68 | tmp SpalartAllmaras::fv3 69 | ( 70 | const volScalarField& chi, 71 | const volScalarField& fv1 72 | ) const 73 | { 74 | const volScalarField chiByCv2((1/Cv2_)*chi); 75 | 76 | return 77 | (scalar(1) + chi*fv1) 78 | *(1/Cv2_) 79 | *(3*(scalar(1) + chiByCv2) + sqr(chiByCv2)) 80 | /pow3(scalar(1) + chiByCv2); 81 | } 82 | 83 | 84 | tmp SpalartAllmaras::fw(const volScalarField& Stilda) const 85 | { 86 | volScalarField r 87 | ( 88 | min 89 | ( 90 | nuTilda_ 91 | /( 92 | max 93 | ( 94 | Stilda, 95 | dimensionedScalar("SMALL", Stilda.dimensions(), SMALL) 96 | ) 97 | *sqr(kappa_*d_) 98 | ), 99 | scalar(10.0) 100 | ) 101 | ); 102 | r.boundaryField() == 0.0; 103 | 104 | const volScalarField g(r + Cw2_*(pow6(r) - r)); 105 | 106 | return g*pow((1.0 + pow6(Cw3_))/(pow6(g) + pow6(Cw3_)), 1.0/6.0); 107 | } 108 | 109 | 110 | // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // 111 | 112 | SpalartAllmaras::SpalartAllmaras 113 | ( 114 | const volVectorField& U, 115 | const surfaceScalarField& phi, 116 | transportModel& transport, 117 | const word& turbulenceModelName, 118 | const word& modelName 119 | ) 120 | : 121 | RASModel(modelName, U, phi, transport, turbulenceModelName), 122 | 123 | sigmaNut_ 124 | ( 125 | dimensioned::lookupOrAddToDict 126 | ( 127 | "sigmaNut", 128 | coeffDict_, 129 | 0.66666 130 | ) 131 | ), 132 | kappa_ 133 | ( 134 | dimensioned::lookupOrAddToDict 135 | ( 136 | "kappa", 137 | coeffDict_, 138 | 0.41 139 | ) 140 | ), 141 | 142 | Cb1_ 143 | ( 144 | dimensioned::lookupOrAddToDict 145 | ( 146 | "Cb1", 147 | coeffDict_, 148 | 0.1355 149 | ) 150 | ), 151 | Cb2_ 152 | ( 153 | dimensioned::lookupOrAddToDict 154 | ( 155 | "Cb2", 156 | coeffDict_, 157 | 0.622 158 | ) 159 | ), 160 | Cw1_(Cb1_/sqr(kappa_) + (1.0 + Cb2_)/sigmaNut_), 161 | Cw2_ 162 | ( 163 | dimensioned::lookupOrAddToDict 164 | ( 165 | "Cw2", 166 | coeffDict_, 167 | 0.3 168 | ) 169 | ), 170 | Cw3_ 171 | ( 172 | dimensioned::lookupOrAddToDict 173 | ( 174 | "Cw3", 175 | coeffDict_, 176 | 2.0 177 | ) 178 | ), 179 | Cv1_ 180 | ( 181 | dimensioned::lookupOrAddToDict 182 | ( 183 | "Cv1", 184 | coeffDict_, 185 | 7.1 186 | ) 187 | ), 188 | Cv2_ 189 | ( 190 | dimensioned::lookupOrAddToDict 191 | ( 192 | "Cv2", 193 | coeffDict_, 194 | 5.0 195 | ) 196 | ), 197 | 198 | nuTilda_ 199 | ( 200 | IOobject 201 | ( 202 | "nuTilda", 203 | runTime_.timeName(), 204 | mesh_, 205 | IOobject::MUST_READ, 206 | IOobject::AUTO_WRITE 207 | ), 208 | mesh_ 209 | ), 210 | 211 | nut_ 212 | ( 213 | IOobject 214 | ( 215 | "nut", 216 | runTime_.timeName(), 217 | mesh_, 218 | IOobject::MUST_READ, 219 | IOobject::AUTO_WRITE 220 | ), 221 | mesh_ 222 | ), 223 | 224 | d_(mesh_) 225 | { 226 | printCoeffs(); 227 | } 228 | 229 | 230 | // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // 231 | 232 | tmp SpalartAllmaras::DnuTildaEff() const 233 | { 234 | return tmp 235 | ( 236 | new volScalarField("DnuTildaEff", (nuTilda_ + nu())/sigmaNut_) 237 | ); 238 | } 239 | 240 | 241 | tmp SpalartAllmaras::k() const 242 | { 243 | WarningIn("tmp SpalartAllmaras::k() const") 244 | << "Turbulence kinetic energy not defined for Spalart-Allmaras model. " 245 | << "Returning zero field" << endl; 246 | 247 | return tmp 248 | ( 249 | new volScalarField 250 | ( 251 | IOobject 252 | ( 253 | "k", 254 | runTime_.timeName(), 255 | mesh_ 256 | ), 257 | mesh_, 258 | dimensionedScalar("0", dimensionSet(0, 2, -2, 0, 0), 0) 259 | ) 260 | ); 261 | } 262 | 263 | 264 | tmp SpalartAllmaras::epsilon() const 265 | { 266 | WarningIn("tmp SpalartAllmaras::epsilon() const") 267 | << "Turbulence kinetic energy dissipation rate not defined for " 268 | << "Spalart-Allmaras model. Returning zero field" 269 | << endl; 270 | 271 | return tmp 272 | ( 273 | new volScalarField 274 | ( 275 | IOobject 276 | ( 277 | "epsilon", 278 | runTime_.timeName(), 279 | mesh_ 280 | ), 281 | mesh_, 282 | dimensionedScalar("0", dimensionSet(0, 2, -3, 0, 0), 0) 283 | ) 284 | ); 285 | } 286 | 287 | 288 | tmp SpalartAllmaras::R() const 289 | { 290 | return tmp 291 | ( 292 | new volSymmTensorField 293 | ( 294 | IOobject 295 | ( 296 | "R", 297 | runTime_.timeName(), 298 | mesh_, 299 | IOobject::NO_READ, 300 | IOobject::NO_WRITE 301 | ), 302 | ((2.0/3.0)*I)*k() - nut()*twoSymm(fvc::grad(U_)) 303 | ) 304 | ); 305 | } 306 | 307 | 308 | tmp SpalartAllmaras::devReff() const 309 | { 310 | return tmp 311 | ( 312 | new volSymmTensorField 313 | ( 314 | IOobject 315 | ( 316 | "devRhoReff", 317 | runTime_.timeName(), 318 | mesh_, 319 | IOobject::NO_READ, 320 | IOobject::NO_WRITE 321 | ), 322 | -nuEff()*dev(twoSymm(fvc::grad(U_))) 323 | ) 324 | ); 325 | } 326 | 327 | 328 | tmp SpalartAllmaras::divDevReff(volVectorField& U) const 329 | { 330 | const volScalarField nuEff_(nuEff()); 331 | 332 | return 333 | ( 334 | - fvm::laplacian(nuEff_, U) 335 | - fvc::div(nuEff_*dev(T(fvc::grad(U)))) 336 | ); 337 | } 338 | 339 | 340 | tmp SpalartAllmaras::divDevRhoReff 341 | ( 342 | const volScalarField& rho, 343 | volVectorField& U 344 | ) const 345 | { 346 | volScalarField muEff("muEff", rho*nuEff()); 347 | 348 | return 349 | ( 350 | - fvm::laplacian(muEff, U) 351 | - fvc::div(muEff*dev(T(fvc::grad(U)))) 352 | ); 353 | } 354 | 355 | 356 | bool SpalartAllmaras::read() 357 | { 358 | if (RASModel::read()) 359 | { 360 | sigmaNut_.readIfPresent(coeffDict()); 361 | kappa_.readIfPresent(coeffDict()); 362 | 363 | Cb1_.readIfPresent(coeffDict()); 364 | Cb2_.readIfPresent(coeffDict()); 365 | Cw1_ = Cb1_/sqr(kappa_) + (1.0 + Cb2_)/sigmaNut_; 366 | Cw2_.readIfPresent(coeffDict()); 367 | Cw3_.readIfPresent(coeffDict()); 368 | Cv1_.readIfPresent(coeffDict()); 369 | Cv2_.readIfPresent(coeffDict()); 370 | 371 | return true; 372 | } 373 | else 374 | { 375 | return false; 376 | } 377 | } 378 | 379 | 380 | void SpalartAllmaras::correct() 381 | { 382 | RASModel::correct(); 383 | 384 | if (!turbulence_) 385 | { 386 | // Re-calculate viscosity 387 | nut_ = nuTilda_*fv1(this->chi()); 388 | nut_.correctBoundaryConditions(); 389 | 390 | return; 391 | } 392 | 393 | if (mesh_.changing()) 394 | { 395 | d_.correct(); 396 | } 397 | 398 | const volScalarField chi(this->chi()); 399 | const volScalarField fv1(this->fv1(chi)); 400 | 401 | const volScalarField Stilda 402 | ( 403 | fv3(chi, fv1)*::sqrt(2.0)*mag(skew(fvc::grad(U_))) 404 | + fv2(chi, fv1)*nuTilda_/sqr(kappa_*d_) 405 | ); 406 | 407 | tmp nuTildaEqn 408 | ( 409 | fvm::ddt(nuTilda_) 410 | + fvm::div(phi_, nuTilda_) 411 | - fvm::laplacian(DnuTildaEff(), nuTilda_) 412 | - Cb2_/sigmaNut_*magSqr(fvc::grad(nuTilda_)) 413 | == 414 | Cb1_*Stilda*nuTilda_ 415 | - fvm::Sp(Cw1_*fw(Stilda)*nuTilda_/sqr(d_), nuTilda_) 416 | ); 417 | 418 | nuTildaEqn().relax(); 419 | solve(nuTildaEqn); 420 | bound(nuTilda_, dimensionedScalar("0", nuTilda_.dimensions(), 0.0)); 421 | nuTilda_.correctBoundaryConditions(); 422 | 423 | // Re-calculate viscosity 424 | nut_.internalField() = fv1*nuTilda_.internalField(); 425 | nut_.correctBoundaryConditions(); 426 | } 427 | 428 | 429 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 430 | 431 | } // End namespace RASModels 432 | } // End namespace incompressible 433 | } // End namespace Foam 434 | 435 | // ************************************************************************* // 436 | -------------------------------------------------------------------------------- /SpalartAllmarasOpenFOAM2.2/SpalartAllmaras.C~: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openfoamtutorials/OpenFOAM_Additions/ff602cb8ef49269ddcea47d40451c153526a5696/SpalartAllmarasOpenFOAM2.2/SpalartAllmaras.C~ -------------------------------------------------------------------------------- /SpalartAllmarasOpenFOAM2.2/SpalartAllmaras.H: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*\ 2 | ========= | 3 | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 4 | \\ / O peration | 5 | \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation 6 | \\/ M anipulation | 7 | ------------------------------------------------------------------------------- 8 | License 9 | This file is part of OpenFOAM. 10 | 11 | OpenFOAM is free software: you can redistribute it and/or modify it 12 | under the terms of the GNU General Public License as published by 13 | the Free Software Foundation, either version 3 of the License, or 14 | (at your option) any later version. 15 | 16 | OpenFOAM is distributed in the hope that it will be useful, but WITHOUT 17 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 18 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 19 | for more details. 20 | 21 | You should have received a copy of the GNU General Public License 22 | along with OpenFOAM. If not, see . 23 | 24 | Class 25 | Foam::incompressible::RASModels::SpalartAllmaras 26 | 27 | Group 28 | grpIcoRASTurbulence 29 | 30 | Description 31 | Spalart-Allmaras 1-eqn mixing-length model for incompressible external 32 | flows. 33 | 34 | References: 35 | \verbatim 36 | "A One-Equation Turbulence Model for Aerodynamic Flows" 37 | P.R. Spalart, 38 | S.R. Allmaras, 39 | La Recherche Aerospatiale, No. 1, 1994, pp. 5-21. 40 | 41 | Extended according to: 42 | 43 | "An Unstructured Grid Generation and Adaptive Solution Technique 44 | for High Reynolds Number Compressible Flows" 45 | G.A. Ashford, 46 | Ph.D. thesis, University of Michigan, 1996. 47 | \endverbatim 48 | 49 | The default model coefficients correspond to the following: 50 | \verbatim 51 | SpalartAllmarasCoeffs 52 | { 53 | Cb1 0.1355; 54 | Cb2 0.622; 55 | Cw2 0.3; 56 | Cw3 2.0; 57 | Cv1 7.1; 58 | Cv2 5.0; 59 | sigmaNut 0.66666; 60 | kappa 0.41; 61 | } 62 | \endverbatim 63 | 64 | SourceFiles 65 | SpalartAllmaras.C 66 | 67 | \*---------------------------------------------------------------------------*/ 68 | 69 | #ifndef SpalartAllmaras_H 70 | #define SpalartAllmaras_H 71 | 72 | #include "RASModel.H" 73 | #include "wallDist.H" 74 | 75 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 76 | 77 | namespace Foam 78 | { 79 | namespace incompressible 80 | { 81 | namespace RASModels 82 | { 83 | 84 | /*---------------------------------------------------------------------------*\ 85 | Class SpalartAllmaras Declaration 86 | \*---------------------------------------------------------------------------*/ 87 | 88 | class SpalartAllmaras 89 | : 90 | public RASModel 91 | { 92 | 93 | protected: 94 | 95 | // Protected data 96 | 97 | // Model coefficients 98 | 99 | dimensionedScalar sigmaNut_; 100 | dimensionedScalar kappa_; 101 | 102 | dimensionedScalar Cb1_; 103 | dimensionedScalar Cb2_; 104 | dimensionedScalar Cw1_; 105 | dimensionedScalar Cw2_; 106 | dimensionedScalar Cw3_; 107 | dimensionedScalar Cv1_; 108 | dimensionedScalar Cv2_; 109 | 110 | 111 | // Fields 112 | 113 | volScalarField nuTilda_; 114 | volScalarField nut_; 115 | 116 | wallDist d_; 117 | 118 | 119 | // Protected Member Functions 120 | 121 | tmp chi() const; 122 | 123 | tmp fv1(const volScalarField& chi) const; 124 | 125 | tmp fv2 126 | ( 127 | const volScalarField& chi, 128 | const volScalarField& fv1 129 | ) const; 130 | 131 | tmp fv3 132 | ( 133 | const volScalarField& chi, 134 | const volScalarField& fv1 135 | ) const; 136 | 137 | tmp fw(const volScalarField& Stilda) const; 138 | 139 | 140 | public: 141 | 142 | //- Runtime type information 143 | TypeName("SpalartAllmaras"); 144 | 145 | 146 | // Constructors 147 | 148 | //- Construct from components 149 | SpalartAllmaras 150 | ( 151 | const volVectorField& U, 152 | const surfaceScalarField& phi, 153 | transportModel& transport, 154 | const word& turbulenceModelName = turbulenceModel::typeName, 155 | const word& modelName = typeName 156 | ); 157 | 158 | 159 | //- Destructor 160 | virtual ~SpalartAllmaras() 161 | {} 162 | 163 | 164 | // Member Functions 165 | 166 | //- Return the turbulence viscosity 167 | virtual tmp nut() const 168 | { 169 | return nut_; 170 | } 171 | 172 | //- Return the effective diffusivity for nuTilda 173 | tmp DnuTildaEff() const; 174 | 175 | //- Return the turbulence kinetic energy 176 | virtual tmp k() const; 177 | 178 | //- Return the turbulence kinetic energy dissipation rate 179 | virtual tmp epsilon() const; 180 | 181 | //- Return the Reynolds stress tensor 182 | virtual tmp R() const; 183 | 184 | //- Return the effective stress tensor including the laminar stress 185 | virtual tmp devReff() const; 186 | 187 | //- Return the source term for the momentum equation 188 | virtual tmp divDevReff(volVectorField& U) const; 189 | 190 | //- Return the source term for the momentum equation 191 | virtual tmp divDevRhoReff 192 | ( 193 | const volScalarField& rho, 194 | volVectorField& U 195 | ) const; 196 | 197 | //- Solve the turbulence equations and correct the turbulence viscosity 198 | virtual void correct(); 199 | 200 | //- Read RASProperties dictionary 201 | virtual bool read(); 202 | }; 203 | 204 | 205 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 206 | 207 | } // End namespace RASModels 208 | } // End namespace incompressible 209 | } // End namespace Foam 210 | 211 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 212 | 213 | #endif 214 | 215 | // ************************************************************************* // 216 | -------------------------------------------------------------------------------- /SpalartAllmarasOpenFOAM2.2/SpalartAllmaras.H~: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*\ 2 | ========= | 3 | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 4 | \\ / O peration | 5 | \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation 6 | \\/ M anipulation | 7 | ------------------------------------------------------------------------------- 8 | License 9 | This file is part of OpenFOAM. 10 | 11 | OpenFOAM is free software: you can redistribute it and/or modify it 12 | under the terms of the GNU General Public License as published by 13 | the Free Software Foundation, either version 3 of the License, or 14 | (at your option) any later version. 15 | 16 | OpenFOAM is distributed in the hope that it will be useful, but WITHOUT 17 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 18 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 19 | for more details. 20 | 21 | You should have received a copy of the GNU General Public License 22 | along with OpenFOAM. If not, see . 23 | 24 | Class 25 | Foam::incompressible::RASModels::SpalartAllmaras 26 | 27 | Group 28 | grpIcoRASTurbulence 29 | 30 | Description 31 | Spalart-Allmaras 1-eqn mixing-length model for incompressible external 32 | flows. 33 | 34 | References: 35 | \verbatim 36 | "A One-Equation Turbulence Model for Aerodynamic Flows" 37 | P.R. Spalart, 38 | S.R. Allmaras, 39 | La Recherche Aerospatiale, No. 1, 1994, pp. 5-21. 40 | 41 | Extended according to: 42 | 43 | "An Unstructured Grid Generation and Adaptive Solution Technique 44 | for High Reynolds Number Compressible Flows" 45 | G.A. Ashford, 46 | Ph.D. thesis, University of Michigan, 1996. 47 | \endverbatim 48 | 49 | The default model coefficients correspond to the following: 50 | \verbatim 51 | SpalartAllmarasCoeffs 52 | { 53 | Cb1 0.1355; 54 | Cb2 0.622; 55 | Cw2 0.3; 56 | Cw3 2.0; 57 | Cv1 7.1; 58 | Cv2 5.0; 59 | sigmaNut 0.66666; 60 | kappa 0.41; 61 | } 62 | \endverbatim 63 | 64 | SourceFiles 65 | SpalartAllmaras.C 66 | 67 | \*---------------------------------------------------------------------------*/ 68 | 69 | #ifndef SpalartAllmaras_H 70 | #define SpalartAllmaras_H 71 | 72 | #include "RASModel.H" 73 | #include "wallDist.H" 74 | 75 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 76 | 77 | namespace Foam 78 | { 79 | namespace incompressible 80 | { 81 | namespace RASModels 82 | { 83 | 84 | /*---------------------------------------------------------------------------*\ 85 | Class SpalartAllmaras Declaration 86 | \*---------------------------------------------------------------------------*/ 87 | 88 | class SpalartAllmaras 89 | : 90 | public RASModel 91 | { 92 | 93 | protected: 94 | 95 | // Protected data 96 | 97 | // Model coefficients 98 | 99 | dimensionedScalar sigmaNut_; 100 | dimensionedScalar kappa_; 101 | 102 | dimensionedScalar Cb1_; 103 | dimensionedScalar Cb2_; 104 | dimensionedScalar Cw1_; 105 | dimensionedScalar Cw2_; 106 | dimensionedScalar Cw3_; 107 | dimensionedScalar Cv1_; 108 | dimensionedScalar Cv2_; 109 | 110 | 111 | // Fields 112 | 113 | volScalarField nuTilda_; 114 | volScalarField nut_; 115 | 116 | wallDist d_; 117 | 118 | 119 | // Protected Member Functions 120 | 121 | tmp chi() const; 122 | 123 | tmp fv1(const volScalarField& chi) const; 124 | 125 | tmp fv2 126 | ( 127 | const volScalarField& chi, 128 | const volScalarField& fv1 129 | ) const; 130 | 131 | tmp fv3 132 | ( 133 | const volScalarField& chi, 134 | const volScalarField& fv1 135 | ) const; 136 | 137 | tmp fw(const volScalarField& Stilda) const; 138 | 139 | 140 | public: 141 | 142 | //- Runtime type information 143 | TypeName("SpalartAllmaras"); 144 | 145 | 146 | // Constructors 147 | 148 | //- Construct from components 149 | SpalartAllmaras 150 | ( 151 | const volVectorField& U, 152 | const surfaceScalarField& phi, 153 | transportModel& transport, 154 | const word& turbulenceModelName = turbulenceModel::typeName, 155 | const word& modelName = typeName 156 | ); 157 | 158 | 159 | //- Destructor 160 | virtual ~SpalartAllmaras() 161 | {} 162 | 163 | 164 | // Member Functions 165 | 166 | //- Return the turbulence viscosity 167 | virtual tmp nut() const 168 | { 169 | return nut_; 170 | } 171 | 172 | //- Return the effective diffusivity for nuTilda 173 | tmp DnuTildaEff() const; 174 | 175 | //- Return the turbulence kinetic energy 176 | virtual tmp k() const; 177 | 178 | //- Return the turbulence kinetic energy dissipation rate 179 | virtual tmp epsilon() const; 180 | 181 | //- Return the Reynolds stress tensor 182 | virtual tmp R() const; 183 | 184 | //- Return the effective stress tensor including the laminar stress 185 | virtual tmp devReff() const; 186 | 187 | //- Return the source term for the momentum equation 188 | virtual tmp divDevReff(volVectorField& U) const; 189 | 190 | //- Return the source term for the momentum equation 191 | virtual tmp divDevRhoReff 192 | ( 193 | const volScalarField& rho, 194 | volVectorField& U 195 | ) const; 196 | 197 | //- Solve the turbulence equations and correct the turbulence viscosity 198 | virtual void correct(); 199 | 200 | //- Read RASProperties dictionary 201 | virtual bool read(); 202 | }; 203 | 204 | 205 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 206 | 207 | } // End namespace RASModels 208 | } // End namespace incompressible 209 | } // End namespace Foam 210 | 211 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 212 | 213 | #endif 214 | 215 | // ************************************************************************* // 216 | -------------------------------------------------------------------------------- /cycloRamp/INSTRUCTIONS: -------------------------------------------------------------------------------- 1 | 'sudo' and login 2 | 3 | Then go to main directory of this source and run: 4 | chmod +x remake 5 | ./remake 6 | 7 | Then add this line to controlDict: 8 | libs ( "libCycloRamp.so" ); 9 | -------------------------------------------------------------------------------- /cycloRamp/Make/files: -------------------------------------------------------------------------------- 1 | cycloRamp.C 2 | LIB = $(FOAM_USER_LIBBIN)/libCycloRamp 3 | -------------------------------------------------------------------------------- /cycloRamp/Make/options: -------------------------------------------------------------------------------- 1 | EXE_INC = \ 2 | -I$(LIB_SRC)/dynamicFvMesh/lnInclude \ 3 | -I$(LIB_SRC)/dynamicFvMesh/solidBodyMotionFvMesh/lnInclude 4 | LIB_LIBS = \ 5 | -lOpenFOAM \ 6 | -ldynamicFvMesh 7 | -------------------------------------------------------------------------------- /cycloRamp/compiling new OpenFOAM source: -------------------------------------------------------------------------------- 1 | THIS IS NOT NEEDED IF YOU DOWNLOADED EVERYHTING IN THIS FOLDER, INCLUDING THE 'Make' FOLDER 2 | JUST FOLLOW THE 'INSTRUCTIONS' TEXT FILE 3 | 4 | For cycloRamp: 5 | 6 | mkdir cycloRamp; 7 | mkdir cycloRamp/Make; 8 | new files in cycloRamp/Make: 'files' and 'options' 9 | In 'files', the new source and new library names are defined. For cycloRamp: 10 | cycloRamp.C 11 | LIB = $(FOAM_USER_LIBBIN)/libCycloRamp 12 | In 'options': 13 | EXE_INC = \ 14 | -I$(LIB_SRC)/dynamicFvMesh/lnInclude 15 | -I$(LIB_SRC)/dynamicFvMesh/solidBodyMotionFvMesh/lnInclude 16 | LIB_LIBS = \ 17 | -lOpenFOAM \ 18 | -ldynamicFvMesh \ 19 | -lsolidBodyMotionFvMesh 20 | The make script: 21 | #!/bin/bash 22 | wclean 23 | wmake libso 24 | cp $FOAM_USER_LIBBIN/libCycloRamp.so $FOAM_LIBBIN 25 | Add this line to controlDict: 26 | libs ( "libCycloRamp.so" ); 27 | -------------------------------------------------------------------------------- /cycloRamp/cycloRamp.C: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*\ 2 | ========= | 3 | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 4 | \\ / O peration | 5 | \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation 6 | \\/ M anipulation | 7 | ------------------------------------------------------------------------------- 8 | License 9 | This file is part of OpenFOAM. 10 | 11 | OpenFOAM is free software: you can redistribute it and/or modify it 12 | under the terms of the GNU General Public License as published by 13 | the Free Software Foundation, either version 3 of the License, or 14 | (at your option) any later version. 15 | 16 | OpenFOAM is distributed in the hope that it will be useful, but WITHOUT 17 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 18 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 19 | for more details. 20 | 21 | You should have received a copy of the GNU General Public License 22 | along with OpenFOAM. If not, see . 23 | 24 | \*---------------------------------------------------------------------------*/ 25 | 26 | #include "cycloRamp.H" 27 | #include "addToRunTimeSelectionTable.H" 28 | #include "unitConversion.H" 29 | 30 | #include "transformField.H" 31 | 32 | using namespace Foam::constant::mathematical; 33 | 34 | // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // 35 | 36 | namespace Foam 37 | { 38 | namespace solidBodyMotionFunctions 39 | { 40 | defineTypeNameAndDebug(cycloRamp, 0); 41 | addToRunTimeSelectionTable 42 | ( 43 | solidBodyMotionFunction, 44 | cycloRamp, 45 | dictionary 46 | ); 47 | } 48 | } 49 | 50 | 51 | // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // 52 | 53 | Foam::solidBodyMotionFunctions::cycloRamp::cycloRamp 54 | ( 55 | const dictionary& SBMFCoeffs, 56 | const Time& runTime 57 | ) 58 | : 59 | solidBodyMotionFunction(SBMFCoeffs, runTime) 60 | { 61 | read(SBMFCoeffs); 62 | } 63 | 64 | 65 | // * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * * // 66 | 67 | Foam::solidBodyMotionFunctions::cycloRamp::~cycloRamp() 68 | {} 69 | 70 | 71 | // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // 72 | 73 | Foam::septernion 74 | Foam::solidBodyMotionFunctions::cycloRamp::transformation() const 75 | { 76 | scalar t = time_.value(); 77 | //Calculate azimuth (rotation of outer rotor zone) with ramp. 78 | vector azimuth(0,0,0); 79 | vector basePhi=t*OMEGA0_; 80 | vector dPhiDot=OMEGAF_-OMEGA0_; 81 | azimuth+=basePhi; 82 | if(t>TF_){ 83 | azimuth+=(TF_-T0_)*dPhiDot/2+(t-TF_)*OMEGAF_; 84 | } else if (t>T0_) { 85 | vector phiDotDiff=(t-T0_)/(TF_-T0_)*dPhiDot; 86 | azimuth+=(t-T0_)*phiDotDiff/2; 87 | } 88 | scalar magAzimuth = azimuth.z(); 89 | //End ramp azimuth calculation 90 | 91 | scalar amplitude = degToRad(max_-min_)/2; 92 | //scalar average = degToRad(max_+min_)/2; 93 | scalar pitch = amplitude*cos(magAzimuth+degToRad(phi_-tilt_))-amplitude*cos(degToRad(phi_-tilt_)); 94 | 95 | //This assumes that the rotation vector is exclusively in the z-direction. 96 | point bladeCofr; 97 | bladeCofr.x()=COFR_.x()+radius_*cos(magAzimuth+degToRad(phi_+90)); 98 | bladeCofr.y()=COFR_.y()+radius_*sin(magAzimuth+degToRad(phi_+90)); 99 | bladeCofr.z()=COFR_.z(); 100 | 101 | quaternion R(0,0,azimuth.z()); 102 | septernion TR(septernion(COFR_)*R*septernion(-COFR_)); 103 | quaternion R2(0,0,-pitch); 104 | TR=septernion(bladeCofr)*R2*septernion(-bladeCofr)*TR; 105 | 106 | Info<< "solidBodyMotionFunctions::cycloRamp::transformation(): " 107 | << "Time = " << t << " transformation: " << TR << endl; 108 | 109 | return TR; 110 | } 111 | 112 | 113 | bool Foam::solidBodyMotionFunctions::cycloRamp::read 114 | ( 115 | const dictionary& SBMFCoeffs 116 | ) 117 | { 118 | solidBodyMotionFunction::read(SBMFCoeffs); 119 | 120 | SBMFCoeffs_.lookup("tilt") >> tilt_; 121 | SBMFCoeffs_.lookup("max") >> max_; 122 | SBMFCoeffs_.lookup("min") >> min_; 123 | SBMFCoeffs_.lookup("radius") >> radius_; 124 | SBMFCoeffs_.lookup("phi") >> phi_; 125 | SBMFCoeffs_.lookup("OMEGA0") >> OMEGA0_; 126 | SBMFCoeffs_.lookup("OMEGAF") >> OMEGAF_; 127 | SBMFCoeffs_.lookup("T0") >> T0_; 128 | SBMFCoeffs_.lookup("TF") >> TF_; 129 | SBMFCoeffs_.lookup("COFR") >> COFR_; 130 | 131 | return true; 132 | } 133 | 134 | // ************************************************************************* // 135 | -------------------------------------------------------------------------------- /cycloRamp/cycloRamp.H: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*\ 2 | ========= | 3 | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 4 | \\ / O peration | 5 | \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation 6 | \\/ M anipulation | 7 | ------------------------------------------------------------------------------- 8 | License 9 | This file is part of OpenFOAM. 10 | 11 | OpenFOAM is free software: you can redistribute it and/or modify it 12 | under the terms of the GNU General Public License as published by 13 | the Free Software Foundation, either version 3 of the License, or 14 | (at your option) any later version. 15 | 16 | OpenFOAM is distributed in the hope that it will be useful, but WITHOUT 17 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 18 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 19 | for more details. 20 | 21 | You should have received a copy of the GNU General Public License 22 | along with OpenFOAM. If not, see . 23 | 24 | Class 25 | Foam::solidBodyMotionFunctions::cycloRamp 26 | 27 | Description 28 | Allows for ramped nested AMI movement; currently only allows for a rotation vector completely in z-direction. 29 | 30 | SourceFiles 31 | cycloRamp.C 32 | 33 | \*---------------------------------------------------------------------------*/ 34 | 35 | #ifndef cycloRamp_H 36 | #define cycloRamp_H 37 | 38 | #include "solidBodyMotionFunction.H" 39 | #include "primitiveFields.H" 40 | #include "point.H" 41 | 42 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 43 | 44 | namespace Foam 45 | { 46 | namespace solidBodyMotionFunctions 47 | { 48 | 49 | /*---------------------------------------------------------------------------*\ 50 | Class cycloRamp Declaration 51 | \*---------------------------------------------------------------------------*/ 52 | 53 | class cycloRamp 54 | : 55 | public solidBodyMotionFunction 56 | { 57 | // Private data 58 | 59 | //- Centre of gravity 60 | point COFR_; 61 | vector OMEGA0_; 62 | vector OMEGAF_; 63 | scalar T0_; 64 | scalar TF_; 65 | scalar radius_; 66 | scalar tilt_; 67 | scalar max_; 68 | scalar min_; 69 | scalar phi_; 70 | 71 | // Private Member Functions 72 | 73 | //- Disallow copy construct 74 | cycloRamp(const cycloRamp&); 75 | 76 | //- Disallow default bitwise assignment 77 | void operator=(const cycloRamp&); 78 | 79 | 80 | public: 81 | 82 | //- Runtime type information 83 | TypeName("cycloRamp"); 84 | 85 | 86 | // Constructors 87 | 88 | //- Construct from components 89 | cycloRamp 90 | ( 91 | const dictionary& SBMFCoeffs, 92 | const Time& runTime 93 | ); 94 | 95 | 96 | //- Destructor 97 | virtual ~cycloRamp(); 98 | 99 | 100 | // Member Functions 101 | 102 | //- Return the solid-body motion transformation septernion 103 | virtual septernion transformation() const; 104 | 105 | //- Update properties from given dictionary 106 | virtual bool read(const dictionary& SBMFCoeffs); 107 | }; 108 | 109 | 110 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 111 | 112 | } // End namespace solidBodyMotionFunctions 113 | } // End namespace Foam 114 | 115 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 116 | 117 | #endif 118 | 119 | // ************************************************************************* // 120 | -------------------------------------------------------------------------------- /cycloRamp/remake: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | wclean 3 | wmake libso 4 | sudo cp $FOAM_USER_LIBBIN/libCycloRamp.so $FOAM_LIBBIN 5 | -------------------------------------------------------------------------------- /nestedRotationMotion/Make/files: -------------------------------------------------------------------------------- 1 | nestedRotationMotion.C 2 | LIB = $(FOAM_USER_LIBBIN)/libNestedRotationMotion 3 | -------------------------------------------------------------------------------- /nestedRotationMotion/Make/linux64GccDPOpt/dependencies: -------------------------------------------------------------------------------- 1 | dependencies up to date 2 | -------------------------------------------------------------------------------- /nestedRotationMotion/Make/linux64GccDPOpt/dependencyFiles: -------------------------------------------------------------------------------- 1 | DEPENDENCIES = \ 2 | nestedRotationMotion.dep 3 | -------------------------------------------------------------------------------- /nestedRotationMotion/Make/linux64GccDPOpt/dontIncludeDeps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openfoamtutorials/OpenFOAM_Additions/ff602cb8ef49269ddcea47d40451c153526a5696/nestedRotationMotion/Make/linux64GccDPOpt/dontIncludeDeps -------------------------------------------------------------------------------- /nestedRotationMotion/Make/linux64GccDPOpt/files: -------------------------------------------------------------------------------- 1 | # 1 "files" 2 | # 1 "" 3 | # 1 "" 4 | # 1 "files" 5 | nestedRotationMotion.C 6 | LIB = $(FOAM_USER_LIBBIN)/libNestedRotationMotion 7 | -------------------------------------------------------------------------------- /nestedRotationMotion/Make/linux64GccDPOpt/filesMacros: -------------------------------------------------------------------------------- 1 | LIB = $(FOAM_USER_LIBBIN)/libNestedRotationMotion 2 | -------------------------------------------------------------------------------- /nestedRotationMotion/Make/linux64GccDPOpt/includeDeps: -------------------------------------------------------------------------------- 1 | include nestedRotationMotion.dep 2 | -------------------------------------------------------------------------------- /nestedRotationMotion/Make/linux64GccDPOpt/localObjectFiles: -------------------------------------------------------------------------------- 1 | LOCAL_OBJECTS = \ 2 | nestedRotationMotion.o 3 | -------------------------------------------------------------------------------- /nestedRotationMotion/Make/linux64GccDPOpt/nestedRotationMotion.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openfoamtutorials/OpenFOAM_Additions/ff602cb8ef49269ddcea47d40451c153526a5696/nestedRotationMotion/Make/linux64GccDPOpt/nestedRotationMotion.o -------------------------------------------------------------------------------- /nestedRotationMotion/Make/linux64GccDPOpt/objectFiles: -------------------------------------------------------------------------------- 1 | OBJECTS = \ 2 | $(OBJECTS_DIR)/nestedRotationMotion.o 3 | -------------------------------------------------------------------------------- /nestedRotationMotion/Make/linux64GccDPOpt/options: -------------------------------------------------------------------------------- 1 | # 1 "options" 2 | # 1 "" 3 | # 1 "" 4 | # 1 "options" 5 | EXE_INC = -I$(LIB_SRC)/dynamicFvMesh/lnInclude -I$(LIB_SRC)/dynamicFvMesh/solidBodyMotionFvMesh/lnInclude 6 | 7 | 8 | LIB_LIBS = -lOpenFOAM -ldynamicFvMesh 9 | -------------------------------------------------------------------------------- /nestedRotationMotion/Make/linux64GccDPOpt/sourceFiles: -------------------------------------------------------------------------------- 1 | SOURCE = \ 2 | nestedRotationMotion.C 3 | -------------------------------------------------------------------------------- /nestedRotationMotion/Make/options: -------------------------------------------------------------------------------- 1 | EXE_INC = \ 2 | -I$(LIB_SRC)/dynamicFvMesh/lnInclude \ 3 | -I$(LIB_SRC)/dynamicFvMesh/solidBodyMotionFvMesh/lnInclude 4 | LIB_LIBS = \ 5 | -lOpenFOAM \ 6 | -ldynamicFvMesh 7 | -------------------------------------------------------------------------------- /nestedRotationMotion/axisRotationMotion.C: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*\ 2 | ========= | 3 | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 4 | \\ / O peration | 5 | \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation 6 | \\/ M anipulation | 7 | ------------------------------------------------------------------------------- 8 | License 9 | This file is part of OpenFOAM. 10 | 11 | OpenFOAM is free software: you can redistribute it and/or modify it 12 | under the terms of the GNU General Public License as published by 13 | the Free Software Foundation, either version 3 of the License, or 14 | (at your option) any later version. 15 | 16 | OpenFOAM is distributed in the hope that it will be useful, but WITHOUT 17 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 18 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 19 | for more details. 20 | 21 | You should have received a copy of the GNU General Public License 22 | along with OpenFOAM. If not, see . 23 | 24 | \*---------------------------------------------------------------------------*/ 25 | 26 | #include "axisRotationMotion.H" 27 | #include "addToRunTimeSelectionTable.H" 28 | #include "unitConversion.H" 29 | 30 | using namespace Foam::constant::mathematical; 31 | 32 | // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // 33 | 34 | namespace Foam 35 | { 36 | namespace solidBodyMotionFunctions 37 | { 38 | defineTypeNameAndDebug(axisRotationMotion, 0); 39 | addToRunTimeSelectionTable 40 | ( 41 | solidBodyMotionFunction, 42 | axisRotationMotion, 43 | dictionary 44 | ); 45 | } 46 | } 47 | 48 | 49 | // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // 50 | 51 | Foam::solidBodyMotionFunctions::axisRotationMotion::axisRotationMotion 52 | ( 53 | const dictionary& SBMFCoeffs, 54 | const Time& runTime 55 | ) 56 | : 57 | solidBodyMotionFunction(SBMFCoeffs, runTime) 58 | { 59 | read(SBMFCoeffs); 60 | } 61 | 62 | 63 | // * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * * // 64 | 65 | Foam::solidBodyMotionFunctions::axisRotationMotion::~axisRotationMotion() 66 | {} 67 | 68 | 69 | // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // 70 | 71 | Foam::septernion 72 | Foam::solidBodyMotionFunctions::axisRotationMotion::transformation() const 73 | { 74 | scalar t = time_.value(); 75 | 76 | // Rotation around centre of gravity (in radians) 77 | vector omega 78 | ( 79 | t*degToRad(radialVelocity_.x()), 80 | t*degToRad(radialVelocity_.y()), 81 | t*degToRad(radialVelocity_.z()) 82 | ); 83 | 84 | scalar magOmega = mag(omega); 85 | quaternion R(omega/magOmega, magOmega); 86 | septernion TR(septernion(CofG_)*R*septernion(-CofG_)); 87 | 88 | Info<< "solidBodyMotionFunctions::axisRotationMotion::transformation(): " 89 | << "Time = " << t << " transformation: " << TR << endl; 90 | 91 | return TR; 92 | } 93 | 94 | 95 | bool Foam::solidBodyMotionFunctions::axisRotationMotion::read 96 | ( 97 | const dictionary& SBMFCoeffs 98 | ) 99 | { 100 | solidBodyMotionFunction::read(SBMFCoeffs); 101 | 102 | SBMFCoeffs_.lookup("CofG") >> CofG_; 103 | SBMFCoeffs_.lookup("radialVelocity") >> radialVelocity_; 104 | 105 | return true; 106 | } 107 | 108 | // ************************************************************************* // 109 | -------------------------------------------------------------------------------- /nestedRotationMotion/axisRotationMotion.H: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*\ 2 | ========= | 3 | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 4 | \\ / O peration | 5 | \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation 6 | \\/ M anipulation | 7 | ------------------------------------------------------------------------------- 8 | License 9 | This file is part of OpenFOAM. 10 | 11 | OpenFOAM is free software: you can redistribute it and/or modify it 12 | under the terms of the GNU General Public License as published by 13 | the Free Software Foundation, either version 3 of the License, or 14 | (at your option) any later version. 15 | 16 | OpenFOAM is distributed in the hope that it will be useful, but WITHOUT 17 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 18 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 19 | for more details. 20 | 21 | You should have received a copy of the GNU General Public License 22 | along with OpenFOAM. If not, see . 23 | 24 | Class 25 | Foam::solidBodyMotionFunctions::axisRotationMotion 26 | 27 | Description 28 | Constant velocity rotation around CoG. Similar to rotatingMotion but 29 | motion specified as rotation vector. 30 | 31 | SourceFiles 32 | axisRotationMotion.C 33 | 34 | \*---------------------------------------------------------------------------*/ 35 | 36 | #ifndef axisRotationMotion_H 37 | #define axisRotationMotion_H 38 | 39 | #include "solidBodyMotionFunction.H" 40 | #include "primitiveFields.H" 41 | #include "point.H" 42 | 43 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 44 | 45 | namespace Foam 46 | { 47 | namespace solidBodyMotionFunctions 48 | { 49 | 50 | /*---------------------------------------------------------------------------*\ 51 | Class axisRotationMotion Declaration 52 | \*---------------------------------------------------------------------------*/ 53 | 54 | class axisRotationMotion 55 | : 56 | public solidBodyMotionFunction 57 | { 58 | // Private data 59 | 60 | //- Centre of gravity 61 | point CofG_; 62 | 63 | //- Rotational velocity (deg/s) 64 | vector radialVelocity_; 65 | 66 | 67 | // Private Member Functions 68 | 69 | //- Disallow copy construct 70 | axisRotationMotion(const axisRotationMotion&); 71 | 72 | //- Disallow default bitwise assignment 73 | void operator=(const axisRotationMotion&); 74 | 75 | 76 | public: 77 | 78 | //- Runtime type information 79 | TypeName("axisRotationMotion"); 80 | 81 | 82 | // Constructors 83 | 84 | //- Construct from components 85 | axisRotationMotion 86 | ( 87 | const dictionary& SBMFCoeffs, 88 | const Time& runTime 89 | ); 90 | 91 | 92 | //- Destructor 93 | virtual ~axisRotationMotion(); 94 | 95 | 96 | // Member Functions 97 | 98 | //- Return the solid-body motion transformation septernion 99 | virtual septernion transformation() const; 100 | 101 | //- Update properties from given dictionary 102 | virtual bool read(const dictionary& SBMFCoeffs); 103 | }; 104 | 105 | 106 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 107 | 108 | } // End namespace solidBodyMotionFunctions 109 | } // End namespace Foam 110 | 111 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 112 | 113 | #endif 114 | 115 | // ************************************************************************* // 116 | -------------------------------------------------------------------------------- /nestedRotationMotion/compiling new OpenFOAM source: -------------------------------------------------------------------------------- 1 | For nestedRotatingMotion: 2 | mkdir nestedRotationMotion; 3 | mkdir nestedRotationMotion/Make; 4 | new files in nestedRotationMotion/Make: 'files' and 'options' 5 | In 'files', the new source and new library names are defined. For nestedRotationMotion: 6 | nestedRotationMotion.C 7 | LIB = $(FOAM_USER_LIBBIN)/libNestedRotationMotion 8 | In 'options': 9 | EXE_INC = \ 10 | -I$(LIB_SRC)/dynamicFvMesh/lnInclude 11 | -I$(LIB_SRC)/dynamicFvMesh/solidBodyMotionFvMesh/lnInclude 12 | LIB_LIBS = \ 13 | -lOpenFOAM \ 14 | -ldynamicFvMesh \ 15 | -lsolidBodyMotionFvMesh 16 | The make script: 17 | #!/bin/bash 18 | wclean 19 | wmake libso 20 | cp $FOAM_USER_LIBBIN/libNestedRotationMotion.so $FOAM_LIBBIN 21 | Add this line to controlDict: 22 | libs ( "libNestedRotationMotion.so" ) 23 | -------------------------------------------------------------------------------- /nestedRotationMotion/lnInclude/axisRotationMotion.C: -------------------------------------------------------------------------------- 1 | ../axisRotationMotion.C -------------------------------------------------------------------------------- /nestedRotationMotion/lnInclude/axisRotationMotion.H: -------------------------------------------------------------------------------- 1 | ../axisRotationMotion.H -------------------------------------------------------------------------------- /nestedRotationMotion/lnInclude/nestedRotationMotion.C: -------------------------------------------------------------------------------- 1 | ../nestedRotationMotion.C -------------------------------------------------------------------------------- /nestedRotationMotion/lnInclude/nestedRotationMotion.H: -------------------------------------------------------------------------------- 1 | ../nestedRotationMotion.H -------------------------------------------------------------------------------- /nestedRotationMotion/lnInclude/uptodate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openfoamtutorials/OpenFOAM_Additions/ff602cb8ef49269ddcea47d40451c153526a5696/nestedRotationMotion/lnInclude/uptodate -------------------------------------------------------------------------------- /nestedRotationMotion/nestedRotationMotion.C: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*\ 2 | ========= | 3 | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 4 | \\ / O peration | 5 | \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation 6 | \\/ M anipulation | 7 | ------------------------------------------------------------------------------- 8 | License 9 | This file is part of OpenFOAM. 10 | 11 | OpenFOAM is free software: you can redistribute it and/or modify it 12 | under the terms of the GNU General Public License as published by 13 | the Free Software Foundation, either version 3 of the License, or 14 | (at your option) any later version. 15 | 16 | OpenFOAM is distributed in the hope that it will be useful, but WITHOUT 17 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 18 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 19 | for more details. 20 | 21 | You should have received a copy of the GNU General Public License 22 | along with OpenFOAM. If not, see . 23 | 24 | \*---------------------------------------------------------------------------*/ 25 | 26 | #include "nestedRotationMotion.H" 27 | #include "addToRunTimeSelectionTable.H" 28 | #include "unitConversion.H" 29 | 30 | #include "transformField.H" 31 | 32 | using namespace Foam::constant::mathematical; 33 | 34 | // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // 35 | 36 | namespace Foam 37 | { 38 | namespace solidBodyMotionFunctions 39 | { 40 | defineTypeNameAndDebug(nestedRotationMotion, 0); 41 | addToRunTimeSelectionTable 42 | ( 43 | solidBodyMotionFunction, 44 | nestedRotationMotion, 45 | dictionary 46 | ); 47 | } 48 | } 49 | 50 | 51 | // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // 52 | 53 | Foam::solidBodyMotionFunctions::nestedRotationMotion::nestedRotationMotion 54 | ( 55 | const dictionary& SBMFCoeffs, 56 | const Time& runTime 57 | ) 58 | : 59 | solidBodyMotionFunction(SBMFCoeffs, runTime) 60 | { 61 | read(SBMFCoeffs); 62 | } 63 | 64 | 65 | // * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * * // 66 | 67 | Foam::solidBodyMotionFunctions::nestedRotationMotion::~nestedRotationMotion() 68 | {} 69 | 70 | 71 | // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // 72 | 73 | Foam::septernion 74 | Foam::solidBodyMotionFunctions::nestedRotationMotion::transformation() const 75 | { 76 | scalar t = time_.value(); 77 | 78 | vector omegaHouse 79 | ( 80 | t*degToRad(radialVelocityHouse_.x()), 81 | t*degToRad(radialVelocityHouse_.y()), 82 | t*degToRad(radialVelocityHouse_.z()) 83 | ); 84 | vector omegaNested 85 | ( 86 | t*degToRad(radialVelocityNested_.x()), 87 | t*degToRad(radialVelocityNested_.y()), 88 | t*degToRad(radialVelocityNested_.z()) 89 | ); 90 | 91 | scalar magOmegaHouse = mag(omegaHouse); 92 | scalar magOmegaNested = mag(omegaNested); 93 | 94 | quaternion R(omegaHouse/magOmegaHouse, magOmegaHouse);//construct a rotation quaternion from direction and magnitude. 95 | 96 | //This assumes that the rotation vector is exclusively in the z-direction. 97 | scalar nestedAngle=omegaHouse.z()+degToRad(nestedOmega0_); 98 | point CofGNested; 99 | CofGNested.x()=CofGHouse_.x()+nestedRadius_*cos(nestedAngle); 100 | CofGNested.y()=CofGHouse_.y()+nestedRadius_*sin(nestedAngle); 101 | CofGNested.z()=CofGHouse_.z(); 102 | 103 | septernion TR( septernion(CofGHouse_)*R*septernion(-CofGHouse_) ); 104 | if(magOmegaNested>0){ 105 | quaternion R2(omegaNested/magOmegaNested, magOmegaNested); 106 | // septernion TR( septernion(CofGNested)*R2*septernion(-CofGNested)* 107 | // septernion(CofGHouse_)*R*septernion(-CofGHouse_) ); 108 | TR=septernion(CofGNested)*R2*septernion(-CofGNested)*TR; 109 | } 110 | 111 | Info<< "solidBodyMotionFunctions::nestedRotationMotion::transformation(): " 112 | << "Time = " << t << " transformation: " << TR << endl; 113 | 114 | return TR; 115 | } 116 | 117 | 118 | bool Foam::solidBodyMotionFunctions::nestedRotationMotion::read 119 | ( 120 | const dictionary& SBMFCoeffs 121 | ) 122 | { 123 | solidBodyMotionFunction::read(SBMFCoeffs); 124 | 125 | SBMFCoeffs_.lookup("nestedOmega0") >> nestedOmega0_; 126 | SBMFCoeffs_.lookup("nestedRadius") >> nestedRadius_; 127 | SBMFCoeffs_.lookup("CofGHouse") >> CofGHouse_; 128 | SBMFCoeffs_.lookup("radialVelocityNested") >> radialVelocityNested_; 129 | SBMFCoeffs_.lookup("radialVelocityHouse") >> radialVelocityHouse_; 130 | 131 | return true; 132 | } 133 | 134 | // ************************************************************************* // 135 | -------------------------------------------------------------------------------- /nestedRotationMotion/nestedRotationMotion.C~: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*\ 2 | ========= | 3 | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 4 | \\ / O peration | 5 | \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation 6 | \\/ M anipulation | 7 | ------------------------------------------------------------------------------- 8 | License 9 | This file is part of OpenFOAM. 10 | 11 | OpenFOAM is free software: you can redistribute it and/or modify it 12 | under the terms of the GNU General Public License as published by 13 | the Free Software Foundation, either version 3 of the License, or 14 | (at your option) any later version. 15 | 16 | OpenFOAM is distributed in the hope that it will be useful, but WITHOUT 17 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 18 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 19 | for more details. 20 | 21 | You should have received a copy of the GNU General Public License 22 | along with OpenFOAM. If not, see . 23 | 24 | \*---------------------------------------------------------------------------*/ 25 | 26 | #include "nestedRotationMotion.H" 27 | #include "addToRunTimeSelectionTable.H" 28 | #include "unitConversion.H" 29 | 30 | #include "transformField.H" 31 | 32 | using namespace Foam::constant::mathematical; 33 | 34 | // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // 35 | 36 | namespace Foam 37 | { 38 | namespace solidBodyMotionFunctions 39 | { 40 | defineTypeNameAndDebug(nestedRotationMotion, 0); 41 | addToRunTimeSelectionTable 42 | ( 43 | solidBodyMotionFunction, 44 | nestedRotationMotion, 45 | dictionary 46 | ); 47 | } 48 | } 49 | 50 | 51 | // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // 52 | 53 | Foam::solidBodyMotionFunctions::nestedRotationMotion::nestedRotationMotion 54 | ( 55 | const dictionary& SBMFCoeffs, 56 | const Time& runTime 57 | ) 58 | : 59 | solidBodyMotionFunction(SBMFCoeffs, runTime) 60 | { 61 | read(SBMFCoeffs); 62 | } 63 | 64 | 65 | // * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * * // 66 | 67 | Foam::solidBodyMotionFunctions::nestedRotationMotion::~nestedRotationMotion() 68 | {} 69 | 70 | 71 | // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // 72 | 73 | Foam::septernion 74 | Foam::solidBodyMotionFunctions::nestedRotationMotion::transformation() const 75 | { 76 | scalar t = time_.value(); 77 | 78 | vector omegaHouse 79 | ( 80 | t*degToRad(radialVelocityHouse_.x()), 81 | t*degToRad(radialVelocityHouse_.y()), 82 | t*degToRad(radialVelocityHouse_.z()) 83 | ); 84 | vector omegaNested 85 | ( 86 | t*degToRad(radialVelocityNested_.x()), 87 | t*degToRad(radialVelocityNested_.y()), 88 | t*degToRad(radialVelocityNested_.z()) 89 | ); 90 | 91 | scalar magOmegaHouse = mag(omegaHouse); 92 | scalar magOmegaNested = mag(omegaNested); 93 | 94 | quaternion R(omegaHouse/magOmegaHouse, magOmegaHouse);//construct a rotation quaternion from direction and magnitude. 95 | 96 | //This assumes that the rotation vector is exclusively in the z-direction. 97 | scalar nestedAngle=omegaHouse.z()+degToRad(nestedOmega0_); 98 | point CofGNested; 99 | CofGNested.x()=CofGHouse_.x()+nestedRadius_*cos(nestedAngle); 100 | CofGNested.y()=CofGHouse_.y()+nestedRadius_*sin(nestedAngle); 101 | CofGNested.z()=CofGHouse_.z(); 102 | 103 | septernion TR( septernion(CofGHouse_)*R*septernion(-CofGHouse_) ); 104 | if(magOmegaNested>0){ 105 | quaternion R2(omegaNested/magOmegaNested, magOmegaNested); 106 | // septernion TR( septernion(CofGNested)*R2*septernion(-CofGNested)* 107 | // septernion(CofGHouse_)*R*septernion(-CofGHouse_) ); 108 | TR=septernion(CofGNested)*R2*septernion(-CofGNested)*TR; 109 | } 110 | 111 | Info<< "solidBodyMotionFunctions::nestedRotationMotion::transformation(): " 112 | << "Time = " << t << " transformation: " << TR << endl; 113 | 114 | return TR; 115 | } 116 | 117 | 118 | bool Foam::solidBodyMotionFunctions::nestedRotationMotion::read 119 | ( 120 | const dictionary& SBMFCoeffs 121 | ) 122 | { 123 | solidBodyMotionFunction::read(SBMFCoeffs); 124 | 125 | SBMFCoeffs_.lookup("nestedOmega0") >> nestedOmega0_; 126 | SBMFCoeffs_.lookup("nestedRadius") >> nestedRadius_; 127 | SBMFCoeffs_.lookup("CofGHouse") >> CofGHouse_; 128 | SBMFCoeffs_.lookup("radialVelocityNested") >> radialVelocityNested_; 129 | SBMFCoeffs_.lookup("radialVelocityHouse") >> radialVelocityHouse_; 130 | 131 | return true; 132 | } 133 | 134 | // ************************************************************************* // 135 | -------------------------------------------------------------------------------- /nestedRotationMotion/nestedRotationMotion.H: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*\ 2 | ========= | 3 | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 4 | \\ / O peration | 5 | \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation 6 | \\/ M anipulation | 7 | ------------------------------------------------------------------------------- 8 | License 9 | This file is part of OpenFOAM. 10 | 11 | OpenFOAM is free software: you can redistribute it and/or modify it 12 | under the terms of the GNU General Public License as published by 13 | the Free Software Foundation, either version 3 of the License, or 14 | (at your option) any later version. 15 | 16 | OpenFOAM is distributed in the hope that it will be useful, but WITHOUT 17 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 18 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 19 | for more details. 20 | 21 | You should have received a copy of the GNU General Public License 22 | along with OpenFOAM. If not, see . 23 | 24 | Class 25 | Foam::solidBodyMotionFunctions::nestedRotationMotion 26 | 27 | Description 28 | Allows for nested AMI movement; currently only allows for a rotation vector completely in z-direction. 29 | 30 | SourceFiles 31 | nestedRotationMotion.C 32 | 33 | \*---------------------------------------------------------------------------*/ 34 | 35 | #ifndef nestedRotationMotion_H 36 | #define nestedRotationMotion_H 37 | 38 | #include "solidBodyMotionFunction.H" 39 | #include "primitiveFields.H" 40 | #include "point.H" 41 | 42 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 43 | 44 | namespace Foam 45 | { 46 | namespace solidBodyMotionFunctions 47 | { 48 | 49 | /*---------------------------------------------------------------------------*\ 50 | Class nestedRotationMotion Declaration 51 | \*---------------------------------------------------------------------------*/ 52 | 53 | class nestedRotationMotion 54 | : 55 | public solidBodyMotionFunction 56 | { 57 | // Private data 58 | 59 | //- Centre of gravity 60 | point CofGHouse_; 61 | scalar nestedRadius_; 62 | scalar nestedOmega0_; 63 | 64 | //- Rotational velocity (deg/s) 65 | vector radialVelocityHouse_; 66 | vector radialVelocityNested_; 67 | 68 | // Private Member Functions 69 | 70 | //- Disallow copy construct 71 | nestedRotationMotion(const nestedRotationMotion&); 72 | 73 | //- Disallow default bitwise assignment 74 | void operator=(const nestedRotationMotion&); 75 | 76 | 77 | public: 78 | 79 | //- Runtime type information 80 | TypeName("nestedRotationMotion"); 81 | 82 | 83 | // Constructors 84 | 85 | //- Construct from components 86 | nestedRotationMotion 87 | ( 88 | const dictionary& SBMFCoeffs, 89 | const Time& runTime 90 | ); 91 | 92 | 93 | //- Destructor 94 | virtual ~nestedRotationMotion(); 95 | 96 | 97 | // Member Functions 98 | 99 | //- Return the solid-body motion transformation septernion 100 | virtual septernion transformation() const; 101 | 102 | //- Update properties from given dictionary 103 | virtual bool read(const dictionary& SBMFCoeffs); 104 | }; 105 | 106 | 107 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 108 | 109 | } // End namespace solidBodyMotionFunctions 110 | } // End namespace Foam 111 | 112 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 113 | 114 | #endif 115 | 116 | // ************************************************************************* // 117 | -------------------------------------------------------------------------------- /nestedRotationMotion/nestedRotationMotion.dep: -------------------------------------------------------------------------------- 1 | $(OBJECTS_DIR)/nestedRotationMotion.o: nestedRotationMotion.dep 2 | nestedRotationMotion.dep: nestedRotationMotion.C 3 | nestedRotationMotion.dep: nestedRotationMotion.H 4 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/dynamicFvMesh/lnInclude/solidBodyMotionFunction.H 5 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/Time.H 6 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/TimePaths.H 7 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/fileName.H 8 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/word.H 9 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/string.H 10 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/char.H 11 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/Hasher.H 12 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/stringI.H 13 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/wordI.H 14 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/fileNameI.H 15 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/objectRegistry.H 16 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/HashTable.H 17 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/label.H 18 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/pTraits.H 19 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/direction.H 20 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/int.H 21 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/long.H 22 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/longLong.H 23 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/uLabel.H 24 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/uint.H 25 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/ulong.H 26 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/Xfer.H 27 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/XferI.H 28 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/className.H 29 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/debug.H 30 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/debugName.H 31 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/simpleRegIOobject.H 32 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/HashTableI.H 33 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/error.H 34 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/messageStream.H 35 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/OSstream.H 36 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/Ostream.H 37 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/IOstream.H 38 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/bool.H 39 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/scalar.H 40 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/floatScalar.H 41 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/doubleFloat.H 42 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/products.H 43 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/Scalar.H 44 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/doubleScalar.H 45 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/InfoProxy.H 46 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/keyType.H 47 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/keyTypeI.H 48 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/OSstreamI.H 49 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/errorManip.H 50 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/HashTable.C 51 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/List.H 52 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/UList.H 53 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/UListI.H 54 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/Swap.H 55 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/UList.C 56 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/ListLoopM.H 57 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/contiguous.H 58 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/UListIO.C 59 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/token.H 60 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/refCount.H 61 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/typeInfo.H 62 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/runTimeSelectionTables.H 63 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/autoPtr.H 64 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/autoPtrI.H 65 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/tokenI.H 66 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/Istream.H 67 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/ListI.H 68 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/List.C 69 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/FixedList.H 70 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/Hash.H 71 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/wordRe.H 72 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OSspecific/POSIX/lnInclude/regExp.H 73 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/wordReI.H 74 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/StaticAssert.H 75 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/FixedListI.H 76 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/SLList.H 77 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/LList.H 78 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/LList.C 79 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/LListIO.C 80 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/SLListBase.H 81 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/SLListBaseI.H 82 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/FixedList.C 83 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/FixedListIO.C 84 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/PtrList.H 85 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/PtrListI.H 86 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/tmp.H 87 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/tmpI.H 88 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/PtrList.C 89 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/SLPtrList.H 90 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/LPtrList.H 91 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/LPtrList.C 92 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/LPtrListIO.C 93 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/INew.H 94 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/PtrListIO.C 95 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/IndirectList.H 96 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/UIndirectList.H 97 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/UIndirectListI.H 98 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/UIndirectListIO.C 99 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/IndirectListI.H 100 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/BiIndirectList.H 101 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/BiIndirectListI.H 102 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/ListIO.C 103 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/HashTableIO.C 104 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/regIOobject.H 105 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/IOobject.H 106 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/IOobjectI.H 107 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/foamVersion.H 108 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/OSspecific.H 109 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/fileNameList.H 110 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/NamedEnum.H 111 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/stringList.H 112 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/wordList.H 113 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/NamedEnum.C 114 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/regIOobjectI.H 115 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/objectRegistryTemplates.C 116 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/IOdictionary.H 117 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/dictionary.H 118 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/entry.H 119 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/IDLList.H 120 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/ILList.H 121 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/UILList.H 122 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/UILList.C 123 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/UILListIO.C 124 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/ILList.C 125 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/ILListIO.C 126 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/DLListBase.H 127 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/DLListBaseI.H 128 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/DLList.H 129 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/ITstream.H 130 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/tokenList.H 131 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/dictionaryTemplates.C 132 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/primitiveEntry.H 133 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/IStringStream.H 134 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/ISstream.H 135 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/ISstreamI.H 136 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/OStringStream.H 137 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/primitiveEntryTemplates.C 138 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/FIFOStack.H 139 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/clock.H 140 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OSspecific/POSIX/lnInclude/cpuTime.H 141 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/TimeState.H 142 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/dimensionedScalar.H 143 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/dimensionedType.H 144 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/dimensionSet.H 145 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/dimensionedScalarFwd.H 146 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/scalarField.H 147 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/Field.H 148 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/VectorSpace.H 149 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/VectorSpaceI.H 150 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/VectorSpaceM.H 151 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/ops.H 152 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/VectorSpace.C 153 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/IOstreams.H 154 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/prefixOSstream.H 155 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/scalarList.H 156 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/labelList.H 157 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/FieldFunctions.H 158 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/FieldFunctionsM.H 159 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/undefFieldFunctionsM.H 160 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/Field.C 161 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/FieldMapper.H 162 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/FieldM.H 163 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/FieldFunctions.C 164 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/PstreamReduceOps.H 165 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/Pstream.H 166 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/UPstream.H 167 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/DynamicList.H 168 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/DynamicListI.H 169 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/DynamicList.C 170 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/gatherScatter.C 171 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/UOPstream.H 172 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/PstreamBuffers.H 173 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/OPstream.H 174 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/UIPstream.H 175 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/IPstream.H 176 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/combineGatherScatter.C 177 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/gatherScatterList.C 178 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/exchange.C 179 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/PstreamCombineReduceOps.H 180 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/vector2D.H 181 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/Vector2D.H 182 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/Vector2DI.H 183 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/FieldReuseFunctions.H 184 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/FieldFunctionsM.C 185 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/dimensionSets.H 186 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/scalarMatrices.H 187 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/RectangularMatrix.H 188 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/Matrix.H 189 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/MatrixI.H 190 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/Matrix.C 191 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/MatrixIO.C 192 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/RectangularMatrixI.H 193 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/SquareMatrix.H 194 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/SquareMatrixI.H 195 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/SymmetricSquareMatrix.H 196 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/SymmetricSquareMatrixI.H 197 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/SymmetricSquareMatrix.C 198 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/DiagonalMatrix.H 199 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/DiagonalMatrix.C 200 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/scalarMatricesTemplates.C 201 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/ListOps.H 202 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/ListOpsTemplates.C 203 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/dimensionedType.C 204 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/Switch.H 205 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/instantList.H 206 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/instant.H 207 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/dlLibraryTable.H 208 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/dlLibraryTableTemplates.C 209 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/functionObjectList.H 210 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/functionObject.H 211 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/SHA1Digest.H 212 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OSspecific/POSIX/lnInclude/fileMonitor.H 213 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OSspecific/POSIX/lnInclude/sigWriteNow.H 214 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OSspecific/POSIX/lnInclude/sigStopAtWriteNow.H 215 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/septernion.H 216 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/vector.H 217 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/Vector.H 218 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/VectorI.H 219 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/quaternion.H 220 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/tensor.H 221 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/Tensor.H 222 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/SphericalTensor.H 223 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/SphericalTensorI.H 224 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/TensorI.H 225 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/SymmTensor.H 226 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/SymmTensorI.H 227 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/sphericalTensor.H 228 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/symmTensor.H 229 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/quaternionI.H 230 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/septernionI.H 231 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/primitiveFields.H 232 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/labelField.H 233 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/vectorField.H 234 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/tensorField.H 235 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/sphericalTensorField.H 236 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/symmTensorField.H 237 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/point.H 238 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/addToRunTimeSelectionTable.H 239 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/unitConversion.H 240 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/mathematicalConstants.H 241 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/transformField.H 242 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/transform.H 243 | nestedRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/transformFieldTemplates.C 244 | $(OBJECTS_DIR)/nestedRotationMotion.o: $(EXE_DEP) 245 | $(OBJECTS_DIR)/nestedRotationMotion.o: 246 | @SOURCE_DIR=. 247 | SOURCE=nestedRotationMotion.C ; $(Ctoo) 248 | -------------------------------------------------------------------------------- /nestedRotationMotion/remake: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | wclean 3 | wmake libso 4 | sudo cp $FOAM_USER_LIBBIN/libNestedRotationMotion.so $FOAM_LIBBIN 5 | -------------------------------------------------------------------------------- /rampedAxisRotationMotion/Make/files: -------------------------------------------------------------------------------- 1 | rampedAxisRotationMotion.C 2 | LIB = $(FOAM_USER_LIBBIN)/libRampedAxisRotationMotion 3 | -------------------------------------------------------------------------------- /rampedAxisRotationMotion/Make/linux64GccDPOpt/dependencies: -------------------------------------------------------------------------------- 1 | dependencies up to date 2 | -------------------------------------------------------------------------------- /rampedAxisRotationMotion/Make/linux64GccDPOpt/dependencyFiles: -------------------------------------------------------------------------------- 1 | DEPENDENCIES = \ 2 | rampedAxisRotationMotion.dep 3 | -------------------------------------------------------------------------------- /rampedAxisRotationMotion/Make/linux64GccDPOpt/dontIncludeDeps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openfoamtutorials/OpenFOAM_Additions/ff602cb8ef49269ddcea47d40451c153526a5696/rampedAxisRotationMotion/Make/linux64GccDPOpt/dontIncludeDeps -------------------------------------------------------------------------------- /rampedAxisRotationMotion/Make/linux64GccDPOpt/files: -------------------------------------------------------------------------------- 1 | # 1 "files" 2 | # 1 "" 3 | # 1 "" 4 | # 1 "files" 5 | rampedAxisRotationMotion.C 6 | LIB = $(FOAM_USER_LIBBIN)/libRampedAxisRotationMotion 7 | -------------------------------------------------------------------------------- /rampedAxisRotationMotion/Make/linux64GccDPOpt/filesMacros: -------------------------------------------------------------------------------- 1 | LIB = $(FOAM_USER_LIBBIN)/libRampedAxisRotationMotion 2 | -------------------------------------------------------------------------------- /rampedAxisRotationMotion/Make/linux64GccDPOpt/includeDeps: -------------------------------------------------------------------------------- 1 | include rampedAxisRotationMotion.dep 2 | -------------------------------------------------------------------------------- /rampedAxisRotationMotion/Make/linux64GccDPOpt/localObjectFiles: -------------------------------------------------------------------------------- 1 | LOCAL_OBJECTS = \ 2 | rampedAxisRotationMotion.o 3 | -------------------------------------------------------------------------------- /rampedAxisRotationMotion/Make/linux64GccDPOpt/objectFiles: -------------------------------------------------------------------------------- 1 | OBJECTS = \ 2 | $(OBJECTS_DIR)/rampedAxisRotationMotion.o 3 | -------------------------------------------------------------------------------- /rampedAxisRotationMotion/Make/linux64GccDPOpt/options: -------------------------------------------------------------------------------- 1 | # 1 "options" 2 | # 1 "" 3 | # 1 "" 4 | # 1 "options" 5 | EXE_INC = -I$(LIB_SRC)/dynamicFvMesh/lnInclude -I$(LIB_SRC)/dynamicFvMesh/solidBodyMotionFvMesh/lnInclude 6 | 7 | 8 | LIB_LIBS = -lOpenFOAM -ldynamicFvMesh 9 | -------------------------------------------------------------------------------- /rampedAxisRotationMotion/Make/linux64GccDPOpt/rampedAxisRotationMotion.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openfoamtutorials/OpenFOAM_Additions/ff602cb8ef49269ddcea47d40451c153526a5696/rampedAxisRotationMotion/Make/linux64GccDPOpt/rampedAxisRotationMotion.o -------------------------------------------------------------------------------- /rampedAxisRotationMotion/Make/linux64GccDPOpt/sourceFiles: -------------------------------------------------------------------------------- 1 | SOURCE = \ 2 | rampedAxisRotationMotion.C 3 | -------------------------------------------------------------------------------- /rampedAxisRotationMotion/Make/options: -------------------------------------------------------------------------------- 1 | EXE_INC = \ 2 | -I$(LIB_SRC)/dynamicFvMesh/lnInclude \ 3 | -I$(LIB_SRC)/dynamicFvMesh/solidBodyMotionFvMesh/lnInclude 4 | LIB_LIBS = \ 5 | -lOpenFOAM \ 6 | -ldynamicFvMesh 7 | -------------------------------------------------------------------------------- /rampedAxisRotationMotion/compiling new OpenFOAM source: -------------------------------------------------------------------------------- 1 | For rampedAxisRotationMotion: 2 | mkdir rampedAxisRotationMotion; 3 | mkdir rampedAxisRotationMotion/Make; 4 | new files in rampedAxisRotationMotion/Make: 'files' and 'options' 5 | In 'files', the new source and new library names are defined. For nestedRotationMotion: 6 | rampedAxisRotationMotion.C 7 | LIB = $(FOAM_USER_LIBBIN)/libRampedAxisRotationMotion 8 | In 'options': 9 | EXE_INC = \ 10 | -I$(LIB_SRC)/dynamicFvMesh/lnInclude 11 | -I$(LIB_SRC)/dynamicFvMesh/solidBodyMotionFvMesh/lnInclude 12 | LIB_LIBS = \ 13 | -lOpenFOAM \ 14 | -ldynamicFvMesh \ 15 | -lsolidBodyMotionFvMesh 16 | The make script: 17 | #!/bin/bash 18 | wclean 19 | wmake libso 20 | cp $FOAM_USER_LIBBIN/libRampedAxisRotationMotion.so $FOAM_LIBBIN 21 | Add this line to controlDict: 22 | libs ( "libRampedAxisRotationMotion.so" ) 23 | -------------------------------------------------------------------------------- /rampedAxisRotationMotion/lnInclude/rampedAxisRotationMotion.C: -------------------------------------------------------------------------------- 1 | ../rampedAxisRotationMotion.C -------------------------------------------------------------------------------- /rampedAxisRotationMotion/lnInclude/rampedAxisRotationMotion.H: -------------------------------------------------------------------------------- 1 | ../rampedAxisRotationMotion.H -------------------------------------------------------------------------------- /rampedAxisRotationMotion/lnInclude/uptodate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openfoamtutorials/OpenFOAM_Additions/ff602cb8ef49269ddcea47d40451c153526a5696/rampedAxisRotationMotion/lnInclude/uptodate -------------------------------------------------------------------------------- /rampedAxisRotationMotion/rampedAxisRotationMotion.C: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*\ 2 | ========= | 3 | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 4 | \\ / O peration | 5 | \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation 6 | \\/ M anipulation | 7 | ------------------------------------------------------------------------------- 8 | License 9 | This file is part of OpenFOAM. 10 | 11 | OpenFOAM is free software: you can redistribute it and/or modify it 12 | under the terms of the GNU General Public License as published by 13 | the Free Software Foundation, either version 3 of the License, or 14 | (at your option) any later version. 15 | 16 | OpenFOAM is distributed in the hope that it will be useful, but WITHOUT 17 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 18 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 19 | for more details. 20 | 21 | You should have received a copy of the GNU General Public License 22 | along with OpenFOAM. If not, see . 23 | 24 | \*---------------------------------------------------------------------------*/ 25 | 26 | #include "rampedAxisRotationMotion.H" 27 | #include "addToRunTimeSelectionTable.H" 28 | #include "unitConversion.H" 29 | 30 | using namespace Foam::constant::mathematical; 31 | 32 | // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // 33 | 34 | namespace Foam 35 | { 36 | namespace solidBodyMotionFunctions 37 | { 38 | defineTypeNameAndDebug(rampedAxisRotationMotion, 0); 39 | addToRunTimeSelectionTable 40 | ( 41 | solidBodyMotionFunction, 42 | rampedAxisRotationMotion, 43 | dictionary 44 | ); 45 | } 46 | } 47 | 48 | 49 | // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // 50 | 51 | Foam::solidBodyMotionFunctions::rampedAxisRotationMotion::rampedAxisRotationMotion 52 | ( 53 | const dictionary& SBMFCoeffs, 54 | const Time& runTime 55 | ) 56 | : 57 | solidBodyMotionFunction(SBMFCoeffs, runTime) 58 | { 59 | read(SBMFCoeffs); 60 | } 61 | 62 | 63 | // * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * * // 64 | 65 | Foam::solidBodyMotionFunctions::rampedAxisRotationMotion::~rampedAxisRotationMotion() 66 | {} 67 | 68 | 69 | // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // 70 | 71 | Foam::septernion 72 | Foam::solidBodyMotionFunctions::rampedAxisRotationMotion::transformation() const 73 | { 74 | scalar t = time_.value(); 75 | // Rotation around centre of gravity (in radians) 76 | vector theta(0,0,0); 77 | 78 | vector baseTheta 79 | ( 80 | t*radialVelocity0_.x(), 81 | t*radialVelocity0_.y(), 82 | t*radialVelocity0_.z() 83 | ); 84 | vector thetaDot0 85 | ( 86 | radialVelocity0_.x(), 87 | radialVelocity0_.y(), 88 | radialVelocity0_.z() 89 | ); 90 | vector thetaDotf 91 | ( 92 | radialVelocityf_.x(), 93 | radialVelocityf_.y(), 94 | radialVelocityf_.z() 95 | ); 96 | vector dThetaDot=thetaDotf-thetaDot0; 97 | 98 | theta+=baseTheta; 99 | if(t>tf_){ 100 | theta+=(tf_-t0_)*dThetaDot/2+(t-tf_)*thetaDotf; 101 | } else if (t>t0_) { 102 | vector thetaDotDiff=(t-t0_)/(tf_-t0_)*dThetaDot; 103 | theta+=(t-t0_)*thetaDotDiff/2; 104 | } 105 | //scalar magTheta = mag(theta); 106 | //quaternion R(theta/magTheta, magTheta); 107 | quaternion R(theta.x(),theta.y(),theta.z()); 108 | septernion TR(septernion(CofG_)*R*septernion(-CofG_)); 109 | 110 | Info<< "solidBodyMotionFunctions::rampedAxisRotationMotion::transformation(): " 111 | << "Time = " << t << " transformation: " << TR << endl; 112 | 113 | return TR; 114 | } 115 | 116 | 117 | bool Foam::solidBodyMotionFunctions::rampedAxisRotationMotion::read 118 | ( 119 | const dictionary& SBMFCoeffs 120 | ) 121 | { 122 | solidBodyMotionFunction::read(SBMFCoeffs); 123 | 124 | SBMFCoeffs_.lookup("CofG") >> CofG_; 125 | SBMFCoeffs_.lookup("radialVelocity0") >> radialVelocity0_; 126 | SBMFCoeffs_.lookup("radialVelocityf") >> radialVelocityf_; 127 | SBMFCoeffs_.lookup("t0") >> t0_; 128 | SBMFCoeffs_.lookup("tf") >> tf_; 129 | 130 | return true; 131 | } 132 | 133 | // ************************************************************************* // 134 | -------------------------------------------------------------------------------- /rampedAxisRotationMotion/rampedAxisRotationMotion.H: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*\ 2 | ========= | 3 | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 4 | \\ / O peration | 5 | \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation 6 | \\/ M anipulation | 7 | ------------------------------------------------------------------------------- 8 | License 9 | This file is part of OpenFOAM. 10 | 11 | OpenFOAM is free software: you can redistribute it and/or modify it 12 | under the terms of the GNU General Public License as published by 13 | the Free Software Foundation, either version 3 of the License, or 14 | (at your option) any later version. 15 | 16 | OpenFOAM is distributed in the hope that it will be useful, but WITHOUT 17 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 18 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 19 | for more details. 20 | 21 | You should have received a copy of the GNU General Public License 22 | along with OpenFOAM. If not, see . 23 | 24 | Class 25 | Foam::solidBodyMotionFunctions::rampedAxisRotationMotion 26 | 27 | Description 28 | Constant velocity rotation around CoG. Similar to rotatingMotion but 29 | motion specified as rotation vector. 30 | 31 | SourceFiles 32 | rampedAxisRotationMotion.C 33 | 34 | \*---------------------------------------------------------------------------*/ 35 | 36 | #ifndef rampedAxisRotationMotion_H 37 | #define rampedAxisRotationMotion_H 38 | 39 | #include "solidBodyMotionFunction.H" 40 | #include "primitiveFields.H" 41 | #include "point.H" 42 | 43 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 44 | 45 | namespace Foam 46 | { 47 | namespace solidBodyMotionFunctions 48 | { 49 | 50 | /*---------------------------------------------------------------------------*\ 51 | Class rampedAxisRotationMotion Declaration 52 | \*---------------------------------------------------------------------------*/ 53 | 54 | class rampedAxisRotationMotion 55 | : 56 | public solidBodyMotionFunction 57 | { 58 | // Private data 59 | 60 | //- Centre of gravity 61 | point CofG_; 62 | 63 | //- Rotational velocity (deg/s) 64 | vector radialVelocity0_; 65 | vector radialVelocityf_; 66 | scalar t0_,tf_; 67 | 68 | 69 | // Private Member Functions 70 | 71 | //- Disallow copy construct 72 | rampedAxisRotationMotion(const rampedAxisRotationMotion&); 73 | 74 | //- Disallow default bitwise assignment 75 | void operator=(const rampedAxisRotationMotion&); 76 | 77 | 78 | public: 79 | 80 | //- Runtime type information 81 | TypeName("rampedAxisRotationMotion"); 82 | 83 | 84 | // Constructors 85 | 86 | //- Construct from components 87 | rampedAxisRotationMotion 88 | ( 89 | const dictionary& SBMFCoeffs, 90 | const Time& runTime 91 | ); 92 | 93 | 94 | //- Destructor 95 | virtual ~rampedAxisRotationMotion(); 96 | 97 | 98 | // Member Functions 99 | 100 | //- Return the solid-body motion transformation septernion 101 | virtual septernion transformation() const; 102 | 103 | //- Update properties from given dictionary 104 | virtual bool read(const dictionary& SBMFCoeffs); 105 | }; 106 | 107 | 108 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 109 | 110 | } // End namespace solidBodyMotionFunctions 111 | } // End namespace Foam 112 | 113 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 114 | 115 | #endif 116 | 117 | // ************************************************************************* // 118 | -------------------------------------------------------------------------------- /rampedAxisRotationMotion/rampedAxisRotationMotion.dep: -------------------------------------------------------------------------------- 1 | $(OBJECTS_DIR)/rampedAxisRotationMotion.o: rampedAxisRotationMotion.dep 2 | rampedAxisRotationMotion.dep: rampedAxisRotationMotion.C 3 | rampedAxisRotationMotion.dep: rampedAxisRotationMotion.H 4 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/dynamicFvMesh/lnInclude/solidBodyMotionFunction.H 5 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/Time.H 6 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/TimePaths.H 7 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/fileName.H 8 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/word.H 9 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/string.H 10 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/char.H 11 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/Hasher.H 12 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/stringI.H 13 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/wordI.H 14 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/fileNameI.H 15 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/objectRegistry.H 16 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/HashTable.H 17 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/label.H 18 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/pTraits.H 19 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/direction.H 20 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/int.H 21 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/long.H 22 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/longLong.H 23 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/uLabel.H 24 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/uint.H 25 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/ulong.H 26 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/Xfer.H 27 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/XferI.H 28 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/className.H 29 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/debug.H 30 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/debugName.H 31 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/simpleRegIOobject.H 32 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/HashTableI.H 33 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/error.H 34 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/messageStream.H 35 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/OSstream.H 36 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/Ostream.H 37 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/IOstream.H 38 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/bool.H 39 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/scalar.H 40 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/floatScalar.H 41 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/doubleFloat.H 42 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/products.H 43 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/Scalar.H 44 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/doubleScalar.H 45 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/InfoProxy.H 46 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/keyType.H 47 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/keyTypeI.H 48 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/OSstreamI.H 49 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/errorManip.H 50 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/HashTable.C 51 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/List.H 52 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/UList.H 53 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/UListI.H 54 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/Swap.H 55 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/UList.C 56 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/ListLoopM.H 57 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/contiguous.H 58 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/UListIO.C 59 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/token.H 60 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/refCount.H 61 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/typeInfo.H 62 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/runTimeSelectionTables.H 63 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/autoPtr.H 64 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/autoPtrI.H 65 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/tokenI.H 66 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/Istream.H 67 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/ListI.H 68 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/List.C 69 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/FixedList.H 70 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/Hash.H 71 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/wordRe.H 72 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OSspecific/POSIX/lnInclude/regExp.H 73 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/wordReI.H 74 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/StaticAssert.H 75 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/FixedListI.H 76 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/SLList.H 77 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/LList.H 78 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/LList.C 79 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/LListIO.C 80 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/SLListBase.H 81 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/SLListBaseI.H 82 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/FixedList.C 83 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/FixedListIO.C 84 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/PtrList.H 85 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/PtrListI.H 86 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/tmp.H 87 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/tmpI.H 88 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/PtrList.C 89 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/SLPtrList.H 90 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/LPtrList.H 91 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/LPtrList.C 92 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/LPtrListIO.C 93 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/INew.H 94 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/PtrListIO.C 95 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/IndirectList.H 96 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/UIndirectList.H 97 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/UIndirectListI.H 98 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/UIndirectListIO.C 99 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/IndirectListI.H 100 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/BiIndirectList.H 101 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/BiIndirectListI.H 102 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/ListIO.C 103 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/HashTableIO.C 104 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/regIOobject.H 105 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/IOobject.H 106 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/IOobjectI.H 107 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/foamVersion.H 108 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/OSspecific.H 109 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/fileNameList.H 110 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/NamedEnum.H 111 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/stringList.H 112 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/wordList.H 113 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/NamedEnum.C 114 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/regIOobjectI.H 115 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/objectRegistryTemplates.C 116 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/IOdictionary.H 117 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/dictionary.H 118 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/entry.H 119 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/IDLList.H 120 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/ILList.H 121 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/UILList.H 122 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/UILList.C 123 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/UILListIO.C 124 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/ILList.C 125 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/ILListIO.C 126 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/DLListBase.H 127 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/DLListBaseI.H 128 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/DLList.H 129 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/ITstream.H 130 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/tokenList.H 131 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/dictionaryTemplates.C 132 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/primitiveEntry.H 133 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/IStringStream.H 134 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/ISstream.H 135 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/ISstreamI.H 136 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/OStringStream.H 137 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/primitiveEntryTemplates.C 138 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/FIFOStack.H 139 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/clock.H 140 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OSspecific/POSIX/lnInclude/cpuTime.H 141 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/TimeState.H 142 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/dimensionedScalar.H 143 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/dimensionedType.H 144 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/dimensionSet.H 145 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/dimensionedScalarFwd.H 146 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/scalarField.H 147 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/Field.H 148 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/VectorSpace.H 149 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/VectorSpaceI.H 150 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/VectorSpaceM.H 151 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/ops.H 152 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/VectorSpace.C 153 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/IOstreams.H 154 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/prefixOSstream.H 155 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/scalarList.H 156 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/labelList.H 157 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/FieldFunctions.H 158 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/FieldFunctionsM.H 159 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/undefFieldFunctionsM.H 160 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/Field.C 161 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/FieldMapper.H 162 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/FieldM.H 163 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/FieldFunctions.C 164 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/PstreamReduceOps.H 165 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/Pstream.H 166 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/UPstream.H 167 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/DynamicList.H 168 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/DynamicListI.H 169 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/DynamicList.C 170 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/gatherScatter.C 171 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/UOPstream.H 172 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/PstreamBuffers.H 173 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/OPstream.H 174 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/UIPstream.H 175 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/IPstream.H 176 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/combineGatherScatter.C 177 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/gatherScatterList.C 178 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/exchange.C 179 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/PstreamCombineReduceOps.H 180 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/vector2D.H 181 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/Vector2D.H 182 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/Vector2DI.H 183 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/FieldReuseFunctions.H 184 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/FieldFunctionsM.C 185 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/dimensionSets.H 186 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/scalarMatrices.H 187 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/RectangularMatrix.H 188 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/Matrix.H 189 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/MatrixI.H 190 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/Matrix.C 191 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/MatrixIO.C 192 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/RectangularMatrixI.H 193 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/SquareMatrix.H 194 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/SquareMatrixI.H 195 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/SymmetricSquareMatrix.H 196 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/SymmetricSquareMatrixI.H 197 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/SymmetricSquareMatrix.C 198 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/DiagonalMatrix.H 199 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/DiagonalMatrix.C 200 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/scalarMatricesTemplates.C 201 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/ListOps.H 202 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/ListOpsTemplates.C 203 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/dimensionedType.C 204 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/Switch.H 205 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/instantList.H 206 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/instant.H 207 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/dlLibraryTable.H 208 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/dlLibraryTableTemplates.C 209 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/functionObjectList.H 210 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/functionObject.H 211 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/SHA1Digest.H 212 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OSspecific/POSIX/lnInclude/fileMonitor.H 213 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OSspecific/POSIX/lnInclude/sigWriteNow.H 214 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OSspecific/POSIX/lnInclude/sigStopAtWriteNow.H 215 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/septernion.H 216 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/vector.H 217 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/Vector.H 218 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/VectorI.H 219 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/quaternion.H 220 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/tensor.H 221 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/Tensor.H 222 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/SphericalTensor.H 223 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/SphericalTensorI.H 224 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/TensorI.H 225 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/SymmTensor.H 226 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/SymmTensorI.H 227 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/sphericalTensor.H 228 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/symmTensor.H 229 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/quaternionI.H 230 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/septernionI.H 231 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/primitiveFields.H 232 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/labelField.H 233 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/vectorField.H 234 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/tensorField.H 235 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/sphericalTensorField.H 236 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/symmTensorField.H 237 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/point.H 238 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/addToRunTimeSelectionTable.H 239 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/unitConversion.H 240 | rampedAxisRotationMotion.dep: $(WM_PROJECT_DIR)/src/OpenFOAM/lnInclude/mathematicalConstants.H 241 | $(OBJECTS_DIR)/rampedAxisRotationMotion.o: $(EXE_DEP) 242 | $(OBJECTS_DIR)/rampedAxisRotationMotion.o: 243 | @SOURCE_DIR=. 244 | SOURCE=rampedAxisRotationMotion.C ; $(Ctoo) 245 | -------------------------------------------------------------------------------- /rampedAxisRotationMotion/remake: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | wclean 3 | wmake libso 4 | sudo cp $FOAM_USER_LIBBIN/libRampedAxisRotationMotion.so $FOAM_LIBBIN 5 | --------------------------------------------------------------------------------