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

Need help in adding terms to momentum equation of interFoam

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 25, 2017, 01:00
Default Need help in adding terms to momentum equation of interFoam
  #1
Member
 
behzad Ghasemi
Join Date: Sep 2013
Location: Iran
Posts: 56
Rep Power: 13
behzad-cfd is on a distinguished road
Hi dear foamers,

I want to add new terms in momentum equation. I need some help to do. I'm trying to add magneto static equations in interFoam solver. To do this:
1- magnetic scalar potential should be solved, to get B (magnetic induction) and H (magnetic field). this part is done and i get reasonable results.
2- main part is to add a term (divergence of magnetic stress tensor ) to momentum equation that takes care of deformations caused by magnetic field. Actually I don't have any idea how should i write this terms in momentum equation(see page 5 eqn (2.12) & Apendix).

Any guidance is appreciated.

This is the link of my reference paper http://individual.utoronto.ca/afkham...Ferro_Drop.pdf

All of details are depicted in paper.

Thanks in advance,
Behzad
behzad-cfd is offline   Reply With Quote

Old   January 4, 2018, 08:13
Default
  #2
Member
 
behzad Ghasemi
Join Date: Sep 2013
Location: Iran
Posts: 56
Rep Power: 13
behzad-cfd is on a distinguished road
Let me make my question more specific. want to add this terms in u and p equations.
\nabla\cdot(\mu HH^{T}-\frac{1}{2}\mu_{0}\left|H\right|^{2}I)

Now because 1/2*mu*H^2 term is proportional to identity tensor so it will be absorbed to P field \nabla\cdot(-\frac{1}{2}\mu_{0}\left|H\right|^{2}I) =-\frac{1}{2}\mu_{0} \nabla \left|H\right|^{2} (is that right?). i wrote this terms in uEqn like this:
Code:
    surfaceScalarField muEff
    (
        "muEff",
        twoPhaseProperties.muf()
      + fvc::interpolate(rho*turbulence->nut())
    );

    fvVectorMatrix UEqn
    (
        fvm::ddt(rho, U)
      + fvm::div(rhoPhi, U)
      - fvc::div(interfacePsi.muM()*sqr(Hm))
      - fvm::laplacian(muEff, U)
      - (fvc::grad(U) & fvc::grad(muEff))
    );

    UEqn.relax();

    if (pimple.momentumPredictor())
    {
        solve
        (
            UEqn
         ==
            fvc::reconstruct
            (
                (
                    fvc::snGrad(psi)*fvc::interpolate(interfacePsi.sigmaC())*
                    fvc::interpolate(interfacePsi.delta())
                  - double(0.5)*interfacePsi.mu0()*dimMu*fvc::snGrad(magSqr(Hm))
                  - ghf*fvc::snGrad(rho)
                  - fvc::snGrad(p_rgh)
                ) * mesh.magSf()
            )
        );
    }
Edited part of pEqn:
Code:
 phi = phiU +
    (
                fvc::snGrad(psi)*fvc::interpolate(interfacePsi.sigmaC())*fvc::interpolate(interfacePsi.delta()) 
              - double(0.5)*interfacePsi.mu0()*dimMu*fvc::snGrad(magSqr(Hm)) 
              - ghf*fvc::snGrad(rho)
    )*rAUf*mesh.magSf();
I get good results for small deformations but bad results for high deformation in comparison with reference paper results. Now is this implementation right?
whats the deference of writing terms in left or right hand side of Ueqn?
my OF version and base solver is 2.1.1, interFoam.

Any comment is appreciated

Last edited by behzad-cfd; January 5, 2018 at 14:55.
behzad-cfd is offline   Reply With Quote

Old   April 18, 2020, 15:52
Default Terms in momentum equation
  #3
Member
 
Thomas Flint
Join Date: Jan 2016
Posts: 60
Rep Power: 10
tom_flint2012 is on a distinguished road
Hi,

I know this thread is old, but I have just come across it.

I don’t think you need to add any terms to the reconstruct expression. The term that is multiplied by the identity tensor can just go as grad(A) instead of div (A I) where A is your expression in the momentum equation.
How are you getting on with this?

I’m working on a similar problem with an induction formulation.
tom_flint2012 is online now   Reply With Quote

Reply


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
Adding of source term in momentum equation required any changes in PISO algorith shadabdyn OpenFOAM Programming & Development 2 January 15, 2017 02:16
interFoam: trying to understand the equation terms Saideep OpenFOAM Programming & Development 10 June 4, 2015 04:51
Different momentum equation in different versions of settlingFoam Shenan OpenFOAM Running, Solving & CFD 0 April 15, 2015 14:09
Explicit evaluation of all the terms of momentum equation Andrea_85 OpenFOAM 0 November 25, 2014 10:39
How to add bodyforce in momentum equation in viscoelasticFluidFoam? arshoon OpenFOAM Running, Solving & CFD 0 April 9, 2013 11:03


All times are GMT -4. The time now is 17:55.