|
[Sponsors] |
How to implement equation of mixture fraction and variance of mixture fraction? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 23, 2012, 05:13 |
How to implement equation of mixture fraction and variance of mixture fraction?
|
#1 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
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 |
|
April 23, 2012, 09:17 |
|
#2 |
Senior Member
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30 |
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. |
|
April 23, 2012, 10:32 |
|
#3 |
Super Moderator
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29 |
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. |
|
April 24, 2012, 05:24 |
|
#4 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
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 |
|
December 19, 2019, 00:55 |
fvc and Sp
|
#6 |
New Member
Deepak J
Join Date: Jun 2019
Location: India
Posts: 5
Rep Power: 7 |
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. |
|
December 26, 2019, 06:41 |
|
#7 |
New Member
Deepak J
Join Date: Jun 2019
Location: India
Posts: 5
Rep Power: 7 |
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 |
|
December 26, 2019, 10:47 |
|
#9 |
New Member
Deepak J
Join Date: Jun 2019
Location: India
Posts: 5
Rep Power: 7 |
Hi Tobi,
Thanks for the reply. Will definitely check the same. Thanks and regards Deepak |
|
|
|
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 |