|
[Sponsors] |
Add vector field in momentum conservation equation |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
August 3, 2022, 08:33 |
Add vector field in momentum conservation equation
|
#1 |
New Member
Nikos
Join Date: Aug 2012
Location: Greece
Posts: 13
Rep Power: 13 |
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) ); 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) ); Code:
Info<< "Reading field Up\n" << endl; volVectorField Up ( IOobject ( "Up", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::NO_WRITE ), mesh ); 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 Do you have any proposals or tips? Thank you in advance! Nikos |
|
|
|
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 |