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

help! where to begin study OF?!

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By elvis

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 9, 2012, 10:47
Default help! where to begin study OF?!
  #1
Member
 
HouKen
Join Date: Jul 2011
Posts: 67
Rep Power: 15
houkensjtu is on a distinguished road
Hi openFoamer!
I am a student and my research is about flow boiling in microchannel.
I have been doing some programming using Fortran (based on SOLA-VOF and RIPPLE) to simulate bubble flow in microchannel.
After I finished my thesis by that, I am now looking forward to use openFoam to continue my work--bubble flow with phase-change inside microchannel.
I have read the official user-guide and have a glance at programmer guide. Both of them are too brief and I can not do anything other than run the tutorial case written in the user-guide. Also I totally can't understand how openFoam work.
Is there any proper study material can help beginner to learn OF?
THX!
houkensjtu is offline   Reply With Quote

Old   September 10, 2012, 03:57
Default
  #2
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30
akidess will become famous soon enough
The single best source of information is still the official guide, even considering it's deficiencies. After working through it you should be able to set up and run cases without too much trouble. Apart from that there's the OpenFOAM wiki and this forum.

I recommend you to work (not just read!) through the tutorials described in the guide if you haven't yet, then set up a microchannel simulation without phase change. Once you have that you'll have to do some programming into interFoam to add phase change - I think you can find clues on the forum on how to do that (i.e. people have already done it). Having a good C++ book on your desk will help you surely. Finally, be aware that you're on a long road - it takes years to become proficient at writing your own code.

- Anton
__________________
*On twitter @akidTwit
*Spend as much time formulating your questions as you expect people to spend on their answer.
akidess is offline   Reply With Quote

Old   September 11, 2012, 21:59
Default
  #3
Member
 
HouKen
Join Date: Jul 2011
Posts: 67
Rep Power: 15
houkensjtu is on a distinguished road
Quote:
Originally Posted by akidess View Post
The single best source of information is still the official guide, even considering it's deficiencies. After working through it you should be able to set up and run cases without too much trouble. Apart from that there's the OpenFOAM wiki and this forum.

I recommend you to work (not just read!) through the tutorials described in the guide if you haven't yet, then set up a microchannel simulation without phase change. Once you have that you'll have to do some programming into interFoam to add phase change - I think you can find clues on the forum on how to do that (i.e. people have already done it). Having a good C++ book on your desk will help you surely. Finally, be aware that you're on a long road - it takes years to become proficient at writing your own code.

- Anton
Thx for reply!
Yeah I found the foam wiki really helpful, and I am now working through the tutorials step by step.
In fact I am totally patient to study even it's long way to go, problem is, my professor can't even wait a week to see results...That's really annoying u know...
houkensjtu is offline   Reply With Quote

Old   September 12, 2012, 12:23
Default
  #4
Senior Member
 
Elvis
Join Date: Mar 2009
Location: Sindelfingen, Germany
Posts: 620
Blog Entries: 6
Rep Power: 24
elvis will become famous soon enough
Hi,

there is http://www.tfd.chalmers.se/~hani/kurser/OS_CFD/
or search those peer-reviewed, student-contributed tutorials
http://www.tfd.chalmers.se/~hani/kurser/OS_CFD_2008/ (or that tutorials 2007 until 2011)

great stuff
http://www.personal.psu.edu/dab143/OFW6/training.htm
http://www.personal.psu.edu/dab143/OFW6/Program.htm search for a technical presentation that suits to your topic in the program might be of interest
czhao86 likes this.
elvis is offline   Reply With Quote

Old   September 12, 2012, 13:46
Default About zero flux boundary condition...
  #5
Member
 
M Mallikarjuna Reddy
Join Date: Jul 2012
Posts: 91
Rep Power: 14
mmkr825 is on a distinguished road
Hi everyone,
I am fresher for openFoam. I have written my own application. I am doing my project on suspension (solid particles in fluid) flow through straight channels. I prepared my solver for the coupling of continuity, momentum and particle conservation equation.
Now i am facing problem with boundary condition for the particle volume fraction at the upper and lower walls. When applied this condition in particle conservation equation i got an expression for the gradient of particle volume fraction.
my governing equation for the particle volume fraction is:-

solve
(
fvm::div(phi, T)
+ fvm::laplacian(0.62*1.82*pow(a,2)*g*pow(T,2)*pow(0 .68-T,-1), T)
+ fvm::laplacian(0.41*pow(a,2)*g*T, T)
==
- fvc::laplacian(0.41*pow(a,2)*T*T, g)
);


where T=particle volume fraction (no units)
where g=local strain rate scalar=1.41421*sqrt(magSqr(symm(fvc::grad(U))))

After applying zero boundary condition i got an expression for gradient as:-
grad(T)= - 0.41*pow(T, 2)*(fvc::grad(g))/(T*g*(0.41+T*1.1284*pow(0.68-T, -1)))

For this purpose i need to develop derived boundary condition. I checked the boundary conditions and found that solidDisplacementFoam/tractionDisplacement matches for my needs. I developed code based upon that solver but i am getting some error message. That's why i reproduced the same tractionDisplacement changing name to mytractionDisplacement.

when i compiled with wmake the following error is coming (which is same as those i obtained for the above gradient expression)
Error message:-
malli_reddy@ubuntu:~/Desktop/mysolidDisplacementFoam/mytractionDisplacement$ wmake

Making dependency list for source file mytractionDisplacementFvPatchVectorField.C
SOURCE=mytractionDisplacementFvPatchVectorField.C ; g++ -m32 -Dlinux -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam211/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/openfoam211/src/OpenFOAM/lnInclude -I/opt/openfoam211/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linuxGccDPOpt/mytractionDisplacementFvPatchVectorField.o
g++ -m32 -Dlinux -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam211/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/openfoam211/src/OpenFOAM/lnInclude -I/opt/openfoam211/src/OSspecific/POSIX/lnInclude -fPIC -Xlinker --add-needed -Xlinker --no-as-needed Make/linuxGccDPOpt/mytractionDisplacementFvPatchVectorField.o -L/opt/openfoam211/platforms/linuxGccDPOpt/lib \
-lfiniteVolume -lOpenFOAM -ldl -lm -o /home/malli_reddy/OpenFOAM/malli_reddy-2.1.1/platforms/linuxGccDPOpt
/bin/mytractionDisplacementFvPatchVectorField
/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2/../../../crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
collect2: ld returned 1 exit status
make: *** [/home/malli_reddy/OpenFOAM/
malli_reddy-2.1.1/platforms/linuxGccDPOpt/bin/mytractionDisplacementFvPatchVectorField] Error 1

Please guide me to rectify this error. Now i am using OF 2.1.1 version. And give any valuable information about swak4Foam utility.

Thanks
Regards
Mallikarjuna
mmkr825 is offline   Reply With Quote

Old   September 12, 2012, 20:29
Default
  #6
Senior Member
 
Adhiraj
Join Date: Sep 2010
Location: Karnataka, India
Posts: 187
Rep Power: 16
adhiraj is on a distinguished road
Are you building the library when you get this error?
wmake is used to build the solvers, and they have the main() function.
For the library use "wmake libso".
adhiraj is offline   Reply With Quote

Old   September 13, 2012, 01:57
Default
  #7
Member
 
M Mallikarjuna Reddy
Join Date: Jul 2012
Posts: 91
Rep Power: 14
mmkr825 is on a distinguished road
Hi Adhiraj,
Thanks for your quick reply. Now i got the solution for mytractionDisplacement. But when i extend to my needs the following error message is coming.
Error Message:-
malli_reddy@ubuntu:~/OpenFOAM/malli_reddy-2.1.1/myDiffusiveFoam/myFlux$ wmake libso

wmakeLnInclude: linking include files to ./lnInclude
Making dependency list for source file myFluxFvPatchScalarField.C
SOURCE=myFluxFvPatchScalarField.C ; g++ -m32 -Dlinux -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam211/src/finiteVolume/lnInclude -I/opt/openfoam211/src/turbulenceModels -I/opt/openfoam211/src/turbulenceModels/incompressible/RAS/RASModel -I/opt/openfoam211/src/transportModels -I/opt/openfoam211/src/transportModels/incompressible/singlePhaseTransportModel -I/opt/openfoam211/src/turbulenceModels/incompressible/RAS/lnInclude -I/opt/openfoam211/src/finiteVolume/lnInclude -I/opt/openfoam211/src/meshTools/lnInclude -IlnInclude -I. -I/opt/openfoam211/src/OpenFOAM/lnInclude -I/opt/openfoam211/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linuxGccDPOpt/myFluxFvPatchScalarField.o
In file included from /opt/openfoam211/src/OpenFOAM/lnInclude/Field.C:735:0,
from /opt/openfoam211/src/OpenFOAM/lnInclude/Field.H:360,
from /opt/openfoam211/src/OpenFOAM/lnInclude/labelField.H:39,
from /opt/openfoam211/src/OpenFOAM/lnInclude/primitiveFields.H:37,
from /opt/openfoam211/src/OpenFOAM/lnInclude/pointField.H:36,
from /opt/openfoam211/src/OpenFOAM/lnInclude/edge.H:40,
from /opt/openfoam211/src/OpenFOAM/lnInclude/edgeList.H:32,
from /opt/openfoam211/src/OpenFOAM/lnInclude/PrimitivePatch.H:56,
from /opt/openfoam211/src/OpenFOAM/lnInclude/primitivePatch.H:35,
from /opt/openfoam211/src/OpenFOAM/lnInclude/polyPatch.H:43,
from /opt/openfoam211/src/finiteVolume/lnInclude/fvPatch.H:39,
from /opt/openfoam211/src/finiteVolume/lnInclude/fvPatchField.H:47,
from /opt/openfoam211/src/finiteVolume/lnInclude/fvPatchFields.H:29,
from myFluxFvPatchScalarField.H:39,
from myFluxFvPatchScalarField.C:26:
/opt/openfoam211/src/OpenFOAM/lnInclude/FieldFunctions.C: In function ‘void Foam::subtract(Foam::Field<typename Foam::typeOfSum<Type1, Type2>::type>&, const Foam::UList<T>&, const Foam::UList<Key>&) [with Type1 = double, Type2 = Foam::Vector<double>, typename Foam::typeOfSum<Type1, Type2>::type = double]’:
/opt/openfoam211/src/OpenFOAM/lnInclude/FieldFunctions.C:700:1: instantiated from ‘Foam::tmp<Foam::Field<typename Foam::typeOfSum<Type1, Type2>::type> > Foamoperator-(const Foam::tmp<Foam::Field<Type> >&, const Foam::tmp<Foam::Field<Type2> >&) [with Type1 = double, Type2 = Foam::Vector<double>, typename Foam::typeOfSum<Type1, Type2>::type = double]’
myFluxFvPatchScalarField.C:185:65: instantiated from here
/opt/openfoam211/src/OpenFOAM/lnInclude/FieldFunctions.C:700:1: error: no match for ‘operator-’ in ‘*(f2P ++) - *(f3P ++)’
/opt/openfoam211/src/OpenFOAM/lnInclude/scalarField.H:78:1: note: candidates are: Foam::tmp<Foam::Field<double> > Foamoperator-(const Foam::scalar&, const Foam::UList<double>&)
/opt/openfoam211/src/OpenFOAM/lnInclude/scalarField.H:78:1: note: Foam::tmp<Foam::Field<double> > Foamoperator-(const Foam::scalar&, const Foam::tmp<Foam::Field<double> >&)
/opt/openfoam211/src/OpenFOAM/lnInclude/scalarField.H:78:1: note: Foam::tmp<Foam::Field<double> > Foamoperator-(const Foam::UList<double>&, const Foam::scalar&)
/opt/openfoam211/src/OpenFOAM/lnInclude/scalarField.H:78:1: note: Foam::tmp<Foam::Field<double> > Foamoperator-(const Foam::tmp<Foam::Field<double> >&, const Foam::scalar&)
/opt/openfoam211/src/OpenFOAM/lnInclude/labelField.H:54:1: note: Foam::tmp<Foam::Field<int> > Foamoperator-(const Foam::label&, const Foam::UList<int>&)
/opt/openfoam211/src/OpenFOAM/lnInclude/labelField.H:54:1: note: Foam::tmp<Foam::Field<int> > Foamoperator-(const Foam::label&, const Foam::tmp<Foam::Field<int> >&)
/opt/openfoam211/src/OpenFOAM/lnInclude/labelField.H:54:1: note: Foam::tmp<Foam::Field<int> > Foamoperator-(const Foam::UList<int>&, const Foam::label&)
/opt/openfoam211/src/OpenFOAM/lnInclude/labelField.H:54:1: note: Foam::tmp<Foam::Field<int> > Foamoperator-(const Foam::tmp<Foam::Field<int> >&, const Foam::label&)
/opt/openfoam211/src/OpenFOAM/lnInclude/dimensionSet.H:255:29: note: Foam::dimensionSet Foamoperator-(const Foam::dimensionSet&)
/opt/openfoam211/src/OpenFOAM/lnInclude/dimensionSet.H:263:29: note: Foam::dimensionSet Foamoperator-(const Foam::dimensionSet&, const Foam::dimensionSet&)
/opt/openfoam211/src/OpenFOAM/lnInclude/dimensionedScalar.H:52:19: note: Foam::dimensionedScalar Foamoperator-(const Foam::dimensionedScalar&, Foam::scalar)
/opt/openfoam211/src/OpenFOAM/lnInclude/dimensionedScalar.H:53:19: note: Foam::dimensionedScalar Foamoperator-(Foam::scalar, const Foam::dimensionedScalar&)
/opt/openfoam211/src/OpenFOAM/lnInclude/diagTensorField.H:61:1: note: Foam::tmp<Foam::Field<Foam::Tensor<double> > > Foamoperator-(const Foam::UList<Foam:iagTensor<double> >&, const Foam::UList<Foam::Tensor<double> >&)
/opt/openfoam211/src/OpenFOAM/lnInclude/diagTensorField.H:61:1: note: Foam::tmp<Foam::Field<Foam::Tensor<double> > > Foamoperator-(const Foam::UList<Foam:iagTensor<double> >&, const Foam::tmp<Foam::Field<Foam::Tensor<double> > >&)
/opt/openfoam211/src/OpenFOAM/lnInclude/diagTensorField.H:61:1: note: Foam::tmp<Foam::Field<Foam::Tensor<double> > > Foamoperator-(const Foam::tmp<Foam::Field<Foam:iagTensor<double> > >&, const Foam::UList<Foam::Tensor<double> >&)
/opt/openfoam211/src/OpenFOAM/lnInclude/diagTensorField.H:61:1: note: Foam::tmp<Foam::Field<Foam::Tensor<double> > > Foamoperator-(const Foam::tmp<Foam::Field<Foam:iagTensor<double> > >&, const Foam::tmp<Foam::Field<Foam::Tensor<double> > >&)
/opt/openfoam211/src/OpenFOAM/lnInclude/diagTensorField.H:64:1: note: Foam::tmp<Foam::Field<Foam::Tensor<double> > > Foamoperator-(const Foam::diagTensor&, const Foam::UList<Foam::Tensor<double> >&)
/opt/openfoam211/src/OpenFOAM/lnInclude/diagTensorField.H:64:1: note: Foam::tmp<Foam::Field<Foam::Tensor<double> > > Foamoperator-(const Foam::diagTensor&, const Foam::tmp<Foam::Field<Foam::Tensor<double> > >&)
/opt/openfoam211/src/OpenFOAM/lnInclude/diagTensorField.H:64:1: note: Foam::tmp<Foam::Field<Foam::Tensor<double> > > Foamoperator-(const Foam::UList<Foam:iagTensor<double> >&, const Foam::tensor&)
/opt/openfoam211/src/OpenFOAM/lnInclude/diagTensorField.H:64:1: note: Foam::tmp<Foam::Field<Foam::Tensor<double> > > Foamoperator-(const Foam::tmp<Foam::Field<Foam:iagTensor<double> > >&, const Foam::tensor&)
/opt/openfoam211/src/OpenFOAM/lnInclude/vectorTensorTransformI.H:283:36: note: Foam::vectorTensorTransform Foamoperator-(const Foam::vectorTensorTransform&, const Foam::vector&)
/opt/openfoam211/src/OpenFOAM/lnInclude/quaternionI.H:273:25: note: Foam::quaternion Foamoperator-(const Foam::quaternion&)
/opt/openfoam211/src/OpenFOAM/lnInclude/quaternionI.H:279:25: note: Foam::quaternion Foamoperator-(const Foam::quaternion&, const Foam::quaternion&)
/opt/openfoam211/src/OpenFOAM/lnInclude/septernionI.H:190:25: note: Foam::septernion Foamoperator-(const Foam::septernion&, const Foam::vector&)
make: *** [Make/linuxGccDPOpt/myFluxFvPatchScalarField.o] Error 1



please suggest me what will be the error.

Thanks
Regards
Mallikarjuna

Last edited by mmkr825; September 13, 2012 at 03:29.
mmkr825 is offline   Reply With Quote

Old   May 31, 2016, 09:20
Default
  #8
Member
 
Lennart
Join Date: Feb 2016
Posts: 46
Rep Power: 10
elmo555 is on a distinguished road
Quote:
Originally Posted by mmkr825 View Post
/opt/openfoam211/src/OpenFOAM/lnInclude/FieldFunctions.C:700:1: error: no match for ‘operator-’ in ‘*(f2P ++) - *(f3P ++)’
I'm getting the same error, can anybody explain?

The line of code is
Code:
surfaceVectorField Uf_gamma(Uf-mDotVoluf*nHatf*mesh.delta()*(scalar(1)/rho2-scalar(1)/rho1));
with Uf and nHatf as surfaceVectorField, mDotVoluf as surfaceScalarField and rho1 and rho2 as dimensionedScalar.

EDIT:
I found the problem, my mistake was to assume mesh.delta() to be a scalar, although it's a vector. Using mag(mesh.delta()) did the trick.
elmo555 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
grid study, important question hamid1 FLUENT 1 August 4, 2013 01:14
[ANSYS Meshing] grid study, important questions hamid1 ANSYS Meshing & Geometry 2 February 10, 2012 14:28
Loop outlet data to inlet of new study pggow FLUENT 0 December 21, 2011 15:31
error problems between experimental and numerical study d118i Main CFD Forum 0 June 13, 2010 11:50
Study Mario Main CFD Forum 0 August 24, 2009 10:59


All times are GMT -4. The time now is 22:17.