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

How to implement equation of mixture fraction and variance of mixture fraction?

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By niklas

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 23, 2012, 05:13
Default How to implement equation of mixture fraction and variance of mixture fraction?
  #1
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi all,

I am using OF for two years now and wanna get deeper into the code and wanna make a new solver using an old one and transform the steady equations into the time dependent equations.

Okay my problem for now is, that I am not sure if I interpret the *Eqn.H files correct. I read a few threats here in the forum which helped me a lot but now I need your help.
I added an attachment with my problem. There you can see my solving equations. I just wanna have a look at the differential equations but I think that I transformed them not right, or?

Further more I do not know what "Sp" means.

Thx in advance.

Regards Tobi
Attached Files
File Type: pdf mixtureFraction.pdf (90.9 KB, 151 views)
Tobi is offline   Reply With Quote

Old   April 23, 2012, 09:17
Default
  #2
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30
akidess will become famous soon enough
fvm::Sp denotes an implicit source term. You can ignore it when translating code into equations, it's purely related to numerics.
__________________
*On twitter @akidTwit
*Spend as much time formulating your questions as you expect people to spend on their answer.
akidess is offline   Reply With Quote

Old   April 23, 2012, 10:32
Default
  #3
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29
niklas will become famous soon enoughniklas will become famous soon enough
suppose you want to solve this equation

dU/dt = A + BU

implemented like
fvm:ddt(U) == A + B*U

using euler scheme,
this results in

U^n - U^{n-1} = dt*A + dt*B*U^{n-1}
=>
U^n = dt*A + (dt*B + 1)*U_{n-1}

implemented like this
fvm::ddt(U) == A + fvm::Sp(B, U)

this results in
U^n - U^{n-1} = dt*A + dt*B*U^n
=>
(1 - dt*B)*U^n = dt*A + U^{n-1}

so the first implementation is explicit treatment of the B*U term, while the other is implicit treatment.
Hope this makes it clearer

This also makes it possible to do some 'cheating' of large explicit source-terms by linearizing them

again...
dU/dt = A + B*U = A*1 + B*U + A*(U/U) + B*U

which can be implemented like
fvm::ddt(U) = fvm:Sp(A/U, U) + B*U

which in turn is treated numerically like
U^{n} - U ^{n-1} = dt*(A*U^n / U^{n-1} + B*U^{n-1})
so you see now that A is no longer multiplied by 1, but by something else, which for the
converged solution hopefully is 1 and have a stabilizing effect on the solver.
sylvester and Tobi like this.
niklas is offline   Reply With Quote

Old   April 24, 2012, 05:24
Default
  #4
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi nicklas,

thanks for your good explanation!
I used your statement and generated a file (attachment). can you have a look at the file?

I am interessted in the last line I added. Thats my understanding of your post.


The second file is a transformation from openfoam equation code into scalar equation. Is that correct? Its a while ago that I used grad, div and laplacian.

thx in advance
tobi
Attached Files
File Type: pdf schemes.pdf (85.5 KB, 88 views)
File Type: pdf Niklas2.pdf (79.4 KB, 66 views)
File Type: pdf Niklas1.pdf (96.1 KB, 61 views)
Tobi is offline   Reply With Quote

Old   December 1, 2015, 14:23
Default
  #5
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi all,

I just want to comment, that the "Schemes.pdf" file is incorrect.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   December 19, 2019, 00:55
Post fvc and Sp
  #6
New Member
 
Deepak J
Join Date: Jun 2019
Location: India
Posts: 5
Rep Power: 7
dj18deepak is on a distinguished road
Sorry for bumping into this old thread. I am a beginner in CFD and OpenFoam and i am trying to implement mixture fraction and mixture fraction variance equations.

Can anyone help me understand why we need fvc apart from the fact that it is an explicit equation? I have seen that for calculating gradient or with source terms (Sp), it is always accompanied with fvc. Why is it so?

Also what is happening when the Sp term is introduced.

Thanks in advance

Last edited by dj18deepak; December 19, 2019 at 10:28.
dj18deepak is offline   Reply With Quote

Old   December 26, 2019, 06:41
Default
  #7
New Member
 
Deepak J
Join Date: Jun 2019
Location: India
Posts: 5
Rep Power: 7
dj18deepak is on a distinguished road
Hi all,
I am trying to implement mixture fraction and mixture fraction variance conserved transport equations to simulate a simple propane non reacting jet flame. The simulation is well and running with slight amount of deviations from experimental data while using small value of grading in the x and y directions (8 and 8 resp). The problem i am facing is that with higher values of grading (12 in x-direction and 15 in y-direction), even though the velocity, temperature and all profiles are evolving, the mixture fraction and mixture fraction variance variables are having very low values of the order of 10^-70 (for mixture fraction). What might be the possible causes of the error. Kindly help me. I am a beginner.

Code

fvScalarMatrix mifEqn
(
fvm::ddt(rho, mif)
+ fvm::div(phi, mif)
- fvm::laplacian(turbulence->mut()/0.7, mif)
);
mifEqn.relax();
mifEqn.solve();

fvScalarMatrix mifvarEqn
(
fvm::ddt(rho, mifvar)
+ fvm::div(phi, mifvar)
- fvm::laplacian(turbulence->mut()/0.7, mifvar)
- 2.86*turbulence->mut()*magSqr(fvc::grad(mif))
+ 2*rho*(turbulence->epsilon()/(turbulence->k()+k_small))*mifvar
);
mifvarEqn.relax();
mifvarEqn.solve(mesh.solver("mifvar"));

fvSchemes dictionary

ddtSchemes
{
default Euler;
}

gradSchemes
{
default cellLimited Gauss linear 1;
}

divSchemes
{
default none;

div(phi,U) Gauss limitedLinearV 1;
div(phiU,p) Gauss limitedLinear 1;
div(phi,epsilon) Gauss limitedLinear 1;
div(phi,K) Gauss limitedLinear 1;
div(phi,k) Gauss limitedLinear 1;
div(phi,H) Gauss limitedLinear 1;
div(phi,Yi_h) Gauss limitedLinear 1;
div(phi,mif) Gauss limitedLinear 1;
div(phi,mifvar) Gauss limitedLinear 1;
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
}

laplacianSchemes
{
default Gauss linear corrected;

}

interpolationSchemes
{
default linear;
}

fluxRequired
{
p;
}

fvSolution dictionary

solvers
{

"rho.*"
{
solver diagonal;
}

p
{
solver PCG;
preconditioner DIC;
tolerance 1e-6;
relTol 0.1;
}

pFinal
{
$p;
tolerance 1e-6;
relTol 0.1;
}

"(U|h|k|epsilon)"
{
solver PBiCGStab;
preconditioner DILU;
tolerance 1e-6;
relTol 0.1;
}

"(U|h|k|epsilon|mif)Final"
{
$U;
relTol 0.1;
}

"(mif|mifvar)"
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-07;
relTol 0.;
}
Yi
{
$hFinal;
}

}
relaxationFactors
{
fields
{
p 0.4;
rho 0.5;
}
equations
{
U 0.4;
k 0.5;
epsilon 0.5;
//H 0.5;
mif 0.5;
mifvar 0.2;
}
}
PIMPLE
{
momentumPredictor no;
nOuterCorrectors 1;
nCorrectors 2;
nNonOrthogonalCorrectors 0;
}

Kindly note: mif is mixture fraction and mifvar is mixture fraction variance

Thanks and regards
Deepak J
dj18deepak is offline   Reply With Quote

Old   December 26, 2019, 10:01
Default
  #8
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi, check out my repository of the flamelet model. There you see how it has to be implemented.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   December 26, 2019, 10:47
Default
  #9
New Member
 
Deepak J
Join Date: Jun 2019
Location: India
Posts: 5
Rep Power: 7
dj18deepak is on a distinguished road
Hi Tobi,
Thanks for the reply. Will definitely check the same.

Thanks and regards
Deepak
dj18deepak is offline   Reply With Quote

Reply


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[openSmoke] libOpenSMOKE Tobi OpenFOAM Community Contributions 562 January 25, 2023 10:21
What is mixture fraction variance? Hugo FLUENT 3 April 20, 2015 22:24
the 2 equation of flamelet model. AdidaKK CFX 0 October 17, 2009 06:33


All times are GMT -4. The time now is 21:08.