CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

Turbulence Model with Elliptic Relaxation

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   August 7, 2012, 15:50
Post Turbulence Model with Elliptic Relaxation
  #1
New Member
 
Join Date: Feb 2012
Posts: 6
Rep Power: 5
twray is on a distinguished road
Hello all,

I've been working on implementing a damping function, fmu, defined by an elliptic relaxation equation. This is the first modification I've done that has required defining my own discretized equation so I'm sure there are errors in my implementation. Also I believe my method of setting the initial and boundary conditions could use improvement. Currently my simpleFoam case compiles and runs but the results are incorrect.

fmu must be between 0 and 1 and equal 0 on wall boundaries. To initialize this I added the code below to the constructor.
In /0/fmu I set a value of 0 to my wall patch and 0.5 to the internalField and all other patches.
Code:
fmu_
    (
        IOobject
        (
            "fmu",
            runTime_.timeName(),
            mesh_,
            IOobject::MUST_READ,
            IOobject::AUTO_WRITE
        ),
        mesh_
),
Is this the proper method of defining initial conditions? Is adding something like the following in the constructor without defining a /0/fmu file possible or more appropriate?
dimensionedScalar("fmu",dimless,.5)
label patchWall = mesh_.boundaryMesh().findPatchID("wall")
fmu_.boundaryField()[patchWall]=0.0

The fmu equation is

Code:
        const volScalarField Lsqr(this->Lsqr(W,S,Cmu,Tt,k_,epsilon_,zeta));
        tmp<fvScalarMatrix> fmuEqu
        (
            Lsqr*fvm::laplacian(fmu_) == scalar(1.0) - fmu_
        );
        fmuEqu().relax();
        solve(fmuEqu);
        label patchWall = U_.mesh().boundaryMesh().findPatchID("wall");
        fmu_.boundaryField()[patchWall]=0.0;
I moved the negative into my Lsqr function. I added definitions for laplacian(fmu), relaxationFactors and solvers in fvSchemes and fvSolution. The last line is to update the boundary condition on the wall.

Does this procedure look correct? Is using the boudaryField()[patchWall]=0.0 the proper way to correct the wall boundary condition?

Thanks in advance for any input,
Tim
twray is online now   Reply With Quote

Old   August 16, 2012, 12:01
Default
  #2
Senior Member
 
Tarak
Join Date: Aug 2010
Location: State College, PA
Posts: 105
Rep Power: 7
Tarak is on a distinguished road
Hii,

You can do something like this so that you do not need to create Initial Condition files for the fields you want to get printed out:

LPrint_
(
IOobject
(
"LPrint",
runTime_.timeName(),
mesh_,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh_,
dimensionedScalar("LPrint", dimensionSet(0, 1, 0, 0, 0, 0, 0), 0.0),
zeroGradientFvPatchScalarField::typeName
Tarak is offline   Reply With Quote

Old   August 16, 2012, 15:46
Default
  #3
New Member
 
Join Date: Feb 2012
Posts: 6
Rep Power: 5
twray is on a distinguished road
Thanks for the input.

Also, as an update, I use the following to solve the elliptic equation. It seems to be working, but I'm still testing.

Code:
        tmp<fvScalarMatrix> fmuEqu
        (
            - fvm::laplacian(fmu_) == - fvm::Sp(1.0/Lsqr,fmu_) + 1.0/Lsqr
        );
        fmuEqu().relax();
        solve(fmuEqu);
twray is online now   Reply With Quote

Reply

Tags
elliptic, relaxation

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Use of k-epsilon and k-omega Models Jade M Main CFD Forum 12 June 2, 2015 13:16
Superlinear speedup in OpenFOAM 13 msrinath80 OpenFOAM Running, Solving & CFD 18 March 3, 2015 06:36
SimpleFoam case with SpalartAllmaras turbulence model implemented nedved OpenFOAM Running, Solving & CFD 2 November 30, 2014 23:43
KOmega Turbulence model from wwwopenFOAMWikinet philippose OpenFOAM Running, Solving & CFD 30 August 4, 2010 10:26
SSG Reynolds Turbulence Model Georges CFX 1 February 28, 2007 17:15


All times are GMT -4. The time now is 13:35.