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

Error compiling pisoFOAM

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 23, 2012, 15:01
Default Error compiling pisoFOAM
  #1
New Member
 
Eric
Join Date: Jan 2012
Posts: 18
Rep Power: 14
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, 15:24
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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, 15:39
Default
  #3
New Member
 
Eric
Join Date: Jan 2012
Posts: 18
Rep Power: 14
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, 15:47
Default
  #4
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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, 22:10
Default
  #5
Senior Member
 
Sandy Lee
Join Date: Mar 2009
Posts: 213
Rep Power: 18
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, 18:18
Default
  #6
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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, 19:00
Default
  #7
Senior Member
 
Sandy Lee
Join Date: Mar 2009
Posts: 213
Rep Power: 18
sandy is on a distinguished road
That's better, Bruno! .... I will finish them following you .... Thanks
sandy is offline   Reply With Quote

Reply


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 Off
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 7 August 6, 2023 09:12
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 17:18
Trouble migrating oodles to pisoFoam while changing from OF 1.5 to 1.7 sebi OpenFOAM 0 December 7, 2010 09:00
Buoundary Condition for PisoFoam vishal OpenFOAM 4 October 21, 2010 09:17


All times are GMT -4. The time now is 18:35.