|
[Sponsors] |
May 6, 2021, 21:11 |
add a force in momentum equation
|
#1 |
New Member
simona
Join Date: Apr 2021
Posts: 21
Rep Power: 5 |
Hi everybody,
I am new to openfoam, I am studying a laminar flow of water in a cylindrical tube with velocity 1m / s using simpleFoam and I need to add a source term in the momentum equation which is a force in the same direction of flow which should increase the velocity of the fluid flow a little bit, I tried with this method but the velocity remains at the same value and the flow becomes non-laminar, please who can help me to solve this problem dimensionedVector F("F", dimensionSet(0,1,-2,0,0,0,0), vector(0,0,30)); tmp<fvVectorMatrix> tUEqn ( fvm::div(phi, U) + MRF.DDt(U) + turbulence->divDevReff(U) - fvm::laplacian(mu, U) == fvOptions(U) + F ); fvVectorMatrix& UEqn = tUEqn.ref(); |
|
May 7, 2021, 07:42 |
|
#2 |
New Member
simona
Join Date: Apr 2021
Posts: 21
Rep Power: 5 |
any reply will be appreciated, I really want help
|
|
May 7, 2021, 07:54 |
|
#3 |
Senior Member
Hojatollah Gholami
Join Date: Jan 2019
Posts: 171
Rep Power: 7 |
Hello
may you can use temple of bodyForce() in fsi of foam-extend4.0 (unsTotalLagrangianSolid.C). bodyForce() = dimensionedVector(solidProperties().lookup("g")); fvVectorMatrix DEqn ( rho_*fvm::d2dt2(D_) == fvm::laplacian(2*muf_ + lambdaf_, D_, "laplacian(DD,D)") + fvc::div ( mesh().Sf() & ( - (muf_ + lambdaf_)*gradDf_ + muf_*gradDf_.T() + lambdaf_*(I*tr(gradDf_)) ) ) + rho_*bodyForce() ); |
|
May 7, 2021, 12:48 |
|
#4 |
New Member
simona
Join Date: Apr 2021
Posts: 21
Rep Power: 5 |
thank you gholami for your reply
|
|
May 15, 2021, 15:31 |
a bit of help
|
#5 |
New Member
Paulin FERRO
Join Date: May 2021
Location: France
Posts: 21
Rep Power: 5 |
Hello,
For instance you can : 1 : declare a volVectorField mySource. 2 : loop over the cells and fill mySource. Here you can loop on a specific zone of your mesh. 3 : add in the left member of Ueqn the source mySource. Good luck ! |
|
May 17, 2021, 05:09 |
solution
|
#6 | |||||
New Member
Paulin FERRO
Join Date: May 2021
Location: France
Posts: 21
Rep Power: 5 |
Hello,
Please find below some details of a possible implementation. Note that I didn't have tested the code since I am directly writing it here. Also note that there are other ways for doing it. I assume that we use an incompressible solver such as simpleFoam or pimpleFoam. In this case each member of the momentum equation is divided by rho. As rho is uniform the solver use the kinematic viscosity and a modified pressure : [p/rho] = m^2 / s^2. The source term in the momentum equation has the dimension of an acceleration i.e = m/s^2. First step : creating the momentum source In createField.H of the solver we declare a volVectorField and we call it force. Quote:
Quote:
Second step : filing the momentum source The force volVectorField is initialized in createField.H and is equal to 0 on the whole mesh. Now we need to fill it according to what we want to do. Thus we need to create a loop over cells. For example we can do that in the UEqn.H file. This means that the source will be updated for each SIMPLE loop. Quote:
Very simple : Quote:
Quote:
Paulin |
||||||
June 20, 2022, 09:14 |
|
#7 | |
Member
Mahmoud
Join Date: Nov 2020
Location: United Kingdom
Posts: 43
Rep Power: 6 |
Quote:
Hi Paulin, I am wondering why you have not used fvOptions to introduce the body force into your equations? |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
ActuatorDiskExplicitForce in OF2.1. Help | be_inspired | OpenFOAM Programming & Development | 10 | September 14, 2018 12:12 |
Can not add force to Equn in interFoam,Help | zhibin.wang | OpenFOAM Running, Solving & CFD | 0 | August 22, 2016 08:10 |
how to add source-term in momentum equation for interFoam? | anon_g | OpenFOAM | 9 | October 18, 2011 13:47 |
how to add a force in the momentum equation | guillaumem | OpenFOAM | 0 | June 14, 2010 04:49 |
Viscosity and the Energy Equation | Rich | Main CFD Forum | 0 | December 16, 2009 15:01 |