|
[Sponsors] |
March 2, 2019, 10:49 |
Solver modification [noob question]
|
#1 |
New Member
Cagkan
Join Date: Aug 2015
Posts: 8
Rep Power: 10 |
Hello everyone,
I'm trying to form a 2D numerical wave tank in OF and using interFoam solver with turbulence. When you try to include both turbulence and wave action in the same model waves starts to dampen as they propagate. VOF scheme in the interFoam is the reason for that, and I'm experiencing the exact thing. In "Multiphase and Free-Surface Flow Simulations" presentation, Mr. Paterson showed a way to overcome that problem by modifying the air convection eq. by multiplying it with phase fraction, gamma. in UEqn.H, I've add the red line but, Code:
MRF.correctBoundaryVelocity(U); fvVectorMatrix UEqn ( fvm::ddt(rho, U) + gamma*fvm::div(rhoPhi, U) + MRF.DDt(rho, U) + turbulence->divDevRhoReff(rho, U) == fvOptions(rho, U) ); Code:
/opt/OpenFOAM/OpenFOAM-v1812/src/finiteVolume/lnInclude/fvMatrix.C:2310:33: note: candidate: template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foam::operator*(const Foam::dimensioned<double>&, const Foam::tmp<Foam::fvMatrix<Type> >&) Foam::tmp<Foam::fvMatrix<Type>> Foam::operator* ^~~~ /opt/OpenFOAM/OpenFOAM-v1812/src/finiteVolume/lnInclude/fvMatrix.C:2310:33: note: template argument deduction/substitution failed: In file included from interFoamMod.C:159:0: UEqn.H:6:33: note: cannot convert ‘gamma’ (type ‘double(double) throw ()’) to type ‘const Foam::dimensioned<double>&’ + gamma*fvm::div(rhoPhi, U) Sorry for the long post Thanks in advance Cagkan |
|
March 5, 2019, 06:32 |
|
#2 |
Member
Mat
Join Date: Jan 2012
Posts: 60
Rep Power: 14 |
Hi,
Which solver did you use ? How is gamma declared ? This is just a compatibility problem. Regards, Mat |
|
March 5, 2019, 06:39 |
|
#3 |
New Member
Cagkan
Join Date: Aug 2015
Posts: 8
Rep Power: 10 |
||
March 5, 2019, 07:30 |
|
#4 | |
Senior Member
anonymous
Join Date: Jan 2016
Posts: 416
Rep Power: 14 |
Quote:
Hi! Your gamma declaration is wrong. You have to declare gamma as a dimensioned double. Read these lines: Code:
UEqn.H:6:33: note: cannot convert ‘gamma’ (type ‘double(double) throw ()’) to type ‘const Foam::dimensioned<double>&’ + gamma*fvm::div(rhoPhi, U) |
||
March 5, 2019, 07:39 |
|
#5 |
New Member
Cagkan
Join Date: Aug 2015
Posts: 8
Rep Power: 10 |
Hi,
Thank you for responding I've read the error code, my question is how to declare gamma correctly. I've tried "gamma()" and "gamma.value()" but couldn't managed to compile it. |
|
March 5, 2019, 07:59 |
|
#6 |
Senior Member
anonymous
Join Date: Jan 2016
Posts: 416
Rep Power: 14 |
You can find constructors for a dimensionedScalar here:
https://cpp.openfoam.org/v6/dimensio...ce.html#l00076 BUT! You said "multiplying it with phase fraction, gamma." Then why don't you use the alpha instead? If I'm correct you can access it with alpha1 or alpha2, or maybe mixture.alpha1() and mixture.alpha2(), honestly I'm not sure which is the correct one. These are volScalarFields and I think you can use them in the equation. |
|
March 8, 2019, 07:17 |
Declare gamma as a scalar
|
#7 |
New Member
Ramzy
Join Date: Apr 2018
Location: Raleigh, NC
Posts: 1
Rep Power: 0 |
Good Day,
You will have to declare gamma for the code to understand it. In other words, the code does not know what is gamma, or, it is defined inside the code already with another definition that is not suitable for the equation. 1- The gamma you mentioned seems to be a scalar. Hence, you want to tell the code that. This is done by declaration in side a file called creatFields ( probably) related to the solver you are using. If you open it, just copy the definition used for "rho" and use it for gamma, it will be a volScalarField. Moreover, you have to search where the "rho" is mentioned ( i.e. not only its definition as a volScalarField) and do that for gamma as well. Note that you will have to initialize it then, i.e. use a boundary file for it like you do for velocity for e.g. 2- Another better method is to define it as a constant ( if it is indeed a constant ). You will then have to declare it as a scalar, and make it to be read from a dictionary and such. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
thobois class engineTopoChangerMesh error | Peter_600 | OpenFOAM | 4 | August 2, 2014 09:52 |
Divergence problem | Smaras | FLUENT | 13 | February 21, 2013 05:03 |
3d vof | Smaras | FLUENT | 2 | February 19, 2013 06:58 |
why the solver reject it? Anyone with experience? | bearcat | CFX | 6 | April 28, 2008 14:08 |
Error during Solver | cfd guy | CFX | 4 | May 8, 2001 06:04 |