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

add a phase diffusion term in both continuity and monmentum equations for twoPhEuler

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 4, 2020, 13:08
Question add a phase diffusion term in both continuity and monmentum equations for twoPhEuler
  #1
Senior Member
 
kimy
Join Date: Mar 2019
Posts: 150
Rep Power: 4
qi.yang@polimi.it is on a distinguished road
Hi everone, Please help me to verify the code I wrote is reasonable or not, Thanks a lot.

I need to add a diffusion term (which is shown in the attached figure) in both Uequation and pequation for the twophaseeulerfoam. The code (bold words) I wrote is as shown in the fowllowing:

U1Eqn =
(
fvm::div(alphaRhoPhi1, U1) - fvm::Sp(fvc::div(alphaRhoPhi1), U1)
+ MRF.DDt(alpha1*rho1, U1)
+ - fvm::laplacian(alpha1*rho1*(1/(alpha1+0.001)*(rho2/rho1)*(2.5/beta*(pow(alpha2,-beta)-1)-alpha2)*phase2.turbulence().nu()+phase2.turbulence ().nut()), U1)
- fvm::div(rho1*phase2.turbulence().nut()/sigma*(fvc::grad(alpha1)), U1)
+ Vm*(UgradU1 - (UgradU2 & U2))
- fvOptions(alpha1, rho1, U1)
);
However, it cannot be compiled in a right way.
Attached Images
File Type: jpg Picture1.jpg (16.1 KB, 19 views)
qi.yang@polimi.it is offline   Reply With Quote

Old   February 5, 2020, 05:09
Default
  #2
Cyp
Senior Member
 
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 299
Rep Power: 15
Cyp is on a distinguished road
If you modify the continuity equations, you have to change the pressure equations as well because the pressure equation derives from the continuity equations.


Regarding your compiling error, it is because you do not implement the divergence correctly. The first argument as to be a surface<something>Field : fvm::div(phiSomething,U1) and in your code you have a volVectorField.


Cheers,
Cyprien
Cyp is offline   Reply With Quote

Old   February 5, 2020, 05:20
Default
  #3
Senior Member
 
kimy
Join Date: Mar 2019
Posts: 150
Rep Power: 4
qi.yang@polimi.it is on a distinguished road
Thanks a lot, Cyprien.. I also changed the mass conservation equation as shown following. But in my momentum equation, there is no phi existing. Could you please help me to see that pic I attached.
pEqnComp1 =
(
contErr1
- fvc::Sp(fvc::ddt(alpha1) + fvc::div(alphaPhi1), rho1)
)/rho1
+ (alpha1*psi1/rho1)*correction(fvm::ddt(p_rgh)) - fvc::laplacian(alpha1*phase2.turbulence().nut()/sigma);

pEqnComp2 =
(
contErr2
- fvc::Sp(fvc::ddt(alpha2) + fvc::div(alphaPhi2), rho2)
)/rho2
+ (alpha2*psi2/rho2)*correction(fvm::ddt(p_rgh)) - fvc::laplacian(alpha2*phase2.turbulence().nut()/sigma);

}
qi.yang@polimi.it is offline   Reply With Quote

Old   February 5, 2020, 05:25
Default
  #4
Cyp
Senior Member
 
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 299
Rep Power: 15
Cyp is on a distinguished road
Code:
fvc::snGrad(alpha1)
Cyp is offline   Reply With Quote

Old   February 5, 2020, 05:39
Default
  #5
Senior Member
 
kimy
Join Date: Mar 2019
Posts: 150
Rep Power: 4
qi.yang@polimi.it is on a distinguished road
Really thanks. In terms of the pressure equations, there are some parts to be changed?
qi.yang@polimi.it is offline   Reply With Quote

Old   February 5, 2020, 05:44
Default
  #6
Senior Member
 
kimy
Join Date: Mar 2019
Posts: 150
Rep Power: 4
qi.yang@polimi.it is on a distinguished road
After I changed the code like this, the error occurs:

- fvm::div(rho1*phase2.turbulence().nut()/sigma*fvc::snGrad(alpha1), U1)

In file included from mytwoPhaseEulerFoam1.C:96:0:
pUf/UEqns.H: In function 'int main(int, char**)':
pUf/UEqns.H:32:82: error: no matching function for call to 'div(Foam::tmp<Foam::Field<double> >, Foam::volVectorField&)'
- fvm::div(rho1*phase2.turbulence().nut()/sigma*fvc::snGrad(alpha1), U1)
^
In file included from J:/blueCFD-Core-2017/OpenFOAM-5.x/src/finiteVolume/finiteVolume/fvm/fvmDiv.H:94:0,
from J:/blueCFD-Core-2017/OpenFOAM-5.x/src/finiteVolume/finiteVolume/fvm/fvm.H:45,
from J:/blueCFD-Core-2017/OpenFOAM-5.x/src/finiteVolume/lnInclude/fvm.H:1,
from J:/blueCFD-Core-2017/OpenFOAM-5.x/src/finiteVolume/cfdTools/general/include/fvCFD.H:10,
from J:/blueCFD-Core-2017/OpenFOAM-5.x/src/finiteVolume/lnInclude/fvCFD.H:1,
from mytwoPhaseEulerFoam1.C:33:
J:/blueCFD-Core-2017/OpenFOAM-5.x/src/finiteVolume/finiteVolume/fvm/fvmDiv.C:45:1: note: candidate: template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foam::fvm::div(const surfaceScalarField&, const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&, const Foam::word&)
qi.yang@polimi.it is offline   Reply With Quote

Old   February 5, 2020, 05:49
Default
  #7
Cyp
Senior Member
 
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 299
Rep Power: 15
Cyp is on a distinguished road
You have to re-derive the PISO algorithm to check if you need further modifications. You might need to add some terms during the correction of the velocities but I am not sure. The only way to check that is to rederive the PISO with your modifications.


Code:
surfaceScalarField phiSomething
(
    "phiSomething", 
     rho1*fvc::interpolate(phase2.turbulence().nut())/sigma*fvc::snGrad(alpha1)
);

fvm::div(phiSomething, U1);
Cyp is offline   Reply With Quote

Old   February 5, 2020, 06:10
Default
  #8
Senior Member
 
kimy
Join Date: Mar 2019
Posts: 150
Rep Power: 4
qi.yang@polimi.it is on a distinguished road
I am confused that both U equation and P equation are based on the surface field?

pEqnComp1 =
(
contErr1
- fvc::Sp(fvc::ddt(alpha1) + fvc::div(alphaPhi1), rho1)
)/rho1
+ (alpha1*psi1/rho1)*correction(fvm::ddt(p_rgh)) - fvc::laplacian(alpha1*phase2.turbulence().nut()/sigma);
The bold words are not right? But I complied successfully.

Sorry, I saw the code in the pressure equation:
// Phase-fraction face-gradient
surfaceScalarField snGradAlpha1(fvc::snGrad(alpha1)*mesh.magSf());
should I multiply mesh.magSf()) in my code?
qi.yang@polimi.it is offline   Reply With Quote

Old   February 5, 2020, 07:26
Default
  #9
Cyp
Senior Member
 
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 299
Rep Power: 15
Cyp is on a distinguished road
The first argument of divergence has to be a surface field.

You might need it indeed. You will see at the execution if you have an error of dimensions.
Cyp is offline   Reply With Quote

Old   February 5, 2020, 07:52
Default
  #10
Senior Member
 
kimy
Join Date: Mar 2019
Posts: 150
Rep Power: 4
qi.yang@polimi.it is on a distinguished road
The following is the original code for UEquation, but divDevRhoReff(U2) is not the surface field?
U2Eqn =
(
fvm::ddt(alpha2, rho2, U2) + fvm::div(alphaRhoPhi2, U2)
- fvm::Sp(contErr2, U2)
+ MRF.DDt(alpha2*rho2 + Vm, U2)
+ phase2.turbulence().divDevRhoReff(U2)
==
- Vm
*(
fvm::ddt(U2)
+ fvm::div(phi2, U2)
- fvm::Sp(fvc::div(phi2), U2)
- DDtU1
)
+ fvOptions(alpha2, rho2, U2)
);

template<class BasicTurbulenceModel>
Foam::tmp<Foam::fvVectorMatrix>
Foam::linearViscousStress<BasicTurbulenceModel>::d ivDevRhoReff
(
const volScalarField& rho,
volVectorField& U
) const
{
return
(
- fvc::div((this->alpha_*rho*this->nuEff())*dev2(T(fvc::grad(U))))
- fvm::laplacian(this->alpha_*rho*this->nuEff(), U)

);
}

In my code, I replace the divDevRhoReff(U2) by the following code,

- fvm::laplacian(alpha2*rho2*(1/(alpha1+0.001)*(rho2/rho1)*(2.5/beta*(pow(alpha2,-beta)-1)-alpha2)*phase2.turbulence().nu()+phase2.turbulence ().nut()), U2)

is there any problem?
qi.yang@polimi.it is offline   Reply With Quote

Old   February 5, 2020, 07:58
Default
  #11
Cyp
Senior Member
 
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 299
Rep Power: 15
Cyp is on a distinguished road
no problem as far as I can see.

You should have a look at the Programmer's Guide. All these points are discussed there.
Cyp is offline   Reply With Quote

Old   February 5, 2020, 08:03
Default
  #12
Senior Member
 
kimy
Join Date: Mar 2019
Posts: 150
Rep Power: 4
qi.yang@polimi.it is on a distinguished road
Quote:
Originally Posted by Cyp View Post
You have to re-derive the PISO algorithm to check if you need further modifications. You might need to add some terms during the correction of the velocities but I am not sure. The only way to check that is to rederive the PISO with your modifications.


Code:
surfaceScalarField phiSomething
(
    "phiSomething", 
     rho1*fvc::interpolate(phase2.turbulence().nut())/sigma*fvc::snGrad(alpha1)
);

fvm::div(phiSomething, U1);
I tried this but it faild again.
qi.yang@polimi.it is offline   Reply With Quote

Old   February 5, 2020, 08:09
Default
  #13
Cyp
Senior Member
 
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 299
Rep Power: 15
Cyp is on a distinguished road
what do you mean "it failed"?
Cyp is offline   Reply With Quote

Old   February 5, 2020, 08:12
Default
  #14
Senior Member
 
kimy
Join Date: Mar 2019
Posts: 150
Rep Power: 4
qi.yang@polimi.it is on a distinguished road
Sorry. I mean "failed"

In file included from mytwoPhaseEulerFoam1.C:96:0:
pUf/UEqns.H: In function 'int main(int, char**)':
pUf/UEqns.H:18:5: error: no matching function for call to 'Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>::GeometricField(const char [13], Foam::tmp<Foam::Field<double> >)'
);
^
In file included from J:/blueCFD-Core-2017/OpenFOAM-5.x/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.T.H:660:0,
from J:/blueCFD-Core-2017/OpenFOAM-5.x/src/OpenFOAM/lnInclude/GeometricField.T.H:1,
from J:/blueCFD-Core-2017/OpenFOAM-5.x/src/OpenFOAM/fields/GeometricFields/GeometricScalarField/GeometricScalarField.T.H:38,
from J:/blueCFD-Core-2017/OpenFOAM-5.x/src/OpenFOAM/lnInclude/GeometricScalarField.T.H:1,
from J:/blueCFD-Core-2017/OpenFOAM-5.x/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricFields.T.H:34,
from J:/blueCFD-Core-2017/OpenFOAM-5.x/src/OpenFOAM/lnInclude/GeometricFields.T.H:1,
from J:/blueCFD-Core-2017/OpenFOAM-5.x/src/finiteVolume/fields/volFields/volFields.H:37,
from J:/blueCFD-Core-2017/OpenFOAM-5.x/src/finiteVolume/lnInclude/volFields.H:1,
from J:/blueCFD-Core-2017/OpenFOAM-5.x/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolationScheme/surfaceInterpolationScheme.C:27,
from J:/blueCFD-Core-2017/OpenFOAM-5.x/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolationScheme/surfaceInterpolationScheme.H:307,
from J:/blueCFD-Core-2017/OpenFOAM-5.x/src/finiteVolume/lnInclude/surfaceInterpolationScheme.H:1,
from J:/blueCFD-Core-2017/OpenFOAM-5.x/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolation/surfaceInterpolate.H:41,
from J:/blueCFD-Core-2017/OpenFOAM-5.x/src/finiteVolume/lnInclude/surfaceInterpolate.H:1,
from J:/blueCFD-Core-2017/OpenFOAM-5.x/src/finiteVolume/finiteVolume/fvc/fvc.H:39,
from J:/blueCFD-Core-2017/OpenFOAM-5.x/src/finiteVolume/lnInclude/fvc.H:1,
from J:/blueCFD-Core-2017/OpenFOAM-5.x/src/finiteVolume/cfdTools/general/include/fvCFD.H:8,
from J:/blueCFD-Core-2017/OpenFOAM-5.x/src/finiteVolume/lnInclude/fvCFD.H:1,
from mytwoPhaseEulerFoam1.C:33:
J:/blueCFD-Core-2017/OpenFOAM-5.x/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.T.C:678:1: note: candidate: Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField(const Foam::IOobject&, const Foam::tmp<Foam::GeometricField<Type, PatchField, GeoMesh> >&, const wordList&, const wordList&) [with Type = double; PatchField = Foam::fvsPatchField; GeoMesh = Foam::surfaceMesh; Foam::wordList = Foam::List<Foam::word>]
Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
^~~~
J:/blueCFD-Core-2017/OpenFOAM-5.x/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.T.C:678:1: note: candidate expects 4 arguments, 2 provided
J:/blueCFD-Core-2017/OpenFOAM-5.x/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.T.C:635:1: note: candidate: Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField(const Foam::IOobject&, const Foam::GeometricField<Type, PatchField, GeoMesh>&, const wordList&, const wordList&) [with Type = double; PatchField = Foam::fvsPatchField; GeoMesh = Foam::surfaceMesh; Foam::wordList = Foam::List<Foam::word>]
Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
^~~~
J:/blueCFD-Core-2017/OpenFOAM-5.x/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.T.C:635:1: note: candidate expects 4 arguments, 2 provided
J:/blueCFD-Core-2017/OpenFOAM-5.x/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.T.C:601:1: note: candidate: Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField(const Foam::IOobject&, const Foam::GeometricField<Type, PatchField, GeoMesh>&, const Foam::word&) [with Type = double; PatchField = Foam::fvsPatchField; GeoMesh = Foam::surfaceMesh]
Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
^~~~
J:/blueCFD-Core-2017/OpenFOAM-5.x/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.T.C:601:1: note: candidate expects 3 arguments, 2 provided
J:/blueCFD-Core-2017/OpenFOAM-5.x/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.T.C:571:1: note: candidate: Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField(const Foam::word&, const Foam::tmp<Foam::GeometricField<Type, PatchField, GeoMesh> >&) [with Type = double; PatchField = Foam::fvsPatchField; GeoMesh = Foam::surfaceMesh]
Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
^~~~
J:/blueCFD-Core-2017/OpenFOAM-5.x/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.T.C:571:1: note: no known conversion for argument 2 from 'Foam::tmp<Foam::Field<double> >' to 'const Foam::tmp<Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> >&'
J:/blueCFD-Core-2017/OpenFOAM-5.x/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.T.C:539:1: note: candidate: Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField(const Foam::word&, const Foam::GeometricField<Type, PatchField, GeoMesh>&) [with Type = double; PatchField = Foam::fvsPatchField; GeoMesh = Foam::surfaceMesh]
Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
^~~~
J:/blueCFD-Core-2017/OpenFOAM-5.x/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.T.C:539:1: note: no known conversion for argument 2 from 'Foam::tmp<Foam::Field<double> >' to 'const Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>&'
J:/blueCFD-Core-2017/OpenFOAM-5.x/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.T.C:507:1: note: candidate: Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField(const Foam::IOobject&, const Foam::tmp<Foam::GeometricField<Type, PatchField, GeoMesh> >&) [with Type = double; PatchField = Foam::fvsPatchField; GeoMesh = Foam::surfaceMesh]
Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
^~~~
J:/blueCFD-Core-2017/OpenFOAM-5.x/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.T.C:507:1: note: no known conversion for argument 1 from 'const char [13]' to 'const Foam::IOobject&'
J:/blueCFD-Core-2017/OpenFOAM-5.x/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.T.C:475:1: note: candidate: Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField(const Foam::IOobject&, const Foam::GeometricField<Type, PatchField, GeoMesh>&) [with Type = double; PatchField = Foam::fvsPatchField; GeoMesh = Foam::surfaceMesh]
Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
^~~~
J:/blueCFD-Core-2017/OpenFOAM-5.x/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.T.C:475:1: note: no known conversion for argument 1 from 'const char [13]' to 'const Foam::IOobject&'
J:/blueCFD-Core-2017/OpenFOAM-5.x/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.T.C:446:1: note: candidate: Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField(const Foam::tmp<Foam::GeometricField<Type, PatchField, GeoMesh> >&) [with Type = double; PatchField = Foam::fvsPatchField; GeoMesh = Foam::surfaceMesh]
Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
^~~~
J:/blueCFD-Core-2017/OpenFOAM-5.x/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.T.C:446:1: note: candidate expects 1 argument, 2 provided
J:/blueCFD-Core-2017/OpenFOAM-5.x/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.T.C:415:1: note: candidate: Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField(const Foam::GeometricField<Type, PatchField, GeoMesh>&) [with Type = double; PatchField = Foam::fvsPatchField; GeoMesh = Foam::surfaceMesh]
Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
^~~~
J:/blueCFD-Core-2017/OpenFOAM-5.x/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.T.C:415:1: note: candidate expects 1 argument, 2 provided
J:/blueCFD-Core-2017/OpenFOAM-5.x/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.T.C:378:1: note: candidate: Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField(const Foam::IOobject&, const Mesh&, const Foam::dictionary&) [with Type = double; PatchField = Foam::fvsPatchField; GeoMesh = Foam::surfaceMesh; Foam::GeometricField<Type, PatchField, GeoMesh>::Mesh = Foam::fvMesh]
Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
^~~~
J:/blueCFD-Core-2017/OpenFOAM-5.x/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.T.C:378:1: note: candidate expects 3 arguments, 2 provided
J:/blueCFD-Core-2017/OpenFOAM-5.x/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.T.C:343:1: note: candidate: Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField(const Foam::IOobject&, const Mesh&) [with Type = double; PatchField = Foam::fvsPatchField; GeoMesh = Foam::surfaceMesh; Foam::GeometricField<Type, PatchField, GeoMesh>::Mesh = Foam::fvMesh]
Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
^~~~
J:/blueCFD-Core-2017/OpenFOAM-5.x/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.T.C:343:1: note: no known conversion for argument 1 from 'const char [13]' to 'const Foam::IOobject&'
J:/blueCFD-Core-2017/OpenFOAM-5.x/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.T.C:317:1: note: candidate: Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField(const Foam::IOobject&, const Mesh&, const Foam::dimensionSet&, const Foam::Field<Type>&, const Foam::PtrList<PatchField<Type> >&) [with Type = double; PatchField = Foam::fvsPatchField; GeoMesh = Foam::surfaceMesh; Foam::GeometricField<Type, PatchField, GeoMesh>::Mesh = Foam::fvMesh]
Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
^~~~
J:/blueCFD-Core-2017/OpenFOAM-5.x/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.T.C:317:1: note: candidate expects 5 arguments, 2 provided
J:/blueCFD-Core-2017/OpenFOAM-5.x/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.T.C:293:1: note: candidate: Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField(const Foam::IOobject&, const Internal&, const Foam::PtrList<PatchField<Type> >&) [with Type = double; PatchField = Foam::fvsPatchField; GeoMesh = Foam::surfaceMesh; Foam::GeometricField<Type, PatchField, GeoMesh>::Internal = Foam:imensionedField<double, Foam::surfaceMesh>]
Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
^~~~
J:/blueCFD-Core-2017/OpenFOAM-5.x/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.T.C:293:1: note: candidate expects 3 arguments, 2 provided
J:/blueCFD-Core-2017/OpenFOAM-5.x/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.T.C:266:1: note: candidate: Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField(const Foam::IOobject&, const Mesh&, const Foam::dimensioned<Type>&, const wordList&, const wordList&) [with Type = double; PatchField = Foam::fvsPatchField; GeoMesh = Foam::surfaceMesh; Foam::GeometricField<Type, PatchField, GeoMesh>::Mesh = Foam::fvMesh; Foam::wordList = Foam::List<Foam::word>]
Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
^~~~
J:/blueCFD-Core-2017/OpenFOAM-5.x/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.T.C:266:1: note: candidate expects 5 arguments, 2 provided
J:/blueCFD-Core-2017/OpenFOAM-5.x/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.T.C:240:1: note: candidate: Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField(const Foam::IOobject&, const Mesh&, const Foam::dimensioned<Type>&, const Foam::word&) [with Type = double; PatchField = Foam::fvsPatchField; GeoMesh = Foam::surfaceMesh; Foam::GeometricField<Type, PatchField, GeoMesh>::Mesh = Foam::fvMesh]
Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
^~~~
J:/blueCFD-Core-2017/OpenFOAM-5.x/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.T.C:240:1: note: candidate expects 4 arguments, 2 provided
J:/blueCFD-Core-2017/OpenFOAM-5.x/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.T.C:215:1: note: candidate: Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField(const Foam::IOobject&, const Mesh&, const Foam::dimensionSet&, const wordList&, const wordList&) [with Type = double; PatchField = Foam::fvsPatchField; GeoMesh = Foam::surfaceMesh; Foam::GeometricField<Type, PatchField, GeoMesh>::Mesh = Foam::fvMesh; Foam::wordList = Foam::List<Foam::word>]
Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
^~~~
J:/blueCFD-Core-2017/OpenFOAM-5.x/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.T.C:215:1: note: candidate expects 5 arguments, 2 provided
J:/blueCFD-Core-2017/OpenFOAM-5.x/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.T.C:191:1: note: candidate: Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField(const Foam::IOobject&, const Mesh&, const Foam::dimensionSet&, const Foam::word&) [with Type = double; PatchField = Foam::fvsPatchField; GeoMesh = Foam::surfaceMesh; Foam::GeometricField<Type, PatchField, GeoMesh>::Mesh = Foam::fvMesh]
Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
^~~~
J:/blueCFD-Core-2017/OpenFOAM-5.x/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.T.C:191:1: note: candidate expects 4 arguments, 2 provided
make: *** [/home/ofuser/blueCFD/OpenFOAM-5.x/wmake/rules/General/transform:26: Make/mingw_w64GccDPInt32Opt/mytwoPhaseEulerFoam1.o] Error 1
qi.yang@polimi.it is offline   Reply With Quote

Old   February 5, 2020, 08:29
Default
  #15
Cyp
Senior Member
 
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 299
Rep Power: 15
Cyp is on a distinguished road
are rho1 and sigma dimensionedScalar of volScalarField ?
Cyp is offline   Reply With Quote

Old   February 5, 2020, 08:36
Default
  #16
Senior Member
 
kimy
Join Date: Mar 2019
Posts: 150
Rep Power: 4
qi.yang@polimi.it is on a distinguished road
rho1 is the density of phase1 (dimensioned volume scalar) sigma is defined by me, which is a dimensonless constant.
qi.yang@polimi.it is offline   Reply With Quote

Old   February 5, 2020, 08:43
Question
  #17
Senior Member
 
kimy
Join Date: Mar 2019
Posts: 150
Rep Power: 4
qi.yang@polimi.it is on a distinguished road
Quote:
Originally Posted by Cyp View Post
You have to re-derive the PISO algorithm to check if you need further modifications. You might need to add some terms during the correction of the velocities but I am not sure. The only way to check that is to rederive the PISO with your modifications.


Code:
surfaceScalarField phiSomething
(
    "phiSomething", 
     rho1*fvc::interpolate(phase2.turbulence().nut())/sigma*fvc::snGrad(alpha1)
);

fvm::div(phiSomething, U1);
Sorry, I am not so familiar with numerical scheme. I found one equation described here. When we should regard one term as a source term rather than add it directly in the equation?
solve( fvm::laplacian(k, T) + fvm::Sp(sp, T) )
qi.yang@polimi.it is offline   Reply With Quote

Old   February 5, 2020, 10:54
Default
  #18
Cyp
Senior Member
 
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 299
Rep Power: 15
Cyp is on a distinguished road
Quote:
Originally Posted by qi.yang@polimi.it View Post
rho1 is the density of phase1 (dimensioned volume scalar) sigma is defined by me, which is a dimensonless constant.
but are they declared as volScalarField or as dimensionedScalar ?
Cyp is offline   Reply With Quote

Old   February 5, 2020, 11:59
Default
  #19
Senior Member
 
kimy
Join Date: Mar 2019
Posts: 150
Rep Power: 4
qi.yang@polimi.it is on a distinguished road
Quote:
Originally Posted by Cyp View Post
but are they declared as volScalarField or as dimensionedScalar ?
sigma I defined like the following in createfields:
dimensionedScalar sigma("sigma", dimViscosity/dimViscosity, mytransportProperties);

In fact, it is dimensionless.
qi.yang@polimi.it is offline   Reply With Quote

Old   February 5, 2020, 12:23
Default
  #20
Senior Member
 
kimy
Join Date: Mar 2019
Posts: 150
Rep Power: 4
qi.yang@polimi.it is on a distinguished road
I think I solved the problem with the following code:
- fvc::div(fvc::grad(alpha1)*rho1*phase2.turbulence( ).nut()/sigma*U1)
it was compiled successfully and I ran the test case. The results seem resonable.
However, I doubt that whether I need write the code like:
- fvc::Sp(div(fvc::grad(alpha1)*rho1*phase2.turbulen ce().nut()/sigma, U1))

Because I found the following two codes will lead different results.
solve( fvm::laplacian(k, T) + fvc::Sp(sp, T) );
solve( fvm::laplacian(k, T) + sp*T );

However, when I wrote - fvm::Sp(div(fvc::grad(alpha1)*rho1*phase2.turbulen ce().nut()/sigma, U1)), it failed to be compiled.

Last edited by qi.yang@polimi.it; February 6, 2020 at 03:35.
qi.yang@polimi.it is offline   Reply With Quote

Reply

Tags
multiphaseflow, twophaseeulerfoam

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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



All times are GMT -4. The time now is 23:54.