# Turbulence Model with Elliptic Relaxation

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

 August 7, 2012, 15:50 Turbulence Model with Elliptic Relaxation #1 New Member   Join Date: Feb 2012 Posts: 6 Rep Power: 7 Sponsored Links 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 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

 August 16, 2012, 12:01 #2 Senior Member   Tarak Join Date: Aug 2010 Location: State College, PA Posts: 110 Rep Power: 8 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

 August 16, 2012, 15:46 #3 New Member   Join Date: Feb 2012 Posts: 6 Rep Power: 7 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 fmuEqu ( - fvm::laplacian(fmu_) == - fvm::Sp(1.0/Lsqr,fmu_) + 1.0/Lsqr ); fmuEqu().relax(); solve(fmuEqu);```

 Tags elliptic, relaxation

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Jade M Main CFD Forum 27 August 11, 2017 15:41 msrinath80 OpenFOAM Running, Solving & CFD 18 March 3, 2015 06:36 nedved OpenFOAM Running, Solving & CFD 2 November 30, 2014 23:43 philippose OpenFOAM Running, Solving & CFD 30 August 4, 2010 10:26 Georges CFX 1 February 28, 2007 17:15