CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   compliing a new solver with wmake (http://www.cfd-online.com/Forums/openfoam/80642-compliing-new-solver-wmake.html)

kirankarki October 1, 2010 15:21

compliing a new solver with wmake
 
Hi, i am trying to run a solver modifying the existing one.I modified icoFoam solver and changed into icoScalarTransportFoam and changed all other things as per tutorial(Chalmers) .then i tried to compile the new solver in new icoScalarTransport directory by typing wmake in terminal but couldnt get anything. Here is the error msg:
kiran@kiran-desktop:/opt/openfoam170/applications/icoScalarTransportFoam$ wmake
mkdir: cannot create directory `linuxGccDPOpt': Permission denied
/bin/sh: cannot create linuxGccDPOpt/options: Directory nonexistent
make: *** [linuxGccDPOpt/options] Error 2
/opt/openfoam170/wmake/MakefileFiles:39: linuxGccDPOpt/options: No such file or directory
make: *** No rule to make target `linuxGccDPOpt/options'. Stop.
wmake error: file 'Make/linuxGccDPOpt/objectFiles' could not be created

Any help on this matter will be highly appreciated.
Thanks

wyldckat October 2, 2010 08:52

Greetings Kirankarki,

In openfoamwiki.net you can find a tutorial named "How to add temperature to icoFoam". In it you will find the following instructions that are crucial for you to follow:
Quote:

Originally Posted by http://openfoamwiki.net/index.php/How_to_add_temperature_to_icoFoam
Code:

cp -r icoFoam $FOAM_USER_APPBIN/../../solvers/my_icoFoam
cd $FOAM_USER_APPBIN/../../solvers/my_icoFoam

(...)
Now go into the Make subdirectory and open the 'files' file with your favorite editor. Change it to read:
Code:

my_icoFoam.C

EXE = $(FOAM_USER_APPBIN)/my_icoFoam


In other words, you have to take into account that your OpenFOAM installation is protected and cannot be overwritten without administrator's powers. But OpenFOAM already takes this into account, by providing a structure for users to have their own set of solvers and utilities, as well as a work folder. The key variables for the user paths are the variables that appear with this command:
Code:

env | grep -e "FOAM_USER_" -e "FOAM_RUN"
This is also explained in OpenFOAM's User Manual, "Compiling applications and libraries", section 3.2.2.

Best regards,
Bruno

kirankarki October 4, 2010 17:16

compilation
 
Thanks wyldckat for ur suggestions,
the code in the link u gave i think is for version1.4.1 which is older one.
i am using the new 1.7.1 version and i tried to follow the steps given in the link but even it doesnot work in the beginning copy stage. Do u have any guides for the new version of openFoam to modify the existing solver ,compile and run it.

Thanks again,

Kiran

akidess October 5, 2010 04:31

Kiran, the actual C++ code should work with newer versions. Anyways, I updated the wiki page, please let me know if something doesn't work as described.

kirankarki October 5, 2010 12:05

compilation
 
Actually , first i tried to follow the guides as per the http://openfoamwiki.net/index.php/Ho...ure_to_icoFoam to copy icoFoam to the $FOAM_USER_APPBIN but it doesnot work, then i followed the programming tutorial from Chalmers and tried to copy the solver in $WM_PROJECT_USER_DIR/applications and it works. Then i modified all the files as per the tutorial, and finally tried to compile and couldnt succeed, the same error again comes out. I really need help .
Thanks

akidess October 5, 2010 12:23

Quote:

Originally Posted by kirankarki (Post 277928)
[...]to copy icoFoam to the $FOAM_USER_APPBIN but it doesnot work[...]

WHY not? What was the error message?

Quote:

Originally Posted by kirankarki (Post 277928)
[...]Then i modified all the files as per the tutorial, and finally tried to compile and couldnt succeed, the same error again comes out.[...]

WHY not? What was the error message?

Quote:

Originally Posted by kirankarki (Post 277928)
I really need help

Then you should make it as easy as possible for people to help you.

Cheers,
Anton

kirankarki October 5, 2010 13:08

compiling
 
Hi guys i have another question as well,
i am also trying to follow the users guide form openfoam.com, where it gives the way to compile one simple solver pisoFoam as an example, it said:

The user can compile pisoFoam by going to the $FOAM_CFD/pisoFoam directory and typing:

wmake
I tried it but it didnt work,i dont know where this CFD comes from, there is no such directory in openfoam directory i installed,
is there any problem in my openfoam or what?

Thanks

wyldckat October 5, 2010 13:23

Greetings to all!

Anton: great job updating the wiki page!

Kirankarki: "FOAM_CFD" is a typo. I've answered this question before here: http://www.cfd-online.com/Forums/ope...tml#post268664 - post #3

I forgot to file a bug report back then :(

Best regards,
Bruno

kirankarki October 6, 2010 15:05

Visaulization
 
Hi Everybody,
Thanks for ur valuable suggestions, through your guidelines, now i can compile the modified solver. But i have another new problem in paraFoam, when i run the case with new solver,the terminal shows everything is ok and the calculations are done for T as well but it didnt show any results in paraView since it doesnot have T in its display button although it has been listed under properties - volume fields button and i checked it.

Any help pls

wyldckat October 7, 2010 07:42

Hi Kiran,
Quote:

Originally Posted by kirankarki (Post 278150)
But i have another new problem in paraFoam, when i run the case with new solver,the terminal shows everything is ok and the calculations are done for T as well but it didnt show any results in paraView since it doesnot have T in its display button although it has been listed under properties - volume fields button and i checked it.

Some questions come to my mind:
  1. Are you searching for the T value in the first time snapshot? If so, try starting from the last time snapshot.
  2. Have you checked if the T field is really in the time snapshot folder?
  3. Have you run/played the cavity tutorial, to get familiar with the controls in ParaView?
Best regards,
Bruno

kirankarki October 7, 2010 17:17

varying temp and material properties
 
Hi Guys,
Now i can see the results of the modified solver.Thanks once again .
Now i am trying to modify the geometry into prism like shape that resemble the attic in home so that new solver can be modified to study the heat transfer. I want to input the temperature that varies with every hour just like in a day, but i think now the boundary conditions specify only fixed temp along the sides of geometry.
Also, i am wondering the transport property nu gives the property of flowing fluid , right?But in my case , i need to give the material properties of the wall like thermal conductivity, specific heat , density which can be combined together in energy equation by Tau =k/Rho*C, Where should i put this property in the solver as well as in case folder,

Need help
Thanks

wyldckat October 7, 2010 17:42

Hi Kiran,

Well, now this is now officially out of my level of expertise. But I believe that you should look at the cht*MultiRegionFoam solvers and tutorials, because that is probably what you are looking for :)

Don't know which am I talking about? Then try running these commands:
Code:

find $FOAM_APPBIN -name "cht*MultiRegionFoam"
find $FOAM_TUTORIALS -name "cht*MultiRegionFoam"

Best regards,
Bruno

kirankarki October 8, 2010 12:34

chtMultiRegionFoam
 
Hey wyldckat,

thanks for suggestion , i go through this foam and it seems it has got too may files in both solvers n case folders that its tough to understand.Do u know anywhere the file structure for solver n case has been described in tutorial. The tutorial given in users guide documentation only describes three simple cases. But this one seems really big solver n case.
Thanks

mohsenkh599 October 12, 2010 08:26

compiling error
 
Hi every body,
I have a problem when I want to compile a model.
the error is:

************************************************** *********************
************************************************** *********************

viscoelasticLaws/mohsen/mohsen.C:159: error: no match for ‘operator==’ in ‘Foam::operator+(const Foam::tmp<Foam::fvMatrix<Type> >&, const Foam::tmp<Foam::fvMatrix<Type> >&) [with Type = Foam::SymmTensor<double>](((const Foam::tmp<Foam::fvMatrix<Foam::SymmTensor<double> > >&)((const Foam::tmp<Foam::fvMatrix<Foam::SymmTensor<double> > >*)(& Foam::fvm::div(const Foam::surfaceScalarField&, Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&) [with Type = Foam::SymmTensor<double>](((Foam::GeometricField<Foam::SymmTensor<double>, Foam::fvPatchField, Foam::volMesh>&)(&((Foam::mohsen*)this)->Foam::mohsen::a_))))))) == Foam::operator+(const Foam::tmp<Foam::GeometricField<TypeR, PatchField, GeoMesh> >&, const Foam::tmp<Foam::GeometricField<Type1, PatchField, GeoMesh> >&) [with Type1 = Foam::Tensor<double>, Type2 = Foam::SymmTensor<double>, PatchField = Foam::fvPatchField, GeoMesh = Foam::volMesh](((const Foam::tmp<Foam::GeometricField<Foam::SymmTensor<do uble>, Foam::fvPatchField, Foam::volMesh> >&)((const Foam::tmp<Foam::GeometricField<Foam::SymmTensor<do uble>, Foam::fvPatchField, Foam::volMesh> >*)(& Foam::operator*(const Foam::dimensioned<double>&, const Foam::tmp<Foam::GeometricField<Type, PatchField, GeoMesh> >&) [with Type = Foam::SymmTensor<double>, PatchField = Foam::fvPatchField, GeoMesh = Foam::volMesh](((const Foam::tmp<Foam::GeometricField<Foam::SymmTensor<do uble>, Foam::fvPatchField, Foam::volMesh> >&)((const Foam::tmp<Foam::GeometricField<Foam::SymmTensor<do uble>, Foam::fvPatchField, Foam::volMesh> >*)(& Foam::operator&(const Foam::tmp<Foam::GeometricField<TypeR, PatchField, GeoMesh> >&, const Foam::tmp<Foam::GeometricField<Type1, PatchField, GeoMesh> >&) [with Type1 = Foam::SymmTensor<double>, Type2 = Foam::SymmTensor<double>, PatchField = Foam::fvPatchField, GeoMesh = Foam::volMesh](((const Foam::tmp<Foam::GeometricField<Foam::SymmTensor<do uble>, Foam::fvPatchField, Foam::volMesh> >&)((const Foam::tmp<Foam::GeometricField<Foam::SymmTensor<do uble>, Foam::fvPatchField, Foam::volMesh> >*)(& Foam::operator-(const Foam::dimensioned<Type>&, const Foam::tmp<Foam::GeometricField<Type1, PatchField, GeoMesh> >&) [with Form = Foam::SymmTensor<double>, Type = Foam::SymmTensor<double>, PatchField = Foam::fvPatchField, GeoMesh = Foam::volMesh](((const Foam::tmp<Foam::GeometricField<Foam::SymmTensor<do uble>, Foam::fvPatchField, Foam::volMesh> >&)((const Foam::tmp<Foam::GeometricField<Foam::SymmTensor<do uble>, Foam::fvPatchField, Foam::volMesh> >*)(& Foam::operator*(const Foam::scalar&, const Foam::GeometricField<Type, PatchField, GeoMesh>&) [with Type = Foam::SymmTensor<double>, PatchField = Foam::fvPatchField, GeoMesh = Foam::volMesh](((const Foam::GeometricField<Foam::SymmTensor<double>, Foam::fvPatchField, Foam::volMesh>&)((const Foam::GeometricField<Foam::SymmTensor<double>, Foam::fvPatchField, Foam::volMesh>*)(&((Foam::mohsen*)this)->Foam::mohsen::a_))))))))))))))))))))’

************************************************** ************
************************************************** ************

and the model is :

// Velocity gradient tensor
volTensorField L = fvc::grad( U() );

// Convected derivate term
// volTensorField C = tau_ & L;

// vorticity term
volTensorField Vor = L - L.T();

// Twice the rate of deformation tensor
volSymmTensorField twoD = twoSymm( L );


// fc
scalar fc = 0.5; //1 - 27 * det( a_ );

//double dot term

// volSymmTensorField mk = -( (2 / 35) * ( 1 - fc ) * twoD - (2 / 7) * ( a_ & twoD + twoD & a_ + (1 / 2) * tr( twoD & a_ ) * I_ ) - fc * tr( twoD & a_ ) * a_ );

// Stress transport equation
tmp<fvSymmTensorMatrix> aEqn
(
fvm::ddt(a_)
+ fvm::div(phi(), a_)
==
( 1 / 2 ) * ( Vor & a_ - a_ & Vor ) + ( 1 / 2 ) * keisi_ * ( twoD & a_ + a_ & twoD + 2 * ( ( (2 / 35) * ( 1 - fc ) * twoD - (2 / 7) * ( 1 - fc ) * ( a_ & twoD + twoD & a_ + (1 / 2) * tr( twoD & a_ ) * I_ ) - fc * tr( twoD & a_ ) * a_ ) ) + 2 * ci_ * twoD & ( I_ - 3 * a_ )
//+ twoSymm( C )
//- zeta_ / 2 * ( (tau_ & twoD) + (twoD & tau_) )
//- fvm::Sp( epsilon_ / etaP_ * tr(tau_) + 1/lambda_, tau_ )
);

aEqn().relax();
solve(aEqn);
// Viscoelastic stress
tau_ = (etaP_ / keisi_) * (a_ - I_);
}

************************************************** ****************
************************************************** ****************

where "a" , "tau" and "I" are symmetric tensors and "Vor" is asymmetric tensor. and the others are constant parameters.

the Best

kirankarki October 14, 2010 17:23

Hi guys,
Greetings, Last time i modified the icoFoam solver to include transport equation with guidance from tutorials and your suggestions. Now, i am trying to include radiation heat transfer into this model. I am not sure whether it works or not but i followed the guidance from another tutorial. I did like this:
1. Include the following lines in my_icoFoam.C
#include "radiationModel.H"
#include "createRadiationModel.H"
2.Copy the hEqn.H from buoyantSimpleRadiationFoam.C into my_icoFoam directory
the equation is like this:
fvScalarMatrix hEqn
( fvm::div(phi, h)
- fvm::Sp(fvc::div(phi), h)
- fvm::laplacian(turbulence->alphaEff(), h)
==
fvc::div(phi/fvc::interpolate(rho)*fvc::interpolate(p))
- p*fvc::div(phi/fvc::interpolate(rho))
+ radiation->Sh(thermo)
);
3. Modified the Make/options like following:
EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
EXE_LIBS = \
-lradiation \
4. Remove the dependencis and run wmake.

Here i got the error, which is like this:
kiran@kiran-desktop:~/OpenFOAM/kiran-1.7.0/openfoam170/applications/solvers/heatTransfer/AtticFoam$ wmake
options:6: warning: backslash-newline at end of file
linuxGccDPOpt/options:10: *** missing separator. Stop.
wmake error: file 'Make/linuxGccDPOpt/objectFiles' could not be created

Please somebody tell me where i made the mistake.
If i can solve this compilation error, then i can go forward to modify the tutorial case to suit it.

Thanks

wyldckat October 14, 2010 18:02

Greetings to all!

Let me start with Kiran:
Quote:

Originally Posted by kirankarki (Post 279269)
3. Modified the Make/options like following:
EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
EXE_LIBS = \
-lradiation \

(...)

options:6: warning: backslash-newline at end of file
linuxGccDPOpt/options:10: *** missing separator. Stop.

The backlash is the character "\", which tells the code parser that the line of code continues in the next line, so the human user is able to read that piece of code without the need to scroll to the right. It's meant to be used as the last character of that line, as if it were a line break... Therefore, the correct code for your options file should be:
Code:

EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude

EXE_LIBS = \
-lradiation

Now as for Mohsen: sorry for the late reply, but when you guys post code without using the forum's "#" button for marking text that is code (visible in the forum's text editor toolbar in advanced mode), it becomes seriously hard to read the code :(
Anyway, it seems that you used one equal sign too many in the line 159, namely:
Code:

// Stress transport equation
    tmp<fvSymmTensorMatrix> aEqn
    (
        fvm::ddt(a_)
      + fvm::div(phi(), a_)
        ==
        ( 1 / 2 ) * ( Vor & a_ - a_ & Vor ) ...

There should only be one sign, I suppose :( At least is what the error message is insinuating:
Code:

viscoelasticLaws/mohsen/mohsen.C:159: error: no match for ‘operator==’ in
Best regards,
Bruno

mohsenkh599 October 17, 2010 08:15

Hi
 
2 Attachment(s)
Hello
I want to employ a solver for composite materials into the viscoelasticfluidFoam but while compiling there are errors which I cannot understand completely.
the set of equations and the code I have developed are attached.

the other parameters are constants.
the Best

kirankarki October 26, 2010 15:14

Hi Wyldckat,

Thanks for your help, i did changes you mentioned in the Make/options directory and then i tried to compile it, but got errors which is given below

kiran@kiran-desktop:~/OpenFOAM/kiran-1.7.0/openfoam170/applications/solvers/heatTransfer/AtticFoam$ wmake
linuxGccDPOpt/options:7: *** missing separator. Stop.
wmake error: file 'Make/linuxGccDPOpt/objectFiles' could not be created

Any help please

wyldckat October 26, 2010 17:59

Hi Kiran,

Without looking at the file, I can't deduce what's wrong :(
Perhaps you removed one too many backslashes "\"?

Best regards,
Bruno


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