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/)
-   -   Error compiling pisoFOAM (https://www.cfd-online.com/Forums/openfoam-programming-development/96458-error-compiling-pisofoam.html)

EVBUCF January 23, 2012 16:01

Error compiling pisoFOAM
 
I have edited the pisoFOAM solver to allow for an adaptive time-step but when I try to compile the solver i get an error that states:

wmake error: environment variable $WM_OPTIONS not set

I have searched through countless forums and have not found a solution to this problem. If you have any ideas why this is occurring please enlighten me.

This is my pisoFOAM.C file:

#include "fvCFD.H"
#include "singlePhaseTransportModel.H"
#include "turbulenceModel.H"

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

int main(int argc, char *argv[])
{
#include "setRootCase.H"

#include "createTime.H"
#include "createMesh.H"
#include "createFields.H"
#include "initContinuityErrs.H"
#include "CourantNo.H"
#include "readTimeControls.H"
#include "setInitialDeltaT.H"

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

Info<< "\nStarting time loop\n" << endl;

for (runTime++; !runTime.end(); runTime++)
{
Info<< "Time = " << runTime.timeName() << nl << endl;

#include "readTimeControls.H"
#include "readPISOControls.H"
#include "CourantNo.H"
#include "setDeltaT.H"

// Pressure-velocity PISO corrector
{
// Momentum predictor

fvVectorMatrix UEqn
(
fvm::ddt(U)
+ fvm::div(phi, U)
+ turbulence->divDevReff(U)
);

UEqn.relax();

if (momentumPredictor)
{
solve(UEqn == -fvc::grad(p));
}

// --- PISO loop

for (int corr=0; corr<nCorr; corr++)
{
volScalarField rUA = 1.0/UEqn.A();

U = rUA*UEqn.H();
phi = (fvc::interpolate(U) & mesh.Sf())
+ fvc::ddtPhiCorr(rUA, U, phi);

adjustPhi(phi, U, p);

// Non-orthogonal pressure corrector loop
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
// Pressure corrector

fvScalarMatrix pEqn
(
fvm::laplacian(rUA, p) == fvc::div(phi)
);

pEqn.setReference(pRefCell, pRefValue);

if
(
corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
{
pEqn.solve(mesh.solver("pFinal"));
}
else
{
pEqn.solve();
}

if (nonOrth == nNonOrthCorr)
{
phi -= pEqn.flux();
}
}

#include "continuityErrs.H"

U -= rUA*fvc::grad(p);
U.correctBoundaryConditions();
}
}

turbulence->correct();

runTime.write();

Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
}

Info<< "End\n" << endl;

return 0;
}

wyldckat January 23, 2012 16:24

Greetings Eric and welcome to the forum!

Quote:

Originally Posted by EVBUCF (Post 340710)
wmake error: environment variable $WM_OPTIONS not set

The error message seems self-explanatory... it seems that your shell environment isn't fully operational.

How exactly are you activating your shell environment? I'm talking about the following installation step:
Quote:

Originally Posted by http://www.openfoam.org/download/source.php
if running bash or ksh (if in doubt type echo $SHELL), source the etc/bashrc file by adding the following line to the end of your $HOME/.bashrc file:
Code:

source $HOME/OpenFOAM/OpenFOAM-2.1.0/etc/bashrc
then type “source $HOME/.bashrc” in the current terminal window

For some more detailed information, see: Advanced tips for working with the OpenFOAM shell environment

Best regards,
Bruno

EVBUCF January 23, 2012 16:39

Thanks for responding!
I'm afraid I am a somewhat new user to OpenFOAM so my background knowledge may be limited. I am not sure what you mean by the shell environment but the line that you described from the bashrc file exists already except that it is in the opt directory not home.

Something I have noticed is that after I made changes to the pisoFOAM.C file I ran wclean and the Make folder dissapeared within the pisoFOAM directory. Do I need to remake that folder or is the wmake command supposed to create this for me?

wyldckat January 23, 2012 16:47

Hi Eric,

Then I suggest that you practice a bit more before going into the real deal. Here is a good tutorial: http://openfoamwiki.net/index.php/Ho...ure_to_icoFoam
Pay good attention to the detail "FOAM_USER_APPBIN".

As for "shell environment", see the first paragraphs of Advanced tips for working with the OpenFOAM shell environment

Best regards,
Bruno

sandy January 23, 2012 23:10

Hi Bruno,

Could you tell me how to compile a new solver in OpenFoam-2.1.0? I did them step by step following in http://openfoamwiki.net/index.php/Ho...ure_to_icoFoam , however, I got error informations as follows:

MyinterFoam.C:65:41: fatal error: ../interFoam/correctPhi.H: No such file or directory
compilation terminated.
make: *** [Make/linuxGccDPOpt/MyinterFoam.o] Error 1

Please help me out. Thanks

Sandy

wyldckat January 25, 2012 19:18

Hi Sandy,

Quote:

Originally Posted by sandy (Post 340758)
however, I got error informations as follows:

MyinterFoam.C:65:41: fatal error: ../interFoam/correctPhi.H: No such file or directory
compilation terminated.
make: *** [Make/linuxGccDPOpt/MyinterFoam.o] Error 1

Well that's misleading... it looks like you copied/modified the solver "interPhaseChangeFoam". On the file "interPhaseChangeFoam/interPhaseChangeFoam.C" you can find this line:
Code:

#include "../interFoam/correctPhi.H"
Change it to:
Code:

#include "correctPhi.H"
And copy the file "correctPhi.H" from "interFoam" to your modified solver folder:
Code:

cp $FOAM_APP/solvers/multiphase/interFoam/correctPhi.H .
Best regards,
Bruno

sandy January 25, 2012 20:00

:eek::confused::D That's better, Bruno! .... I will finish them following you .... Thanks


All times are GMT -4. The time now is 05:48.