CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   'keyword nu is undefined' error - interDyMFoam (https://www.cfd-online.com/Forums/openfoam/110179-keyword-nu-undefined-error-interdymfoam.html)

Sagun December 5, 2012 07:38

'keyword nu is undefined' error - interDyMFoam
 
Hello everyone,

greetings from Germany. I'm attempting to simulate a simple rectangular object floating with 6 DoF in a 2-D tank with laminar flow. However, even when I'm not trying to calculate any forces on the object, still I'm getting the following error:

--> FOAM FATAL IO ERROR:
keyword nu is undefined in dictionary "/home/stripathi/OpenFOAM/stripathi-2.1.1/run/tutorials/multiphase/interDyMFoam/ras/floatingBox/constant/transportProperties"

file: /home/stripathi/OpenFOAM/stripathi-2.1.1/run/tutorials/multiphase/interDyMFoam/ras/floatingBox/constant/transportProperties from line 20 to line 32.

From function dictionary::lookupEntry(const word&, bool, bool) const
in file db/dictionary/dictionary.C at line 400.

FOAM exiting


I have gone through the extensive discussions on this topic on the forums here and somebody suggested to change the following line in forces.C

dimensionedScalar nu(transportProperties.lookup("nu"));

to

dimensionedScalar nu(transportProperties.lookupEntry("phase1").dict( ).lookup("nu"));

I have tried that too but to no avail. I don't seem to understand why the solver needs the value of nu when I'm not calculating any forces. Please help.

If necessary, I'll be happy to share my entire case files.

Thanks,
Sagun

mturcios777 December 5, 2012 12:21

What does your transport properties file look like? This is a simple dictionary look up, and if this isn't working, there may be more configuration we need to do for the case...

Sagun December 5, 2012 12:26

Thank you for your reply. This is my transportProperties file:

phase1
{
transportModel Newtonian;
nu nu [ 0 2 -1 0 0 0 0 ] 1e-06;
rho rho [ 1 -3 0 0 0 0 0 ] 998.2;
}

phase2
{
transportModel Newtonian;
nu nu [ 0 2 -1 0 0 0 0 ] 1.48e-05;
rho rho [ 1 -3 0 0 0 0 0 ] 1;
}

sigma sigma [ 1 0 -2 0 0 0 0 ] 0;


I also tried to define a nu whose definition is independent of the two phases. But then I got this floating point exception error:


sixDoFRigidBodyMotion constraints converged in 8 iterations
Constraint force: (-90392.2 0 0)
Constraint moment: (0 0 0)
Centre of mass: (6 0.05 -0.00933008)
Linear velocity: (-7.88612e-06 4.27282e-21 -1.34221)
Angular velocity: (-4.79635e-22 -2751.34 -8.84724e-22)
GAMG: Solving for cellDisplacementx, Initial residual = 0.975008, Final residual = 7.33219e-06, No Iterations 9
GAMG: Solving for cellDisplacementz, Initial residual = 0.993633, Final residual = 5.39243e-06, No Iterations 10
Execution time for mesh.update() = 0.2 s
time step continuity errors : sum local = 0.000824028, global = -8.93018e-11, cumulative = -4.83076e-05
GAMGPCG: Solving for pcorr, Initial residual = 1, Final residual = 3.18105e-06, No Iterations 7
time step continuity errors : sum local = 0.0765713, global = -1.87054e-08, cumulative = -4.83263e-05
MULES: Solving for alpha1
Phase-1 volume fraction = -7.47356e+292 Min(alpha1) = -2.69444e+296 Max(alpha1) = 2.85399e+289
#0 Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam211/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#1 Foam::sigFpe::sigHandler(int) in "/opt/openfoam211/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#2 Uninterpreted:
#3 Foam::multiply(Foam::Field<double>&, Foam::UList<double> const&, Foam::UList<double> const&) in "/opt/openfoam211/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#4 void Foam::multiply<Foam::fvsPatchField, Foam::surfaceMesh>(Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&) in "/opt/openfoam211/platforms/linuxGccDPOpt/bin/interDyMFoam"
#5 Foam::tmp<Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> > Foam::operator*<Foam::fvsPatchField, Foam::surfaceMesh>(Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::tmp<Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> > const&) in "/opt/openfoam211/platforms/linuxGccDPOpt/lib/libfiniteVolume.so"
#6 Foam::fv::gaussConvectionScheme<double>::flux(Foam ::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) const in "/opt/openfoam211/platforms/linuxGccDPOpt/lib/libfiniteVolume.so"
#7
at interDyMFoam.C:0
#8
in "/opt/openfoam211/platforms/linuxGccDPOpt/bin/interDyMFoam"
#9 __libc_start_main in "/lib/i386-linux-gnu/libc.so.6"
#10
in "/opt/openfoam211/platforms/linuxGccDPOpt/bin/interDyMFoam"
Floating point exception


I have no idea what's going wrong.

mturcios777 December 5, 2012 12:29

Your file looks fine for the second option of selecting a phase. Does this happen at the case start or during the simulation? If the latter, is your mesh changing?

Sagun December 5, 2012 12:32

Well, the case doesn't even run for a single iteration because I get the error right in the very beginning. I can send you my case files if you want to take a look.

mturcios777 December 5, 2012 12:35

Sure, I can have a look. And just to be clear, you are using the standard interDyMFoam? Which version?

Sagun December 5, 2012 12:39

Thank you so much. Yes I'm using the standard interDyMFoam solver in OF-2.1.1. Here is the link to my case files:

https://www.yousendit.com/download/W...bEpOQnk5TE1UQw

Sagun December 5, 2012 12:49

Is the link working? For some reason, a part of it is getting truncated.

mturcios777 December 5, 2012 13:14

The link is behaving badly. If the file isn't too large, just email it to me.

Sagun December 5, 2012 13:16

This has never happened before. The files are just about 2 MB. Where can I find your email ID?

mturcios777 December 5, 2012 13:18

marco >.< turcios :p gmail >.< com. Just remove all the special characters.

Sagun December 5, 2012 13:24

Sent you the files.

mturcios777 December 5, 2012 14:03

The problem is due to a quirk in the simulation model "laminar" (it doesn't play nicely with the twoPhaseMixture). To fix this, make the simulation type turbulent (RAS or LES, doesn't matter), then selecting the RAS/LES model "laminar" in RASProperties/LESProperties.

Look at the interDyMFoam tutorial floatingObject; you also have some entries missing in your fvSchemes file that you can copy from the tutorial case.

Sagun December 6, 2012 07:48

By missing entries, did you mean div(phi,k) and div(phi,epsilon)? I commented them out since I thought they were not needed for a laminar simulation.

Also, does changing the simulation type to RASModel also mean that I will have to define nut, k and epsilon files in the 0 sub-directory? If yes, then could you also tell me how to define these values on a generic patch since in my case the inlet as well as outlet patch types are not 'wall'? I have never simulated a turbulent case before so I really don't know how to go about it.

Thanks,
Sagun

Sagun December 6, 2012 08:08

Okay so I made the changes and the k, nut and epsilon files were not required after all. However, I got this error instead:

Interface Courant Number mean: 0.000535203 max: 0.209637
Courant Number mean: 0.042629 max: 0.451474
deltaT = 0.00061539
Time = 0.00553003

sixDoFRigidBodyMotion constraints converged in 8 iterations
Constraint force: (-90392.2 0 0)
Constraint moment: (0 0 0)
Centre of mass: (6 0.05 -0.00933008)
Linear velocity: (-7.88624e-06 7.05546e-21 -1.34221)
Angular velocity: (-4.05472e-23 -2751.34 -6.02554e-23)
GAMG: Solving for cellDisplacementx, Initial residual = 0.975008, Final residual = 7.33219e-06, No Iterations 9
GAMG: Solving for cellDisplacementz, Initial residual = 0.993633, Final residual = 5.39243e-06, No Iterations 10
Execution time for mesh.update() = 0.2 s
time step continuity errors : sum local = 0.000824028, global = -8.93018e-11, cumulative = -4.83076e-05
GAMGPCG: Solving for pcorr, Initial residual = 1, Final residual = 3.18105e-06, No Iterations 7
time step continuity errors : sum local = 0.0765713, global = -1.87054e-08, cumulative = -4.83263e-05
MULES: Solving for alpha1
Phase-1 volume fraction = -7.47356e+292 Min(alpha1) = -2.69444e+296 Max(alpha1) = 2.85399e+289
#0 Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam211/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#1 Foam::sigFpe::sigHandler(int) in "/opt/openfoam211/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#2 Uninterpreted:
#3 Foam::multiply(Foam::Field<double>&, Foam::UList<double> const&, Foam::UList<double> const&) in "/opt/openfoam211/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#4 void Foam::multiply<Foam::fvsPatchField, Foam::surfaceMesh>(Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&) in "/opt/openfoam211/platforms/linuxGccDPOpt/bin/interDyMFoam"
#5 Foam::tmp<Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> > Foam::operator*<Foam::fvsPatchField, Foam::surfaceMesh>(Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::tmp<Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> > const&) in "/opt/openfoam211/platforms/linuxGccDPOpt/lib/libfiniteVolume.so"
#6 Foam::fv::gaussConvectionScheme<double>::flux(Foam ::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) const in "/opt/openfoam211/platforms/linuxGccDPOpt/lib/libfiniteVolume.so"
#7
at interDyMFoam.C:0
#8
in "/opt/openfoam211/platforms/linuxGccDPOpt/bin/interDyMFoam"
#9 __libc_start_main in "/lib/i386-linux-gnu/libc.so.6"
#10
in "/opt/openfoam211/platforms/linuxGccDPOpt/bin/interDyMFoam"
Floating point exception


Could you tell me how to fix this?

mturcios777 December 6, 2012 12:18

This is more related to your case setup. I am not very familiar with the interFoam solvers (other than a running the tutorial cases and examining the solver code) so I'm not sure if this is an issue with initial conditions, boundary conditions, or possibly schemes/solution tolerance. I hope someone on the forum is able to provide more guidance from this point in.

The missing term was related to temperature [div*muEff*dev(T(grad(U)))))]. You don't need k and epsilon for the laminar RAS model, as it's just a dummy turbulence model where mut/nut = 0.

Good luck!

Sagun December 7, 2012 07:06

Well, I hope someone does. Thanks for your help :)

Sagun December 7, 2012 07:13

Just one last question though, why would I need the temperature term [div*muEff*dev(T(grad(U)))))]? I didn't find it anywhere in the fvSchemes of floatingBox too.

mturcios777 December 7, 2012 12:40

Really? Because I copied over from the included 2.1.x case (tutorials/multiphase/interDyMFoam/ras/floatingBox). My guess is that the term is actually related to turbulence, not temperature.

Sagun December 7, 2012 16:54

Actually now that you mentioned it, I ran the floatingObject tutorial and it didn't work! I think the tutorial files that I have are incomplete or something. Would it be possible for you to send me your copy of the floatingObject tutorial?

mturcios777 December 7, 2012 17:02

1 Attachment(s)
I'll send you my copy

Sagun December 8, 2012 08:48

Thank you for this. However, I need to define the 'adjoint' keyword for the pressure boundary conditions. I have never worked with fixedFluxPressure boundary condition before so I have no idea how to assign a 'yes' or 'no' to the keyword 'adjoint'.


All times are GMT -4. The time now is 08:59.