|
[Sponsors] |
adding dispersion force term in UEqn leads to oscillations of velocity field |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
May 28, 2013, 10:46 |
adding dispersion force term in UEqn leads to oscillations of velocity field
|
#1 |
New Member
Fabian Gabel
Join Date: Feb 2013
Location: Darmstadt, Germany
Posts: 5
Rep Power: 13 |
Hello Foamers,
I'm trying to implement an additional force in my solver, to represent dispersion forces between a wall and the fluid particles near the wall. The modelling approach for the magnitude of this force is as follows: f = -3A / (delta^4) where delta is the normal distance to the wall. For my implementation I use a steady state SIMPLE procedure Code:
#include "FAdh.H" fvVectorMatrix UEqn ( fvm::div(phi, U) - fvm::laplacian(nu, U) == //fAdh*vector(0,1,0) fvc::reconstruct ( fvc::interpolate(fAdh) * (vector(0.0,1.0,0.0) & mesh.Sf()) ) ); UEqn.relax(); if (momentumPredictor) { scalar eqnResidual = solve(UEqn == -fvc::grad(p)).initialResidual(); maxResidual = max(maxResidual, eqnResidual); } Maybe someone of you has a clue about what part of my implementation is causing this physically incorrect velocity field? Kind regards, Fabian |
|
June 6, 2013, 10:29 |
Solution
|
#2 |
New Member
Fabian Gabel
Join Date: Feb 2013
Location: Darmstadt, Germany
Posts: 5
Rep Power: 13 |
It seems, that I forgot about calculating an additional flux. Now my implementation is based on the modelling of the gravity term in this wiki-entry. In case someone is interested in the final implementation (comments are welcome !):
Code:
#include "FAdh.H" fvVectorMatrix UEqn ( fvm::div(phi, U) - fvm::laplacian(nu, U) ); UEqn.relax(); if (momentumPredictor) { scalar eqnResidual = solve(UEqn == fvc::reconstruct ( fvc::interpolate(fAdh) * (vector(0.0,1.0,0.0) & mesh.Sf()) - fvc::snGrad(p)*mesh.magSf() ) ).initialResidual(); maxResidual = max(maxResidual, eqnResidual); } p.boundaryField().updateCoeffs(); volScalarField rUA("rUA", 1.0/UEqn.A()); surfaceScalarField rUAf("(1|A(U))", fvc::interpolate(rUA)); U = rUA*UEqn.H(); surfaceScalarField phiU ( (fvc::interpolate(U) & mesh.Sf()) +fvc::ddtPhiCorr(rUA, U, phi) ); phi = phiU + rUAf*fvc::interpolate(fAdh)*(vector(0.0,1.0,0.0) & mesh.Sf()); // Non-orthogonal pressure corrector loop for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { fvScalarMatrix pEqn ( fvm::laplacian(rUAf, p) == fvc::div(phi) ); pEqn.setReference(pRefCell, pRefValue); if (nonOrth == 0) { scalar eqnResidual = pEqn.solve().initialResidual(); maxResidual = max(maxResidual, eqnResidual); } else { pEqn.solve(); } if (nonOrth == nNonOrthCorr) { phi -= pEqn.flux(); } } U += rUA*fvc::reconstruct((phi - phiU)/rUAf); U.correctBoundaryConditions(); #include "continuityErrs.H" |
|
June 6, 2014, 07:59 |
|
#3 |
Senior Member
M. Montero
Join Date: Mar 2009
Location: Madrid
Posts: 155
Rep Power: 17 |
In case the force is a vectorField, How could that be implemented?
I am trying to include, OF2.3.0, a vector force calculated over cell centers. http://www.cfd-online.com/Forums/ope...tml#post495673 |
|
Tags |
dispersion force ueqn |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to add a source term (body force) to icoFoam? | chris Liu | OpenFOAM Programming & Development | 4 | October 27, 2014 16:38 |
Force can not converge | colopolo | CFX | 13 | October 4, 2011 23:03 |
SIMPLE force term isnbt converging what have I missed | brooksmoses | OpenFOAM Running, Solving & CFD | 2 | July 17, 2006 21:25 |
Problems with SUPG body force term | FEM question | Main CFD Forum | 0 | January 21, 2006 18:51 |
Terrible Mistake In Fluid Dynamics History | Abhi | Main CFD Forum | 12 | July 8, 2002 10:11 |