|
[Sponsors] |
April 29, 2008, 06:46 |
sorry for my stupid question..
|
#1 |
Member
Vivien
Join Date: Mar 2009
Posts: 52
Rep Power: 17 |
sorry for my stupid question...as I am new to CFD and openfoam...
I would like to simulate the spreading of contrast agent in a tube. My idea is to use icofoam to obtain the velocity and then pass the velocity to scalartransportfoam, may i know how to get the concentration of contrast agent in each cell? |
|
April 29, 2008, 06:51 |
Hi Vivien
As far as I under
|
#2 |
Senior Member
Join Date: Mar 2009
Posts: 248
Rep Power: 18 |
Hi Vivien
As far as I understand the concentration of contrast agent is a some kind of field, perhaps a volume scalar field which means you have that scalar stored at each cell centre. If that guess is correct then you can easily create the field as an IOobject and use it for your purpose. Hope that helps, Cheers Jaswinder |
|
April 29, 2008, 07:09 |
Hi, Jaswinder,
Thanks for you
|
#3 |
Member
Vivien
Join Date: Mar 2009
Posts: 52
Rep Power: 17 |
Hi, Jaswinder,
Thanks for your idea.the contrast agent concentration is volume scalar field. But can you let me know more about how to creat the IOobject...this is the second day i use this software... |
|
April 29, 2008, 07:18 |
I can post it for you but i su
|
#4 |
Senior Member
Join Date: Mar 2009
Posts: 248
Rep Power: 18 |
I can post it for you but i suggest you
Look into the createFields.H of icoFoam solver. All the fields you are using are created as an IOobject and if you will try on your own a little bit, you will be able to help other newcomers :-) Warm Regards Jaswi |
|
April 29, 2008, 08:43 |
Hi, Jaswi,
I will follow yo
|
#5 |
Member
Vivien
Join Date: Mar 2009
Posts: 52
Rep Power: 17 |
Hi, Jaswi,
I will follow your advice~~~ BTW, if I understand correctly, I can import the velocity field at the endtime of icofoam to scalartransportfoam in the case when flow is steady. but what if the velocity is periodically changing? Many thanks!! vivien |
|
April 29, 2008, 08:54 |
Hi Viven
If you need to do
|
#6 |
Senior Member
Join Date: Mar 2009
Posts: 248
Rep Power: 18 |
Hi Viven
If you need to do a scalartransport for a periodically changing velocity field then may be you want to couple the two solvers or better say combine them. Its should not be very difficult. Solve the scalar transport equation after you have solved for the velocity using icoFoam. just include that equation into your main solver and solve it with the updated phi. Take a look at the turbFoam solver. It solves the turbulence equation by making a call turbulence->correct();. In the same way you can solve your scalartransport equation at this point . Give it a try and let the error messages flow to forum :-) Hope that helps Jaswi |
|
April 29, 2008, 10:03 |
Hi,Jaswi,
I know it is a sill
|
#7 |
Member
Vivien
Join Date: Mar 2009
Posts: 52
Rep Power: 17 |
Hi,Jaswi,
I know it is a silly question...but may i know where can i find this createFields.H ??I can not find it in icofoam tutorial... vivien |
|
April 29, 2008, 10:42 |
Hi Vivien
It can be found t
|
#8 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37 |
Hi Vivien
It can be found together with the source code in: ~/OpenFOAM/OpenFOAM-1.4.1/applications/solvers/incompressible/icoFoam Best regards, Niels
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request. |
|
April 29, 2008, 10:45 |
Hi Vivien
No question is si
|
#9 |
Senior Member
Join Date: Mar 2009
Posts: 248
Rep Power: 18 |
Hi Vivien
No question is silly as all of them lead to a purposeful answer :-). Find it here: /home/openfoam/OpenFOAM/OpenFOAM-1.4.1/applications/solvers Basically all the solvers live here categorized in their individual directory. under this directory you will find solvers/incompressible/icoFoam and there lives this file. This is what it contains. I have put the horizontal lines so you can see it consists of several blocks of code: ----------------- Info<< "Reading transportProperties\n" << endl; IOdictionary transportProperties ( IOobject ( "transportProperties", runTime.constant(), mesh, IOobject::MUST_READ, IOobject::NO_WRITE ) ); dimensionedScalar nu ( transportProperties.lookup("nu") ); ---------------------------- Info << "Reading field p\n" << endl; volScalarField p ( IOobject ( "p", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh ); ------------------------ Info << "Reading field U\n" << endl; volVectorField U ( IOobject ( "U", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh ); -------------- # include "createPhi.H" -------------- label pRefCell = 0; scalar pRefValue = 0.0; setRefCell(p, mesh.solutionDict().subDict("PISO"), pRefCell, pRefValue); ------------------ Take a look at for instant: volVectorField U ( IOobject ( "U", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh ); Here a volumetric vector field is being created as an IOobject. If you take a closer look at the definition then you will see volVectorField U ( IOobject(), mesh ) implies that a volVectorField named U being created from an IOobject and mesh. Now IOobject takes following aruguments: IOobject ( "U", // name runTime.timeName(), // instance mesh, // not clear to me but its always mesh IOobject::MUST_READ, // read option IOobject::AUTO_WRITE // write option ) Let me know if you have further ?s. i will try to answer as far as I know :-) Regards Jaswi |
|
April 29, 2008, 10:57 |
If there is only a 'bin' file
|
#10 |
Member
Vivien
Join Date: Mar 2009
Posts: 52
Rep Power: 17 |
If there is only a 'bin' file in this directory /home/openfoam/OpenFOAM/OpenFOAM-1.4.1/applications/
, which means, no 'solvers', is it mean there is something wrong with my installation? |
|
April 29, 2008, 11:10 |
Well I am afraid to say that y
|
#11 |
Senior Member
Join Date: Mar 2009
Posts: 248
Rep Power: 18 |
Well I am afraid to say that yes, something is wrong . Please issue the command
foamInstallationTest and see if it goes thru well. Regards Jaswi |
|
April 30, 2008, 07:09 |
Hi, Jaswi, i found the source
|
#12 |
Member
Vivien
Join Date: Mar 2009
Posts: 52
Rep Power: 17 |
Hi, Jaswi, i found the source code...
then i combined the Scalartransportfoam with icofoam ~ the geometry is a cylinder...seems everything ok.. but when i run the simulation, after a while it returns 'floating point exception' ... any idea what is the reason for that? vivien |
|
April 30, 2008, 07:16 |
Hi Vivien
its very difficul
|
#13 |
Senior Member
Join Date: Mar 2009
Posts: 248
Rep Power: 18 |
Hi Vivien
its very difficult to say for me what went wrong. i can only find it out if i have the test case and the solver. send it to me and i can take a look. i have some time free tomorrow. regards jaswi |
|
April 30, 2008, 11:55 |
Hi, Jaswi,I already sent the f
|
#14 |
Member
Vivien
Join Date: Mar 2009
Posts: 52
Rep Power: 17 |
Hi, Jaswi,I already sent the files to your email, pleae have a look!
Many many thanks! Best wishes, Vivien |
|
May 13, 2009, 12:44 |
Hello
|
#15 |
Member
Jagmohan Meena
Join Date: May 2009
Posts: 30
Rep Power: 16 |
I used Uequ.h from BuoyantSimpleFoam in scalarTransportFoam....... Now it will read value of phi or I have to give some other command ??
TIA JM Last edited by jmmeena; May 14, 2009 at 05:54. |
|
May 15, 2009, 06:59 |
|
#16 |
Member
Jagmohan Meena
Join Date: May 2009
Posts: 30
Rep Power: 16 |
Hello
New solver compiled like this: /bin/sh: /usr/lib/OpenFOAM-1.5/wmake/rules/linux64Gcc/wmkdep: not found SOURCE=buoyantTransportSimpleFoamNew.C ; g++ -m64 -Dlinux64 -DDP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -march=opteron -O3 -DNoRepository -ftemplate-depth-40 -I/usr/lib/OpenFOAM-1.5/src/finiteVolume/cfdTools -I/usr/lib/OpenFOAM-1.5/src/finiteVolume/lnInclude -I/usr/lib/OpenFOAM-1.5/src/thermophysicalModels/basic/lnInclude -I/usr/lib/OpenFOAM-1.5/src/turbulenceModels/RAS -IlnInclude -I. -I/usr/lib/OpenFOAM-1.5/src/OpenFOAM/lnInclude -I/usr/lib/OpenFOAM-1.5/src/OSspecific/Unix/lnInclude -fPIC -c $SOURCE -o Make/linux64Gcc/buoyantTransportSimpleFoamNew.o g++ -m64 -Dlinux64 -DDP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -march=opteron -O3 -DNoRepository -ftemplate-depth-40 -I/usr/lib/OpenFOAM-1.5/src/finiteVolume/cfdTools -I/usr/lib/OpenFOAM-1.5/src/finiteVolume/lnInclude -I/usr/lib/OpenFOAM-1.5/src/thermophysicalModels/basic/lnInclude -I/usr/lib/OpenFOAM-1.5/src/turbulenceModels/RAS -IlnInclude -I. -I/usr/lib/OpenFOAM-1.5/src/OpenFOAM/lnInclude -I/usr/lib/OpenFOAM-1.5/src/OSspecific/Unix/lnInclude -fPIC Make/linux64Gcc/buoyantTransportSimpleFoamNew.o -L/usr/lib/OpenFOAM-1.5/lib \ -lfiniteVolume -lmeshTools -lbasicThermophysicalModels -lspecie -lcompressibleRASModels -lOpenFOAM -liberty -ldl -lm -o/home/users/jagmohan//OpenFOAM/jagmohan-1.5/applications/bin/buoyantTransportSimpleFoamNew Please see the 1st line !! Is there any problem in compilation ?? After this I found solver in bin directory and thought it should be okay !! So I tried to use it for one of the cases. Then what it reported is this: jagmohan@biquad:/home/users/jagmohan/OpenFOAM/jagmohan-1.5/run/coude_diffusion_thermal$ buoyantTransportSimpleFoamNew /*---------------------------------------------------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 1.5 | | \\ / A nd | Web: http://www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ Exec : buoyantTransportSimpleFoamNew Date : May 15 2009 Time : 11:44:17 Host : biquad PID : 19369 Case : /home/users/jagmohan/OpenFOAM/jagmohan-1.5/run/coude_diffusion_thermal nProcs : 1 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Create time Create mesh for time = 0 Reading environmentalProperties Reading thermophysical properties Selecting thermodynamics package hThermo<pureMixture<constTransport<specieThermo<hC onstThermo<perfectGas>>>>> Reading field T Reading field W Reading field U Reading transportProperties Reading diffusivity DT Reading diffusivity DW Reading/calculating face flux field phi Creating turbulence model Selecting RAS turbulence model kEpsilon kEpsilonCoeffs { Cmu 0.09; C1 1.44; C2 1.92; C3 0.85; alphah 1; alphak 1; alphaEps 0.76923; } Calculating field g.h Creating field pd Starting time loop Time = 0.01 DILUPBiCG: Solving for Ux, Initial residual = 1, Final residual = 8.03917e-06, No Iterations 4 DILUPBiCG: Solving for Uy, Initial residual = 1, Final residual = 8.25025e-06, No Iterations 4 DILUPBiCG: Solving for Uz, Initial residual = 1, Final residual = 6.78799e-07, No Iterations 5 DILUPBiCG: Solving for h, Initial residual = 1, Final residual = 8.7112e-06, No Iterations 5 DICPCG: Solving for pd, Initial residual = 1, Final residual = 6.39622e-09, No Iterations 404 time step continuity errors : sum local = 2.35897e-11, global = 7.22445e-14, cumulative = 7.22445e-14 rho max/min : 5.28627 0.726473 incompatible dimensions for operation [T[0 0 -1 1 0 0 0] ] + [T[1 -3 -1 1 0 0 0] ]#0 Foam::error:rintStack(Foam::Ostream&) in "/usr/lib/OpenFOAM-1.5/lib/libOpenFOAM.so" #1 Foam::error::abort() in "/usr/lib/OpenFOAM-1.5/lib/libOpenFOAM.so" #2 void Foam::checkMethod<double>(Foam::fvMatrix<double> const&, Foam::fvMatrix<double> const&, char const*) in "/home/users/jagmohan//OpenFOAM/jagmohan-1.5/applications/bin/buoyantTransportSimpleFoamNew" #3 Foam::tmp<Foam::fvMatrix<double> > Foam:perator+<double>(Foam::tmp<Foam::fvMatrix<d ouble> > const&, Foam::tmp<Foam::fvMatrix<double> > const&) in "/home/users/jagmohan//OpenFOAM/jagmohan-1.5/applications/bin/buoyantTransportSimpleFoamNew" #4 main in "/home/users/jagmohan//OpenFOAM/jagmohan-1.5/applications/bin/buoyantTransportSimpleFoamNew" #5 __libc_start_main in "/lib/libc.so.6" #6 _start in "/home/users/jagmohan//OpenFOAM/jagmohan-1.5/applications/bin/buoyantTransportSimpleFoamNew" From function checkMethod(const fvMatrix<Type>&, const fvMatrix<Type>&) in file /usr/lib/OpenFOAM-1.5/src/finiteVolume/lnInclude/fvMatrix.C at line 1184. FOAM aborting Abandon It started solving for U. But I think at scalar transport equation there is some error of dimensions. I have checked it and equation is correct. What I think that dimensions of phi made a problem. But I have no clue how to deal with this. Please help regarding this. I would really be thankful to you. JM |
|
May 15, 2009, 08:16 |
|
#17 |
Senior Member
|
Hi JM
there should be some problem in your equation definition of T. Compile the code in debug mode, and it will tell you the exact place of the error. Junwei |
|
May 16, 2009, 07:16 |
|
#18 |
Member
Jagmohan Meena
Join Date: May 2009
Posts: 30
Rep Power: 16 |
Hi Junwei,
thank you very much for your reply...but compilation was successful...this dimension error came during running the case. Can you tell me wat are the dimensions of phi ?? I think this error is occurred during solving the transport equation for T ! JM |
|
May 16, 2009, 07:18 |
|
#19 |
Member
Jagmohan Meena
Join Date: May 2009
Posts: 30
Rep Power: 16 |
I combined icoFoam and scalarTransportFoam.. combination worked perfectly !! but m still not able to find what is the problem in combination of buoyantSimpleFoam and ScalarTransportFoam !!
plzz tell me how to run a case in debug mode so that I will get exact location of error....or I can post my code if you want. TIA JM Last edited by jmmeena; May 16, 2009 at 07:46. |
|
May 16, 2009, 16:02 |
|
#20 |
Senior Member
|
HI JM
add the following line to EXE_INC -DFULLDEBUG -g -O0 and recompile your solver, and run your application. Note the "\" for the connection of different line of code Junwei |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
ScalarTransportFoam and turbulent diffusion coefficient | rybakov2 | OpenFOAM Running, Solving & CFD | 2 | June 24, 2014 15:21 |