|
[Sponsors] |
August 9, 2018, 23:20 |
Adding LES to a laminar solver
|
#1 |
Senior Member
Ali Shayegh
Join Date: Oct 2015
Posts: 130
Rep Power: 10 |
Hi there !
My question is about adding turbulence to a laminar solver. I'm using rheoEFoam to simulate a flow with electro-kinetic effects. Unfortunately, this solver is laminar; I want to simulate electric-flow interaction using LES(Large Eddy Simulation). Do you have any idea doing so? Best wishes Ali |
|
August 13, 2018, 05:33 |
|
#2 |
Member
ano
Join Date: Jan 2017
Location: Delft
Posts: 58
Rep Power: 10 |
Hi Ali,
The big question would be whether you want to keep your rheological models or do you have a Newtonian fluid and only want to use the electric library? The former would be complicated, the latter much easier. |
|
August 13, 2018, 08:48 |
|
#3 |
Senior Member
Ali Shayegh
Join Date: Oct 2015
Posts: 130
Rep Power: 10 |
Hi ano
My case is the latter, although there is a file named constitutiveProperties in constant directory of a rheoEFoam problem in which you could set the "type" as Newtonian and not necessarily the other models. |
|
August 13, 2018, 09:42 |
|
#4 |
Member
ano
Join Date: Jan 2017
Location: Delft
Posts: 58
Rep Power: 10 |
Hello Ali,
The OpenFoam turbulence model uses the inbuilt transport model, which calculates the viscosity, so that the turbulence model can add the molecular and turbulent viscosity to an effective viscosity. Therefore, it is better to stick to the inbuilt transport model instead of the constitutive model, when you want to have turbulence. You have to do two things: A) get rid of the constitutive model and B) use instead the inbuilt OpenFoam transportmodel to describe your viscosity and the turbulencemodel to describe your turbulence. (0.First copy the solver to a new directory and rename it (change the names in Make/files and rhoEFoam.C). Compile with 'wmake' to see whether it works.) A. Get rid of constitutive model: 1. Delete in createFields.H: Code:
// Create constitutive equation constitutiveModel constEq(U, phi); Code:
IOdictionary cttProperties ( IOobject ( "constitutiveProperties", runTime.constant(), mesh, IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ); 2. Delete in rheoEFoam.C (or the new name you use): Code:
#include "constitutiveModel.H" Code:
// ---- Solve constitutive equation ---- constEq.correct(); B) Use instead the inbuilt OpenFoam transportModel to describe your viscosity and the turbulenceModel to describe your turbulence: 1. Add at the end of createFields.H the lines to create a transport model instance and a turbulence instance. And also a transportProperties dictionary to read the density whcih you need for the electric forcing: Code:
singlePhaseTransportModel laminarTransport(U, phi); autoPtr<incompressible::turbulenceModel> turbulence ( incompressible::turbulenceModel::New(U, phi, laminarTransport) ); Info« "Reading transportProperties\n" « endl; IOdictionary transportProperties ( IOobject ( "transportProperties", runTime.constant(), mesh, IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ); dimensionedScalar rho ( transportProperties.lookup("rho") ); First to read the declarations of the transport and turbulence model into your solver. Code:
#include "ppUtilInterface.H" #include "EDFModel.H" #include "singlePhaseTransportModel.H" #include "turbulentTransportModel.H" Code:
#include "initContinuityErrs.H" turbulence->validate(); Code:
laminarTransport.correct(); turbulence->correct(); runTime.write(); Code:
( fvm::ddt(U) + fvm::div(phi, U) + turbulence->divDevReff(U) == fvOptions(U) + elecM.Fe()/rho ); Code:
EXE_INC = \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \ -I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \ ..... EXE_LIBS = \ -lturbulenceModels \ -lincompressibleTurbulenceModels \ -lincompressibleTransportModels \ In the end you can copy the transportProperties and turbulenceProperties e.g. from 'tutorials/incompressible/pimpleFoam/LES/channel395/constant', you have to add rho to the transportProperties file. I wonder whether one can use the 'normal' turbulence models for flow with electro-kinetic effects? |
|
August 13, 2018, 12:50 |
|
#5 |
Senior Member
Ali Shayegh
Join Date: Oct 2015
Posts: 130
Rep Power: 10 |
I really appreciate your accurate, coherent and high velocity reply . I will do this and let you know what happens . To the best of my
knowledge, RANS models don't fit for low Re problems with which I'm dealing. |
|
August 19, 2018, 03:31 |
|
#6 | |
Senior Member
Ali Shayegh
Join Date: Oct 2015
Posts: 130
Rep Power: 10 |
Quote:
6-in solver.C delete : Code:
bool sPS = cttProperties.subDict("passiveScalarProperties").lookupOrDefault<Switch>("solvePassiveScalar", false); Code:
if (sPS) C.writeOpt() = IOobject::AUTO_WRITE; Code:
if (sPS) { #include "CEqn.H" } Code:
dimensionedScalar rho_ = transportProperties.lookup("rho"); tmp<fvVectorMatrix> tUEqn ( fvm::ddt(U) + fvm::div(phi, U) + turbulence->divDevReff(U) == fvOptions(U) + elecM.Fe()/rho_ ); And that's it! It is successfully compiled! ano ! I really appreciate your co-operation. |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Error running compiled solver of fireFoam and conjugate heat transfer solver | charles4allme | OpenFOAM Running, Solving & CFD | 2 | April 26, 2019 06:58 |
adding Porous media to lagrangian Solver | kalyan | OpenFOAM Programming & Development | 0 | September 19, 2014 07:41 |
Star cd es-ice solver error | ernarasimman | STAR-CD | 2 | September 12, 2014 00:01 |
Problem of InterFoam with LES SpalartAllmarasIDDES | keepfit | OpenFOAM | 3 | August 29, 2013 11:21 |
LES solver with variable density for incompressible liquids | matthias | OpenFOAM Running, Solving & CFD | 1 | April 26, 2010 05:46 |