CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM

Adding a new term in momentum equation of Interfoam

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By udiitm
  • 1 Post By vahid.najafi

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 29, 2012, 07:02
Default Adding a new term in momentum equation of Interfoam
  #1
New Member
 
yudhast
Join Date: Mar 2011
Posts: 12
Rep Power: 15
udiitm is on a distinguished road
Dear All,
I need a help in implementing a modified surface tension component ( F
st,i ) in interfoam.
This surface tension force is implemented in Interfoam as

fvc::interpolate(interface.sigmaK())*fvc::snGrad(a lpha1)

which is basically
Fst,i = -sigmaK*grad (alpha1)

This part I need to change it to


F
st,i = -(Pb - Pa) * grad (alpha1)


where
(Pb - Pa) = 0.5* ( P1 + P2 )

P1 =0.5* ((1-2*alpha1)* P)w + ((1-2*alpha1)* P)E
P2 =0.5* ((1-2*alpha1)* P)N +
((1-2*alpha1)* P)S

Here W,E,N and S represents left, right, top and bottom cell information for a cell "i"

Thanks in advance

YUdhast
Zhiheng Wang likes this.
udiitm is offline   Reply With Quote

Old   July 29, 2012, 03:35
Default plese help me
  #2
Member
 
vahid
Join Date: Feb 2012
Location: Mashhad-Iran
Posts: 80
Rep Power: 13
vahid.najafi is an unknown quantity at this point
Hi Dear yudhast.
I'm working with openFoam 2.0.1,and have a problem with solver (interPhaseChangeFoam) in multiphase solvers.

I want to add (surface tension or sigma ) in a part of this solver, in directory:
/run/myinterPhaseChangeFoam/phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.c
I added 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
return
//......I want to change it( <<sigma>> surface tension multiple in it):
(3*rho1()*rho2())*sqrt(2/(3*rho1()))*sigma()
*rRb(limitedAlpha1)/(rho*sqrt(mag(p - pSat()) + 0.01*pSat()));
//.................................................. ......
}

dont successful wmake, and seen(sigma() was not declared ):

phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.C:113: error: sigma() was not declared in this scope
make: *** [Make/linux64GccDPOpt/SchnerrSauer.o] Error 1

please help me.
Zhiheng Wang likes this.
vahid.najafi is offline   Reply With Quote

Old   July 29, 2012, 04:21
Default again.
  #3
Member
 
vahid
Join Date: Feb 2012
Location: Mashhad-Iran
Posts: 80
Rep Power: 13
vahid.najafi is an unknown quantity at this point
Hi again.

I added 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()))*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
phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.C:113: error: 'interpolate' was not declared in this scope
make: *** [Make/linux64GccDPOpt/SchnerrSauer.o] Error 1

please help me.
vahid.najafi is offline   Reply With Quote

Old   July 29, 2012, 04:30
Default again.
  #4
Member
 
vahid
Join Date: Feb 2012
Location: Mashhad-Iran
Posts: 80
Rep Power: 13
vahid.najafi is an unknown quantity at this point
please help me????
vahid.najafi is offline   Reply With Quote

Old   July 29, 2012, 09:37
Default
  #5
Senior Member
 
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,267
Blog Entries: 1
Rep Power: 25
nimasam is on a distinguished road
dear vahid
i recommend you to read a C++ book, chapter "class"
interface is object!
interpolation is a function or member of a class
when you call an object, you should first define it some where
first, you should add the appropriate header file, for example:
#include "fvCFD.H"
then you can use public member of this class
fvc::interpolate(....)
nimasam is offline   Reply With Quote

Old   July 29, 2012, 11:52
Default Thanks
  #6
Member
 
vahid
Join Date: Feb 2012
Location: Mashhad-Iran
Posts: 80
Rep Power: 13
vahid.najafi is an unknown quantity at this point
Thanks nima for your answer
vahid.najafi is offline   Reply With Quote

Reply

Tags
adding term, interfoam, surface tension


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Momentum equation of interFoam? cfdfans OpenFOAM 10 May 9, 2018 03:43
Constant velocity of the material Sas CFX 15 July 13, 2010 09:56
Adding a source term to concervation of species equation bernarde STAR-CCM+ 0 June 4, 2009 04:17
Momentum equation used by mixture model George FLUENT 0 May 19, 2005 14:07
bouyancy term in epsilon equation Michael Main CFD Forum 1 June 25, 1999 11:20


All times are GMT -4. The time now is 18:31.