CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

Error compiling pisoFOAM

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   January 23, 2012, 16:01
Default Error compiling pisoFOAM
  #1
New Member
 
Eric
Join Date: Jan 2012
Posts: 18
Rep Power: 5
EVBUCF is on a distinguished road
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;
}
EVBUCF is offline   Reply With Quote

Old   January 23, 2012, 16:24
Default
  #2
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,301
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Greetings Eric and welcome to the forum!

Quote:
Originally Posted by EVBUCF View Post
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
wyldckat is offline   Reply With Quote

Old   January 23, 2012, 16:39
Default
  #3
New Member
 
Eric
Join Date: Jan 2012
Posts: 18
Rep Power: 5
EVBUCF is on a distinguished road
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?
EVBUCF is offline   Reply With Quote

Old   January 23, 2012, 16:47
Default
  #4
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,301
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
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
wyldckat is offline   Reply With Quote

Old   January 23, 2012, 23:10
Default
  #5
Senior Member
 
Sandy Lee
Join Date: Mar 2009
Posts: 207
Rep Power: 9
sandy is on a distinguished road
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
sandy is offline   Reply With Quote

Old   January 25, 2012, 19:18
Default
  #6
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,301
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Hi Sandy,

Quote:
Originally Posted by sandy View Post
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
wyldckat is offline   Reply With Quote

Old   January 25, 2012, 20:00
Default
  #7
Senior Member
 
Sandy Lee
Join Date: Mar 2009
Posts: 207
Rep Power: 9
sandy is on a distinguished road
That's better, Bruno! .... I will finish them following you .... Thanks
sandy is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Differences in solution method for pisoFoam and buoyantBoussinesqPisoFoam mchurchf OpenFOAM 6 September 10, 2013 23:24
pisoFoam : error floating point Dbutant OpenFOAM Running, Solving & CFD 10 October 9, 2012 09:45
pisoFoam compiling error with OF 1.7.1 on MAC OSX Greg Givogue OpenFOAM Programming & Development 3 March 4, 2011 18:18
Trouble migrating oodles to pisoFoam while changing from OF 1.5 to 1.7 sebi OpenFOAM 0 December 7, 2010 10:00
Buoundary Condition for PisoFoam vishal OpenFOAM 4 October 21, 2010 09:17


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