CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Compiling meltFoam solver (https://www.cfd-online.com/Forums/openfoam-programming-development/157169-compiling-meltfoam-solver.html)

mick223 July 21, 2015 20:41

Compiling meltFoam solver
 
1 Attachment(s)
Hi,

I'm having a lot of trouble compiling the meltFoam solver, used for modelling melting and solidification. I have been using the wclean then wmake all tools, however I am repeatedly getting the error that /opt/openfoam240/src/finiteVolume/lnInclude/cyclicAMIFvPatch.H:39:35: fatal error: cyclicAMILduInterface.H: No such file or directory
#include "cyclicAMILduInterface.H"

This comes after a string of other files being included from /opt.
Does anyone have a way to get around this error?

The terminal readout is attached.

Thank you.

alexeym July 22, 2015 03:11

Hi,

Code:

$ cd $FOAM_SRC
$ find . -name 'cyclicAMILduInterface.H'
./meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMILduInterfaceField/cyclicAMILduInterface.H
./meshTools/lnInclude/cyclicAMILduInterface.H

do you have

Code:

-I$(LIB_SRC)/meshTools/lnInclude
line as a part of EXE_INC in your Make/options?

mick223 July 22, 2015 23:32

Thanks Alexeym,

I downloaded a different copy of meltFoam from this site that included
Code:

-I$(LIB_SRC)/meshTools/lnInclude
and now the compilation has worked successfully, as far as I can tell.

Now I am having the issue that, upon running the meltFoam test case, I am getting the error:

Code:

--> FOAM FATAL IO ERROR:
Unknown patchField type buoyantPressure for patch type wall

Valid patchField types are :

62
(
advective
calculated
codedFixedValue
codedMixed
cyclic
cyclicACMI
cyclicAMI
cyclicSlip
directionMixed
empty
externalCoupled
fan
fanPressure
fixedFluxPressure
fixedGradient
fixedInternalValue
fixedJump
fixedJumpAMI
fixedMean
fixedPressureCompressibleDensity
fixedValue
freestream
freestreamPressure
inletOutlet
inletOutletTotalTemperature
mapped
mappedField
mappedFixedInternalValue
mappedFixedPushedInternalValue
mixed
nonuniformTransformCyclic
oscillatingFixedValue
outletInlet
outletMappedUniformInlet
partialSlip
phaseHydrostaticPressure
prghPressure
processor
processorCyclic
rotatingTotalPressure
sliced
slip
symmetry
symmetryPlane
syringePressure
timeVaryingMappedFixedValue
totalPressure
totalTemperature
turbulentInlet
turbulentIntensityKineticEnergyInlet
uniformDensityHydrostaticPressure
uniformFixedGradient
uniformFixedValue
uniformInletOutlet
uniformJump
uniformJumpAMI
uniformTotalPressure
variableHeightFlowRate
waveSurfacePressure
waveTransmissive
wedge
zeroGradient
)

Do I have to go back to compilation and add more libraries, or is this another kind of issue? I'm new to OpenFOAM, so sorry if these are simple errors.

Thanks again.

alexeym July 23, 2015 01:38

Hi,

In 2.3.0 buoyantPressure BC was removed in favor of fixedFluxPressure. See tutorial examples in tutorials/heatTransfer/buoyantBoussinesqPimpleFoam (since meltFoam is just derivative of buoyantBoussinesqPimpleFoam with Darcy term in momentum equation and solidification path in temperature equation).

mick223 July 23, 2015 06:50

Ok, so by changing to fixedFluxPressure it progressed past where it got stuck last time, however now it is getting to the transportProperties and giving the erro:

Code:

--> FOAM FATAL IO ERROR:
keyword cps is undefined in dictionary "/home/mick223/OpenFOAM/mick223-2.4.0/run/meltfoam_tutorial/constant/transportProperties"

file: /home/mick223/OpenFOAM/mick223-2.4.0/run/meltfoam_tutorial/constant/transportProperties from line 18 to line 35.

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

FOAM exiting

As far as I can see the cpS is defined in the file, so I can't see why this is happening.
Thanks

ssss July 23, 2015 06:56

cpS or cps? Be careful with the lower and upper cases

mick223 July 23, 2015 07:22

Changing it from cpS to cps seems to have worked, although other transportProperties files I have seen always keep it as cpS. Now I am getting

Code:

--> FOAM FATAL IO ERROR:
keyword mu is undefined in dictionary "/home/mick223/OpenFOAM/mick223-2.4.0/run/meltfoam_tutorial/constant/transportProperties"

file: /home/mick223/OpenFOAM/mick223-2.4.0/run/meltfoam_tutorial/constant/transportProperties from line 18 to line 35.

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

FOAM exiting

Which I cannot solve as easily, because there is no mu in the transport properties file.

ssss July 23, 2015 07:37

It is as easy as adding a new entry to your transportProperties with the name, value and dimensions of mu (dynamic viscosity)

alexeym July 23, 2015 08:20

Hi,

I think it would be easier for everybody if you post link to the code. Meaning of mu could be dynamic viscosity (as ssss proposed) or anything else (as author of the code supposed).

mick223 July 24, 2015 01:33

Ok, here is the transportProperties file from the meltFoam tutorial, I have left it as it was originally before changing the cpS etc to lower case. Header has been omitted. To me it seems strange that it would need me to put mu in, as laminar liquid and solid viscosity are already defined.

Code:

FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    location    "constant";
    object      transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

rho            rho [1 -3 0 0 0 0 0] 6093;

//liquid phase
cpL            cpL [0 2 -2 -1 0 0 0] 381.5;
lambdaL        lambdaL [1 1 -3 -1 0 0 0] 32;
nuL            nuL [0 2 -1 0 0 0 0] 2.97e-07;

//solid phase
cpS            cpS [0 2 -2 -1 0 0 0] 381.5;
lambdaS        lambdaS [1 1 -3 -1 0 0 0] 32;
nuS            nuS [0 2 -1 0 0 0 0] 2.97e-07;

Ts              Ts [0 0 0 1 0 0 0] 302.43;
Tl              Tl [0 0 0 1 0 0 0] 303.43;
hs              hs [0 2 -2 0 0 0 0] 80160;
beta            beta [0 0 0 -1 0 0 0] 1.2e-4;
DCl            DCl [0 0 -1 0 0 0 0] 1.6e06;
DCs            DCs [0 0 0 0 0 0 0] 1e-03;


// ************************************************************************* //


mick223 July 28, 2015 20:48

Ok, so having had no luck replaced the nuS and nuL values with mu (as they were both the same), I continued encountering errors as it asked for parameters with different names than what the meltFoam tutorial had. I am retrying the compilation with a different version of the solver, and am getting the error:

Code:

mick223@mick223-H81M-S2H:~/OpenFOAM/mick223-2.4.0/run/meltFoam$ wmake
Making dependency list for source file meltFoam.C
SOURCE=meltFoam.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-100 -I/opt/openfoam240/src/sampling/lnInclude -I/opt/openfoam240/src/meshTools/lnInclude -I/opt/openfoam240/src/fvOptions/lnInclude -I/opt/openfoam240/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/openfoam240/src/OpenFOAM/lnInclude -I/opt/openfoam240/src/OSspecific/POSIX/lnInclude  -fPIC -c $SOURCE -o Make/linux64GccDPOpt/meltFoam.o
In file included from meltFoam.C:83:0:
pEqn.H: In function ‘int main(int, char**)’:
pEqn.H:8:11: error: ‘ddtPhiCorr’ is not a member of ‘Foam::fvc’
        + fvc::ddtPhiCorr(rAU, U, phi);
          ^
In file included from meltFoam.C:56:0:
/opt/openfoam240/src/finiteVolume/lnInclude/readTimeControls.H:38:8: warning: unused variable ‘maxDeltaT’ [-Wunused-variable]
 scalar maxDeltaT =
        ^
meltFoam.dep:692: recipe for target 'Make/linux64GccDPOpt/meltFoam.o' failed
make: *** [Make/linux64GccDPOpt/meltFoam.o] Error 1
mick223@mick223-H81M-S2H:~/OpenFOAM/mick223-2.4.0/run/meltFoam$

Is this a result of including libraries not necessary, or has the new version of OpenFOAM made previous libraries redundant/incorrect?

Thanks.

fabian_roesler July 31, 2015 04:08

No need to fiddle about the code
 
You can't just remove the kinematic viscosity from the transport properties. The solver is incompressible and thus uses nu instead of mu. the new boundary condition fixedFluxPressure seems to need dynamic viscosity. So what?
Just add mu as second viscosity by multiplying nu with rho, which is also constant and the same value for both phases, to the transport properties. You don't have to change the code but are welcome to do so and post a version for OF 2.4.x

Cheers

Fabian

mick223 July 31, 2015 10:33

Thanks for the advice. As it stands I've installed OF2.2.2 so as to be able to use the meltFoam solver and case files I need, which is working so far. The issue I was having before was not limited to the case file and was a result of the changes to OF since the meltFoam solver I was using was posted, these changes including the transition from ddtPhiCorr to ddtCorr in the solver, as well as others I was not able to fix.

I'm new to OF but I'll revisit trying to get it to work on 2.4.x once I've finished the current project.

Thanks again,
Mick.


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