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

Add vector field in momentum conservation equation

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By jherb
  • 1 Post By jherb

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   August 3, 2022, 08:33
Default Add vector field in momentum conservation equation
  #1
New Member
 
Nikos
Join Date: Aug 2012
Location: Greece
Posts: 13
Rep Power: 13
nikoscham is on a distinguished road
Hi community!

I would like to add a vector field (with constant value) in the momentum conservation equation.

I have the following equation form in the solver:

Code:
   fvVectorMatrix UEqn
    (
        fvm::ddt(U) + fvm::div(phi, U)
      + fvm::Sp(C*pow(1-lf, 2)/(rhoRef*(pow(lf, 3)+q)), U)
      + MRF.DDt(U)
      + turbulence->divDevReff(U)
     ==
        fvOptions(U)
     );
which is part of the meltingFoam solver (see here melting problem: looking for appropriate solvers). This solver is described in the paper https://www.researchgate.net/publica...th_experiments

I would like to subtract a constant vector field (Up) from the velocity vector U.

I changed the code as follows:

Code:
   fvVectorMatrix UEqn
    (
        fvm::ddt(U) + fvm::div(phi, U)
      + fvm::Sp(C*pow(1-lf, 2)/(rhoRef*(pow(lf, 3)+q)), U - Up) //modified
      + MRF.DDt(U)
      + turbulence->divDevReff(U)
     ==
        fvOptions(U)
     );
Moreover I added the following in the createFields.H


Code:
Info<< "Reading field Up\n" << endl;
volVectorField Up
(
    IOobject
    (
        "Up",
        runTime.timeName(),
        mesh,
        IOobject::MUST_READ,
        IOobject::NO_WRITE
    ),
    mesh
 );
By compiling the solver, however I get errors. Part of the error log is the following:

Code:
/opt/OpenFOAM/OpenFOAM-v2012/src/finiteVolume/lnInclude/fvmSup.C:142:1: note:   template argument deduction/substitution failed:
In file included from meltingPullFoam.C:97:0:
UEqn.H:12:63: note:   ‘Foam::tmp<Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> >’ is not derived from ‘const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>’
       + fvm::Sp(C*pow(1-lf, 2)/(rhoRef*(pow(lf, 3)+q)), U - Up) //added
                                                               ^
In file included from /opt/OpenFOAM/OpenFOAM-v2012/src/finiteVolume/lnInclude/fvmSup.H:165:0,
                 from /opt/OpenFOAM/OpenFOAM-v2012/src/finiteVolume/lnInclude/fvm.H:49,
                 from /opt/OpenFOAM/OpenFOAM-v2012/src/finiteVolume/lnInclude/fvCFD.H:10,
                 from meltingPullFoam.C:48:
/opt/OpenFOAM/OpenFOAM-v2012/src/finiteVolume/lnInclude/fvmSup.C:156:1: note: candidate: template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foam::fvm::Sp(const dimensionedScalar&, const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&)
  Foam::fvm::Sp
It seems that the operation (U-Up) is not accepted. . .

Do you have any proposals or tips?

Thank you in advance!


Nikos
nikoscham is offline   Reply With Quote

 


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
How to add a body force to a momentum equation anon_q OpenFOAM Programming & Development 25 May 11, 2021 15:39
add a pressure drop term in the momentum equation a.lone FLUENT 0 July 3, 2019 06:48
Domain Reference Pressure and mass flow inlet boundary AdidaKK CFX 75 August 20, 2018 05:37
Question on the discretization of momentum equation in icoFoam MPJ OpenFOAM 3 October 4, 2011 09:44
Constant velocity of the material Sas CFX 15 July 13, 2010 08:56


All times are GMT -4. The time now is 13:41.