|
[Sponsors] |
add a phase diffusion term in both continuity and monmentum equations for twoPhEuler |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
February 4, 2020, 14:08 |
add a phase diffusion term in both continuity and monmentum equations for twoPhEuler
|
#1 |
Senior Member
|
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. |
|
February 5, 2020, 06:09 |
|
#2 |
Senior Member
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 299
Rep Power: 18 |
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
__________________
www.cypriensoulaine.com/openfoam |
|
February 5, 2020, 06:20 |
|
#3 |
Senior Member
|
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); } |
|
February 5, 2020, 06:25 |
|
#4 |
Senior Member
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 299
Rep Power: 18 |
Code:
fvc::snGrad(alpha1)
__________________
www.cypriensoulaine.com/openfoam |
|
February 5, 2020, 06:39 |
|
#5 |
Senior Member
|
Really thanks. In terms of the pressure equations, there are some parts to be changed?
|
|
February 5, 2020, 06:44 |
|
#6 |
Senior Member
|
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&) |
|
February 5, 2020, 06:49 |
|
#7 |
Senior Member
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 299
Rep Power: 18 |
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);
__________________
www.cypriensoulaine.com/openfoam |
|
February 5, 2020, 07:10 |
|
#8 |
Senior Member
|
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? |
|
February 5, 2020, 08:26 |
|
#9 |
Senior Member
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 299
Rep Power: 18 |
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.
__________________
www.cypriensoulaine.com/openfoam |
|
February 5, 2020, 08:52 |
|
#10 |
Senior Member
|
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? |
|
February 5, 2020, 08:58 |
|
#11 |
Senior Member
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 299
Rep Power: 18 |
no problem as far as I can see.
You should have a look at the Programmer's Guide. All these points are discussed there.
__________________
www.cypriensoulaine.com/openfoam |
|
February 5, 2020, 09:03 |
|
#12 | |
Senior Member
|
Quote:
|
||
February 5, 2020, 09:09 |
|
#13 |
Senior Member
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 299
Rep Power: 18 |
what do you mean "it failed"?
__________________
www.cypriensoulaine.com/openfoam |
|
February 5, 2020, 09:12 |
|
#14 |
Senior Member
|
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 |
|
February 5, 2020, 09:29 |
|
#15 |
Senior Member
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 299
Rep Power: 18 |
are rho1 and sigma dimensionedScalar of volScalarField ?
__________________
www.cypriensoulaine.com/openfoam |
|
February 5, 2020, 09:36 |
|
#16 |
Senior Member
|
rho1 is the density of phase1 (dimensioned volume scalar) sigma is defined by me, which is a dimensonless constant.
|
|
February 5, 2020, 09:43 |
|
#17 | |
Senior Member
|
Quote:
solve( fvm::laplacian(k, T) + fvm::Sp(sp, T) ) |
||
February 5, 2020, 11:54 |
|
#18 |
Senior Member
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 299
Rep Power: 18 |
but are they declared as volScalarField or as dimensionedScalar ?
__________________
www.cypriensoulaine.com/openfoam |
|
February 5, 2020, 12:59 |
|
#19 |
Senior Member
|
||
February 5, 2020, 13:23 |
|
#20 |
Senior Member
|
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 04:35. |
|
Tags |
multiphaseflow, twophaseeulerfoam |
|
|