|
[Sponsors] |
January 15, 2022, 04:07 |
Adding implicit source term in UEq
|
#1 |
New Member
Ahmed Hafez
Join Date: Jul 2018
Posts: 26
Rep Power: 7 |
Hello All,
I want to add a source term in form of +(fvc::grad(U) & U) to momentum equation (UEq) First, I implemented it explicitly however the residuals raise significantly. Is there any way or trick to do it implicitly as I know that fvm::SuSp & fvm::Sp accept only volScalarField. Thank you. |
|
January 16, 2022, 15:45 |
|
#2 |
New Member
Ahmed Hafez
Join Date: Jul 2018
Posts: 26
Rep Power: 7 |
Any help ?
|
|
January 17, 2022, 07:55 |
|
#3 | |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51 |
Quote:
SuSp will only put the the cells implicit with a negative sign. All others are treated explicitly. Hence, you are not 100 % sure if you treat anything implicit. The gradient of U can - in my opinion - not be treated implicitly. What type of source term is it? Looks a bit similar to the deformation tensor but you have grad(U) product with U. So no idea what it represents out of the box.
__________________
Keep foaming, Tobias Holzmann |
||
January 20, 2022, 01:22 |
|
#4 | |
New Member
Ahmed Hafez
Join Date: Jul 2018
Posts: 26
Rep Power: 7 |
Quote:
My question in different form, can we add different implicit source terms for momentum equation according to direction i.e. Sx for x-momentum And Sy for y-momentum |
||
January 20, 2022, 08:27 |
|
#5 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51 |
Not sure if I got your question right.
So you can, of course, add different contributions to Ux, Uy, Uz, based on the vector you apply. However, you cannot always guarantee that this is treated implicitly or explicitly. So you could use SuSp() for that. The source is a vector you want to provide. The SuSp() function will take care if the single part can be added explicitly or implicitly. If I got you more precisely, you want to add single contributions rather than one vector. So I am not sure if the SuSp() will consider each component separately and decide if it is taken implicit or explicit. You also could try to add two contributions Vector1 (x,0,0) and Vector2 (0,y,0). To give the correct answer, one should check the code and how it works.
__________________
Keep foaming, Tobias Holzmann |
|
January 20, 2022, 09:05 |
|
#6 | |
New Member
Ahmed Hafez
Join Date: Jul 2018
Posts: 26
Rep Power: 7 |
Quote:
tmp<fvVectorMatrix> tUEqn ( fvm::div(phi, U) + turbulence->divDevReff(U) +fvm::SuSP(A,U&vector(1,0,0)) + fvm::SuSP(B,U&vector(0,1,0)) ); |
||
January 21, 2022, 08:47 |
|
#7 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51 |
Yes exactly, despite I would expect that A and B has to be extended with the vectors rather than the field you are solving for. However, as I told, I am not sure if this is identical to putting just one source term.
The resulting matrix does not care about the source terms. They are placed accordingly to the sign. The only difference which I am not aware right now is, if the source term of the vector is treated as single-component in SuSp or is the vector itself used. Lets check... The SuSp function is only implemented by taking a <volScalarField> as argument. Hence, the code you presented should give an error despite, the volVectorField is split first into three volScalarFields automatically. I would go into the code but I have no time for investigating into that. Tobi
__________________
Keep foaming, Tobias Holzmann |
|
January 22, 2022, 02:53 |
|
#8 | |
New Member
Ahmed Hafez
Join Date: Jul 2018
Posts: 26
Rep Power: 7 |
Quote:
|
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[OpenFOAM.org] Error creating ParaView-4.1.0 OpenFOAM 2.3.0 | tlcoons | OpenFOAM Installation | 13 | April 20, 2016 17:34 |
Problem compiling a custom Lagrangian library | brbbhatti | OpenFOAM Programming & Development | 2 | July 7, 2014 11:32 |
OpenFOAM without MPI | kokizzu | OpenFOAM Installation | 4 | May 26, 2014 09:17 |
OpenFOAM on MinGW crosscompiler hosted on Linux | allenzhao | OpenFOAM Installation | 127 | January 30, 2009 19:08 |
DecomposePar links against liblamso0 with OpenMPI | jens_klostermann | OpenFOAM Bugs | 11 | June 28, 2007 17:51 |