
[Sponsors] 
September 7, 2011, 09:27 

#21 
Senior Member

Thank you Alberto, I also found it and now trying to understand this expression.
Please see attached file Volumefield_reconstruction.pdf. I am looking for the original reference where this formulation is established. Could you please give some tips?
__________________
Best regards, Dr. Alexander VAKHRUSHEV Christian Doppler Laboratory for "Metallurgical Applications of Magnetohydrodynamics" Simulation and Modelling of Metallurgical Processes Department of Metallurgy University of Leoben http://smmp.unileoben.ac.at 

September 7, 2011, 22:16 

#22 
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 34 
I do not have a reference for this, but I think you got it.
__________________
Alberto Passalacqua GeekoCFD  A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541) OpenQBMM  An opensource implementation of quadraturebased moment methods. To obtain more accurate answers, please specify the version of OpenFOAM you are using. 

September 8, 2011, 04:37 

#23 
Senior Member
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 28 
Alexander, I think it would be nice to have this on the wiki. If you agree, do you have the time to copy it to an article there?


September 8, 2011, 04:39 

#24 
Senior Member

Hi Anton!
Ok, I will put it there. And if Alberto doesn't mind, it would look better with his description of the body forces and the pressure gradient treatment technique.
__________________
Best regards, Dr. Alexander VAKHRUSHEV Christian Doppler Laboratory for "Metallurgical Applications of Magnetohydrodynamics" Simulation and Modelling of Metallurgical Processes Department of Metallurgy University of Leoben http://smmp.unileoben.ac.at Last edited by makaveli_lcf; September 8, 2011 at 04:43. Reason: Additions 

September 13, 2011, 02:20 

#25  
Senior Member
Santiago Marquez Damian
Join Date: Aug 2009
Location: Santa Fe, Santa Fe, Argentina
Posts: 452
Rep Power: 22 
Alexander,
Quote:
Regards.
__________________
Santiago MÁRQUEZ DAMIÁN, Ph.D. Research Scientist Research Center for Computational Methods (CIMEC)  CONICET/UNL Tel: 543424511594 Int. 7032 Colectora Ruta Nac. 168 / Paraje El Pozo (3000) Santa Fe  Argentina. http://www.cimec.org.ar 

July 26, 2012, 05:28 
Could you be so kind to write down the corresponding code for the equation for p?

#26  
New Member
Join Date: Nov 2010
Posts: 2
Rep Power: 0 
Dear Alberto,
thank you very much for this very detailed explanation about the issue how to add correctly a body force to the (incompressible) momentum equation! I would be grateful if you would still specify the corresponding code for the p equation. Best regards, Vladimir Quote:


July 29, 2012, 16:20 

#27  
Member
Norbert Weber
Join Date: May 2012
Location: Dresden, Germany
Posts: 34
Rep Power: 12 
Hallo Vladimir,
I don't understand everything yet, but based on interFoam it should be sth like that: Quote:
Quote:
Working on pisoFoam, I think rho has to be removed. I do not know if phi has to contain only the velocity flux, or the 'force flux', too. Any idea? For my understanding: Can someone give me a hint, what 'reconstruct' does? It 'adds' terms to the equation and changes A and H? But there must be a difference between Quote:
Quote:


July 30, 2012, 02:33 
plz help me

#28 
Member
vahid
Join Date: Feb 2012
Location: MashhadIran
Posts: 80
Rep Power: 11 
Hi Dear alberto again:
I want to add surface tension(sigma) in one solver,for this reason I added : please help me,and tell me ,How to correct this problem???#include ''fvCFD.H'' fvc::interpolate(interface.sigma()) in this code: Foam::tmp<Foam::volScalarField> Foam:haseChangeTwoPhaseMixtures::SchnerrSauer: Coeff ( const volScalarField& p ) const { volScalarField limitedAlpha1(min(max(alpha1_, scalar(0)), scalar(1))); volScalarField rho ( limitedAlpha1*rho1() + (scalar(1)  limitedAlpha1)*rho2() ); return //......I want to change it( <<sigma>> surface tension multiple in it): (3*rho1()*rho2())*sqrt(2/(3*rho1()))*(fvc::interpolate(interface.sigma())) *rRb(limitedAlpha1)/(rho*sqrt(mag(p  pSat()) + 0.01*pSat())); //.................................................. ...... } dont successful wmake, and seen(was not declared ): phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.C:113: error: 'interface' was not declared in this scope make: *** [Make/linux64GccDPOpt/SchnerrSauer.o] Error 1 

June 4, 2014, 11:51 

#29 
Senior Member
M. Montero
Join Date: Mar 2009
Location: Madrid
Posts: 137
Rep Power: 15 
HI all,
How could it be done in case it is not a body force but a vectorField? All is in relation to the rotorDiskSource and how introducing this source in the momentum equation can create wiggles in the pressure field and velocity field. Thank you Last edited by be_inspired; June 6, 2014 at 08:14. 

February 23, 2015, 10:16 

#30  
New Member
Peter
Join Date: May 2012
Location: New York
Posts: 18
Rep Power: 12 
Quote:
Hello Harry, Did you finally solve your problem? I have met a similar problem regarding the bodyforceweighted scheme for pressure interpolation. Do you have any ideas on this? Thanks a lot for your help and time! Best, Peter 

May 12, 2017, 10:26 

#31 
New Member
Roman G.
Join Date: Apr 2017
Posts: 16
Rep Power: 7 
Hi,
I know this treat is old but I'm struggling with the implementation of the force term by the use of the RhiChow interpolation. I'm using pimpleFoam. So far I added in the momentum predictor my force term like this: Code:
surfaceScalarField B_fs = fvc::interpolate(lorentz/rho) & mesh.Sf() if (pimple.momentumPredictor()) { solve ( UEqn == fvc::reconstruct (  fvc::snGrad(p)* mesh.magSf() + B_fs ) ); fvOptions.correct(U); } I added a flux term in the phiHbyA equation: Code:
surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU)); surfaceScalarField phil(rAUf*B_fs); surfaceScalarField phiHbyA ( "phiHbyA", fvc::flux(HbyA) + fvc::interpolate(rAU)*fvc::ddtCorr(U, phi) + phil ); Code:
U = HbyA + rAU*fvc::reconstruct((phil  pEqn.flux())/rAUf); Code:
Continuity error cannot be removed by adjusting the outflow. Please check the velocity boundary conditions and/or run potentialFoam to initialise the outflow. Total flux : 8.226416123979263e05 Specified mass inflow : 0.0005613679754126387 Specified mass outflow : 6.154738583391114e17 Adjustable mass outflow : 0 Thanks in advance 

May 18, 2017, 06:15 

#32 
New Member
Roman G.
Join Date: Apr 2017
Posts: 16
Rep Power: 7 
The problem is solved. I had to add the flux from the force after adjusting phi.
Code:
surfaceScalarField phil(rAUf*B_fs); surfaceScalarField phiHbyA ( "phiHbyA", fvc::flux(HbyA) + fvc::interpolate(rAU)*fvc::ddtCorr(U, phi) ); MRF.makeRelative(phiHbyA); adjustPhi(phiHbyA, U, p); phiHbyA += phil; 

September 19, 2017, 05:42 

#33  
Senior Member
Przemek
Join Date: Jun 2011
Posts: 245
Rep Power: 14 
Quote:
Have you also modified the line Code:
// Calculate the conservative fluxes phi = phiHbyA  p_rghEqn.flux();
__________________
best regards pblasiak 

September 21, 2017, 05:29 
high residuals for p_rgh

#34  
Senior Member
Przemek
Join Date: Jun 2011
Posts: 245
Rep Power: 14 
Quote:
I am trying to add body force to momentum equation like this where M is a body force. I based on buoyantBoussinesqPimpleFoam solver. I followed according to the instructions you provided and others on the forum and I changed the UEqn.H and pEqn.H as follows UEqn.H Code:
tmp<fvVectorMatrix> tUEqn ( fvm::ddt(U) + fvm::div(phi, U) + MRF.DDt(U) + turbulence>divDevReff(U) == fvOptions(U) ); fvVectorMatrix& UEqn = tUEqn.ref(); UEqn.relax(); fvOptions.constrain(UEqn); if (pimple.momentumPredictor()) { solve ( UEqn == fvc::reconstruct ( (  ghf*fvc::snGrad(rhok)  fvc::snGrad(p_rgh) )*mesh.magSf()  (fvc::interpolate(M) & mesh.Sf()) ) ); fvOptions.correct(U); } Code:
{ volScalarField rAU("rAU", 1.0/UEqn.A()); surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU)); volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p_rgh)); surfaceScalarField phig(rAUf*ghf*fvc::snGrad(rhok)*mesh.magSf()); surfaceScalarField phiM(rAUf*(fvc::interpolate(M) & mesh.Sf())); surfaceScalarField phiHbyA ( "phiHbyA", fvc::flux(HbyA) + rAUf*fvc::ddtCorr(U, phi) + phig + phiM ); MRF.makeRelative(phiHbyA); // Update the pressure BCs to ensure flux consistency constrainPressure(p_rgh, U, phiHbyA, rAUf, MRF); while (pimple.correctNonOrthogonal()) { fvScalarMatrix p_rghEqn ( fvm::laplacian(rAUf, p_rgh) == fvc::div(phiHbyA) ); p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell)); p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter()))); if (pimple.finalNonOrthogonalIter()) { // Calculate the conservative fluxes phi = phiHbyA  p_rghEqn.flux(); // Explicitly relax pressure for momentum corrector p_rgh.relax(); // Correct the momentum source with the pressure gradient flux // calculated from the relaxed pressure U = HbyA + rAU*fvc::reconstruct((phiM + phig  p_rghEqn.flux())/rAUf); //5 (+) U.correctBoundaryConditions(); fvOptions.correct(U); } } #include "continuityErrs.H" p = p_rgh + rhok*gh; if (p_rgh.needReference()) { p += dimensionedScalar ( "p", p.dimensions(), pRefValue  getRefCellValue(p, pRefCell) ); p_rgh = p  rhok*gh; } }
__________________
best regards pblasiak 

November 3, 2017, 05:34 

#35  
New Member
Roman G.
Join Date: Apr 2017
Posts: 16
Rep Power: 7 
Hi gaza,
I had problems when adding a source term without adjusting the flux to ensure mass conservation. Try to add the source terms after adjusting phi to your flux phiHybA. Quote:


November 10, 2017, 07:35 

#36 
Senior Member
Przemek
Join Date: Jun 2011
Posts: 245
Rep Power: 14 
Hi Novel,
Thank you for your tip however in my case I do not see the difference after adjustPhi.
__________________
best regards pblasiak 

Tags 
body force, force 
Thread Tools  Search this Thread 
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Help on 2D interpolation in StarCCM+  madhuri  Siemens  1  May 30, 2017 04:20 
urgent help needed (rhiechow interpolation problem)  Ardalan  Main CFD Forum  2  March 18, 2011 16:22 
Surface interpolation schemes and parallelization  jutta  OpenFOAM Running, Solving & CFD  0  February 25, 2010 15:32 
momentum interpolation for collocated grid  Hadian  Main CFD Forum  4  December 25, 2009 08:25 
spline interpolation  bajjal  Main CFD Forum  0  May 29, 2006 09:27 