|
[Sponsors] |
How to add implicit terms to the momentum equation? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
September 23, 2014, 18:01 |
How to add implicit terms to the momentum equation?
|
#1 |
Member
Join Date: Jul 2010
Posts: 52
Rep Power: 16 |
Hi all;
I want to solve a free homogeneous shear case. So I am trying to add the following terms to the momentum equation in pisoFoam: a) U1 & grad(U1) b) U1 & grad(U) c) U & grad(U1) where U is the velocity and U1 is a known volVectorField. (It represents the constant mean velocity obtained by the imposed shear.) This is what I did: Code:
fvVectorMatrix UEqn ( fvm::ddt(U) + fvm::div(phi, U) + turbulence->divDevReff(U) //Added terms: -(U1 & fvc::grad(U1)) // term (a) explicit -fvm::div(U1phi, U)-fvm::Sp(fvc::div(U1phi), U) //term (b) implicit -(U & fvc::grad(U1)) /term (c) explicit?? ); -Does term (c) has to be defined implicitly too? -How can I do it because Su, SuSp nor Sp accept tensor fields? I ran that case and the simulation converges. But the results are not what I expected, so I am trying to figure out were could the problem be. Thanks, Mary |
|
December 7, 2014, 14:48 |
|
#2 |
Member
Join Date: Jul 2010
Posts: 52
Rep Power: 16 |
Hi everyone;
I am still struck with the case that I mentioned in the previous post. I will give more details to see if someone has any suggestions. The case is a free homogenous shear flow. So I have no walls and periodic boundary conditions everywhere. I am imposing a known mean shear S=dU1/dz, so velocity is not periodic in the z direction. But doing a bit of math I can decompose U_total=U1+U, where U1 is the mean velocity and U are the velocity FLUCTUATIONS (I said that wrong in the previous post.), and rewrite the momentum equations. I am trying to do something similar to Rogallo (1981) but in LES instead of DNS with spectral methods. The velocity fluctuations U are periodic in all direction and the mean velocity U1 is known, so I can solve the equations for the velocity fluctuations. The equation that I get are in the previous post. I am getting some instabilities in my simulations in the top and bottom boundaries (see pic and remember Ux is the velocity fluctuations). I think it could be because I am solving the term "c" explicitly, but I am not sure. Could that be the problem? Does anyone know how to add the term U & grad(U1) implicitly? or any other suggestion of why I am getting those instabilities? Thanks a lot, Mary Last edited by MaryBau; December 7, 2014 at 15:56. |
|
December 8, 2014, 01:10 |
|
#3 | |
Senior Member
|
Quote:
Dear MaryBau, First of all, your discretized equations is in vector form. And the term for (c) explicit, is a vector. You can add this term implicitly by considering it as a source like this: Let, U2 = (U & fvc::grad(U1)); Then you can try something like this: fvm::Sp(rho, U2); I think it will work. - Best Luck! |
||
December 8, 2014, 22:13 |
|
#4 |
Member
Join Date: Jul 2010
Posts: 52
Rep Power: 16 |
Hi Tushar and all;
Thanks so much for the advise. Unfortunately I tried and it does not work, because I can only have one variable that is being solved implicitly. OpenFoam does not know if it should solve for U or U2. The solver compiles, but when I try to run the case I get this error: Code:
--> FOAM FATAL ERROR: incompatible fields for operation [U] + [(U&grad(U1))] |
|
December 8, 2014, 23:58 |
|
#5 |
Senior Member
|
You are correct, OpenFOAM will show error.
Try the following formulation, I hope this will work. fvm::Sp(rho, (U & fvc::grad(U1))); Or, If you wish you can upload your case files (including solver) here that will help you resolve your query faster. - Best Luck! |
|
December 9, 2014, 08:23 |
|
#6 |
Senior Member
Join Date: Oct 2013
Posts: 397
Rep Power: 19 |
I don't think this will work, as far as I know the second argument of a fvm function needs to be a single field to solve for. I believe this is required so OF can know which field needs to be solved.
|
|
December 11, 2014, 16:20 |
|
#8 |
Member
Join Date: Jul 2010
Posts: 52
Rep Power: 16 |
Hi all;
I have tried what you all have suggested plus a couple more things, but no luck so far. I still have those instabilities at the top and bottom boundaries (which are defiened as periodic). I know is term c that is causing those instabilities, but not sure why. I am attaching my solver and my case. I am not including the original files for the initial turbulent field because they are too big. And Ushear in my solver is U1 in this post. Thank for your help and suggestions! Mary |
|
December 12, 2014, 01:39 |
|
#9 |
Senior Member
|
Before going for the solver correction, I would advice you to first try with these settings:
For fvSchemes files: gradSchemes { default none; grad(p) Gauss linear; grad(U) Gauss linear; grad(k) Gauss linear; grad(omega) Gauss linear; } divSchemes { default none; div(phi,U) Gauss upwind; div(phi,k) Gauss upwind; div(phi,omega) Gauss upwind; div((nuEff*dev(T(grad(U))))) Gauss linear; } laplacianSchemes { default none; laplacian(nuEff,U) Gauss linear corrected; laplacian((1|A(U)),p) Gauss linear corrected; laplacian(DomegaEff,omega) Gauss linear corrected; laplacian(DkEff,k) Gauss linear corrected; } snGradSchemes { default corrected; } For fvSolution file: PISO { nCorrectors 3; nNonOrthogonalCorrectors 2; .... } I hope it will work. - Best Luck! |
|
December 20, 2014, 13:24 |
|
#10 |
Member
Join Date: Jul 2010
Posts: 52
Rep Power: 16 |
Hi Tushar and all,
Sorry for the late reply, I was traveling. Thanks a lot for your help. I tried what you suggested. I definitely reduces the instabilities that I have in the top/bottom boundaries. But I think it also kills all the turbulence in general. Specially if I put "div(phi,U) Gauss upwind", isn't too dissipative for Smagorinsky? I also not sure if "nNonOrthogonalCorrectors 2" and "corrected" in the "laplacianSchemes" does much if my mesh is all orthogonal. Thanks, Mary |
|
December 23, 2014, 07:45 |
|
#11 | |
Senior Member
Dongyue Li
Join Date: Jun 2012
Location: Beijing, China
Posts: 849
Rep Power: 18 |
Quote:
Code:
fvVectorMatrix UEqn ( fvm::ddt(U) + fvm::div(phi, U) + turbulence->divDevReff(U) //Explicit terms +(Ushear & fvc::grad(Ushear)) //Term a //not solving for Ushear so explicit! //+(Ushear & fvc::grad(U)) //Term b //+(U & fvc::grad(Ushear)) //Term c //+ fvc::div(phi, Ushear)-fvc::Sp(fvc::div(phi), Ushear) //Term c //or Implicit terms //+ fvm::div(Ushearphi, Ushear)-fvm::Sp(fvc::div(Ushearphi), Ushear) //Term a + fvm::div(Ushearphi, U) //- fvm::Sp(fvc::div(Ushearphi), U) //Term b //solving for U so it has to be implicit //+ fvm::div(phi, Ushear)-fvm::Sp(fvc::div(phi), Ushear) //Term c //All this term does not work because it is solving for Ushear! //+ (U & fvm::SuSp(p1,Ushear)) //As Pascal:: + fvc::div(phi, Ushear) + fvm::div(Ushearphi, U) + fvc::div(Ushearphi, Ushear) ); |
||
December 26, 2014, 22:46 |
|
#12 |
Member
Join Date: Jul 2010
Posts: 52
Rep Power: 16 |
Hi sharonyue;
Ushear is an imposed/known variable, what you get is the default value that I set up in the solver. U is what it's important, that is the variable I am solving for. For U I should get values close to zero (positive and negative) because U in the solver represents the fluctuations. Thanks, Mary |
|
July 3, 2022, 06:22 |
|
#13 | |
Member
Uttam
Join Date: May 2020
Location: Southampton, United Kingdom
Posts: 35
Rep Power: 6 |
Quote:
Please can you tell me how you solved the problem?
__________________
Best Regards Uttam ----------------------------------------------------------------- “When everything seem to be going against you, remember that the airplane takes off against the wind, not with it.” – Henry Ford. |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
solving the momentum equation in UEqn. | callahance | OpenFOAM | 2 | October 18, 2012 10:38 |
Implicit treatment of advection terms and pressure correction | nikosb | Main CFD Forum | 0 | January 17, 2010 17:07 |
Viscosity and the Energy Equation | Rich | Main CFD Forum | 0 | December 16, 2009 15:01 |
Derivation of Momentum Equation in Integral Form | Demonwolf | Main CFD Forum | 2 | October 29, 2009 20:53 |
Momentum equation used by mixture model | George | FLUENT | 0 | May 19, 2005 14:07 |