CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   multiPhaseEulerFoam - velocity decay in channel / impossible to add a momentum source (https://www.cfd-online.com/Forums/openfoam-solving/218177-multiphaseeulerfoam-velocity-decay-channel-impossible-add-momentum-source.html)

lucb-cfd June 11, 2019 09:11

multiPhaseEulerFoam - velocity decay in channel / impossible to add a momentum source
 
1 Attachment(s)
Hi everyone,

I am trying to model an air/water flow in a channel (the initial field is set with setFields with a chosen water level and cyclic conditions in the flow direction are set with a fixed velocity for each phase), see the joined picture.

I realised that the flow velocity would decrease with time and the only solution I found is to add a momentum source with fvOptions, using a mean velocity field, which I did such as (for the air phase):

momentumSource
{
type meanVelocityForce;
active yes;

patchMeanVelocityForceCoeffs
{
selectionMode all;

fields (U.air);
Ubar (3.66 0 0);
relaxation 1.0;
}
}


The problem is that I get a warning after the second time step "Source momentumSource defined for field U.air but never used".
Then I realised that the source term wasn't present in /opt/openfoam6/applications/solvers/multiphase/multiphaseEulerFoam/UEqn.H so I added it like it is implemented in any other solvers:


UEqns.set
(
phasei,
new fvVectorMatrix
(
fvm::ddt(alpha, U)
(...)
==
(...)
+ fvOptions(U)
)
);


However I get an error when compiling "error: 'fvOptions' was not declared in this scope".

I tried to include fvOptions (#include "fvOptions.H") at the beginning of UEqn.H with not results.

Any help will be much appreciated to solve this last error, or any suggestions to avoid this velocity decay along the channel.

Cheers,
Luc

PS : I am aware that a former post concerning velocity decay already exists but it does not solve my issue as my periodic conditions should maintain the velocity field constant. (https://www.cfd-online.com/Forums/op...ays-place.html)


All times are GMT -4. The time now is 16:58.