implementing the pimplefoam to oscillating flow solver
play

Implementing the pimpleFoam to oscillating flow solver - PowerPoint PPT Presentation

Outline Theory Background porosityZones Library Solvers Turbulence model library Runnning the case Implementing the pimpleFoam to oscillating flow solver porousOsciPimpleFoam using volume-averaged kOmega turbulence model Yanyan Zhai


  1. Outline Theory Background porosityZones Library Solvers Turbulence model library Runnning the case Implementing the pimpleFoam to oscillating flow solver porousOsciPimpleFoam using volume-averaged kOmega turbulence model Yanyan Zhai Applied Mechanics/Fluid Dynamics, Technical University of Denmark, Copenhagen, Denmark 2019-11-28 Yanyan Zhai porousOsciPimpleFoam with volume-averaged kOmega model 2019-11-28 1 / 30

  2. Outline Theory Background porosityZones Library Solvers Turbulence model library Runnning the case Outline Theory Background porosityZones Library solvers Turbulence model library Running the case Yanyan Zhai porousOsciPimpleFoam with volume-averaged kOmega model 2019-11-28 2 / 30

  3. Outline Theory Background porosityZones Library Solvers Turbulence model library Runnning the case Flow equation General flow equations Continuity equation ∂u i = 0 ∂x i Momentum equation ∂u i ∂t + ∂u i u j = − 1 ∂p ∂ ν ( ∂u i + ∂u j + ) + S i ∂x j ρ ∂x i ∂x j ∂x j ∂x i Yanyan Zhai porousOsciPimpleFoam with volume-averaged kOmega model 2019-11-28 3 / 30

  4. Outline Theory Background porosityZones Library Solvers Turbulence model library Runnning the case Flow equation Flow equations in porous media ∂ � u i � = 0 ∂x i ∂ � p � f (1 + C m ) ∂ � u i � + 1 ∂ � u i � � u i � = − 1 + g j ∂t n n ∂x j n ρ ∂x i + ∂ � u j � + 1 ∂ ν ( ∂ � u i � ) + F i + B i n ∂x j ∂x j ∂x i ρ 1 − n C m = γ p n � F i = aρ � u i � + bρ � u j � � u j � � u i � Yanyan Zhai porousOsciPimpleFoam with volume-averaged kOmega model 2019-11-28 4 / 30

  5. Outline Theory Background porosityZones Library Solvers Turbulence model library Runnning the case Turbulence model Standard kOmega model Turbulence Kinetic Energy ρ∂k ∂k ∂U i ∂ [( µ + σ ∗ µ T ) ∂k − β ∗ ρkω + ∂t + ρU j = τ ij ] ∂x j ∂x j ∂x j ∂x j Specific Dissipation Rate ρ∂ω ∂ω = αω ∂U i ∂ [( µ + σµ T ) ∂ω ∂t + ρU j k τ ij − βρω + ] ∂x j ∂x j ∂x j ∂x j Closure Coefficients β ∗ = 9 / 100 σ ∗ = 1 / 2 α = 5 / 9 β = 3 / 40 σ = 1 / 2 Auxiliary Relation 1 2 /ω ǫ = β ∗ ωk l = k Eddy Viscosity µ T = ρk/ω Yanyan Zhai porousOsciPimpleFoam with volume-averaged kOmega model 2019-11-28 5 / 30

  6. Outline Theory Background porosityZones Library Solvers Turbulence model library Runnning the case Turbulence model Volume-averaged kOmega model Turbulence Kinetic Energy � � u ′ i u ′ ∂ � k � + 1 ∂ � k � � u j � = ∂ [( ν + � ν t � σ ∗ ) ∂ � k � ∂ � u i � j ] − ∂t n ∂x j ∂x j ∂x j n ∂x j − β ∗ � ω � � k � + nβ ∗ ω ∞ k ∞ Specific Dissipation Rate � ∂ � u i � ∂ � ω � + 1 ∂ � ω � � u j � = ∂ [( ν + � ν t � σ ) ∂ � ω � ] − γ � ω � � u ′ i u ′ j ∂t n ∂x j ∂x j ∂x j n � k � ∂x j − β � ω � 2 + βω 2 ∞ k ∞ = 3 . 71 − n √ n ( � u 1 � 2 + � u 2 � 2 ) (1 − n ) 1 . 5 39 . 0 ( � u 1 � 2 + � u 2 � 2 ) 1 / 2 ω ∞ = 3 . 7 D 50 n 2 Yanyan Zhai porousOsciPimpleFoam with volume-averaged kOmega model 2019-11-28 6 / 30

  7. Outline Theory Background porosityZones Library Solvers Turbulence model library Runnning the case porosityZones Library The library is referred via a dictionary file named porosityZones in the tutorial as shown below. porousmedias { coordinateSystem { e1 (1 0 0); e2 (0 1 0); } resistanceFormulation vanGent1995; porosity 0.4; gammaAddedMass 0.34; d50 d50 [0 1 0 0 0 0 0] 0.036; alpha alpha [0 0 0 0 0 0 0] 500; beta beta [0 0 0 0 0 0 0] 2.0; } Yanyan Zhai porousOsciPimpleFoam with volume-averaged kOmega model 2019-11-28 7 / 30

  8. Outline Theory Background porosityZones Library Solvers Turbulence model library Runnning the case porosityZones Library Add the viscous and inertial resistance force contribution to the momentum equation void Foam::porosityZones::addResistance(fvVectorMatrix& UEqn) { forAll(*this, i) { operator[](i).addResistance(UEqn); } } Yanyan Zhai porousOsciPimpleFoam with volume-averaged kOmega model 2019-11-28 8 / 30

  9. Outline Theory Background porosityZones Library Solvers Turbulence model library Runnning the case porosityZones Library Porosity field will be written into 0 folder with the code in createPorosityFields.H porosityZones pZones(mesh); // Obtain the porosity field tmp<volScalarField> tporosity(pZones.porosity()); volScalarField& porosity = tporosity(); // Writes the porosity field to starting time folder porosity.write(); // Create a field with the porosity on the faces // Interpolated from the centers. surfaceScalarField porosityFace (fvc::interpolate(pZones.porosity()())); Yanyan Zhai porousOsciPimpleFoam with volume-averaged kOmega model 2019-11-28 9 / 30

  10. Outline Theory Background porosityZones Library Solvers Turbulence model library Runnning the case UEqn.H pimpleFoam Constructing the original momentum eqaution. tmp<fvVectorMatrix> UEqn ( fvm::ddt(U) + fvm::div(phi, U) + turbulence->divDevReff(U) == fvOptions(U) ); Yanyan Zhai porousOsciPimpleFoam with volume-averaged kOmega model 2019-11-28 10 / 30

  11. Outline Theory Background porosityZones Library Solvers Turbulence model library Runnning the case UEqn.H porousOsciPimpleFoam tmp<fvVectorMatrix> UEqn ( pZones.ddt(U) // + 1.0/pZones.porosity()*fvm::div(phi/(porosityFace), U) + turbulence->divDevReff(U) // Turbulence added == fvOptions(U) // Source term (not used) use via fvOptionsDict + bodyForcing->correct() // Source term due to body force ); The following code is added between ’UEqn().relax();’ and ’fvOptions.constrain(UEqn());’ pZones.addResistance(UEqn()); Yanyan Zhai porousOsciPimpleFoam with volume-averaged kOmega model 2019-11-28 11 / 30

  12. Outline Theory Background porosityZones Library Solvers Turbulence model library Runnning the case createFields.H porousOsciPimpleFoam The following code is added after U field volVectorField F ( IOobject ( "F", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ),mesh, dimensionedVector("F", dimensionSet(0,1,-2,0,0,0,0), Foam::vector(0,0,0)) ); Yanyan Zhai porousOsciPimpleFoam with volume-averaged kOmega model 2019-11-28 12 / 30

  13. Outline Theory Background porosityZones Library Solvers Turbulence model library Runnning the case createFields.H porousOsciPimpleFoam Creating new dictionary in constant related to body force source term IOdictionary bodyForcingProperties ( IOobject ( "bodyForcingProperties", runTime.constant(), mesh, IOobject::MUST_READ, IOobject::NO_WRITE ) ); Yanyan Zhai porousOsciPimpleFoam with volume-averaged kOmega model 2019-11-28 13 / 30

  14. Outline Theory Background porosityZones Library Solvers Turbulence model library Runnning the case createFields.H porousOsciPimpleFoam Creating new sub-dictionary for bodyForcingProperties dictionary autoPtr<Foam::bodyForcing> bodyForcing ( Foam::bodyForcing::New ( mesh, mesh.lookupObject<IOdictionary> ("bodyForcingProperties").subDict("bodyForcing") ) ); Yanyan Zhai porousOsciPimpleFoam with volume-averaged kOmega model 2019-11-28 14 / 30

  15. Outline Theory Background porosityZones Library Solvers Turbulence model library Runnning the case bodyForcingProperties porousOsciPimpleFoam The dictionay in the case gives the basic information of oscillating flow bodyForcing { forceModel sinusoidalBodyForce; period 12; Um 2; constantSlope 0.000; forceDirection (1 0 0); } Yanyan Zhai porousOsciPimpleFoam with volume-averaged kOmega model 2019-11-28 15 / 30

  16. Outline Theory Background porosityZones Library Solvers Turbulence model library Runnning the case head file .C porousOsciPimpleFoam Two new files are added to use the class porosityZones and bodyforcing. #include "fvCFD.H" #include "singlePhaseTransportModel.H" #include "turbulenceModel.H" #include "pimpleControl.H" #include "fvIOoptionList.H" #include "IOporosityModelList.H" #include "IOMRFZoneList.H" #include "porosityZones.H" #include "bodyForcing.H" //BF Yanyan Zhai porousOsciPimpleFoam with volume-averaged kOmega model 2019-11-28 16 / 30

  17. Outline Theory Background porosityZones Library Solvers Turbulence model library Runnning the case main() in .C porousOsciPimpleFoam In this part, the following code is added after #include ”createMesh.H” to create the porosity field. #include "createPorosityFields.H" // porosity field The resistance induced by porous media is considered before ”runTime.write();”. F = pZones.porousBodyForce(U); // Calculating resistance from porosity Yanyan Zhai porousOsciPimpleFoam with volume-averaged kOmega model 2019-11-28 17 / 30

  18. Outline Theory Background porosityZones Library Solvers Turbulence model library Runnning the case files in Make folder porousOsciPimpleFoam files in porousOsciPimpleFoam porousOsciPimpleFoam.C EXE = $(FOAM_USER_APPBIN)/porousOsciPimpleFoam files in pimpleFoam pimpleFoam.C EXE = $(FOAM_APPBIN)/pimpleFoam Yanyan Zhai porousOsciPimpleFoam with volume-averaged kOmega model 2019-11-28 18 / 30

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend