CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Running, Solving & CFD

Scalartransportfoam

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

Reply
 
LinkBack Thread Tools Display Modes
Old   April 29, 2008, 05:46
Default sorry for my stupid question..
  #1
Member
 
Vivien
Join Date: Mar 2009
Posts: 52
Rep Power: 8
sunnysun is on a distinguished road
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?
sunnysun is offline   Reply With Quote

Old   April 29, 2008, 05:51
Default Hi Vivien As far as I under
  #2
Senior Member
 
Join Date: Mar 2009
Posts: 248
Rep Power: 9
jaswi is on a distinguished road
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
jaswi is offline   Reply With Quote

Old   April 29, 2008, 06:09
Default Hi, Jaswinder, Thanks for you
  #3
Member
 
Vivien
Join Date: Mar 2009
Posts: 52
Rep Power: 8
sunnysun is on a distinguished road
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...
sunnysun is offline   Reply With Quote

Old   April 29, 2008, 06:18
Default I can post it for you but i su
  #4
Senior Member
 
Join Date: Mar 2009
Posts: 248
Rep Power: 9
jaswi is on a distinguished road
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
jaswi is offline   Reply With Quote

Old   April 29, 2008, 07:43
Default Hi, Jaswi, I will follow yo
  #5
Member
 
Vivien
Join Date: Mar 2009
Posts: 52
Rep Power: 8
sunnysun is on a distinguished road
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
sunnysun is offline   Reply With Quote

Old   April 29, 2008, 07:54
Default Hi Viven If you need to do
  #6
Senior Member
 
Join Date: Mar 2009
Posts: 248
Rep Power: 9
jaswi is on a distinguished road
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
jaswi is offline   Reply With Quote

Old   April 29, 2008, 09:03
Default Hi,Jaswi, I know it is a sill
  #7
Member
 
Vivien
Join Date: Mar 2009
Posts: 52
Rep Power: 8
sunnysun is on a distinguished road
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
sunnysun is offline   Reply With Quote

Old   April 29, 2008, 09:42
Default Hi Vivien It can be found t
  #8
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Rotterdam, The Netherlands
Posts: 1,595
Rep Power: 24
ngj will become famous soon enoughngj will become famous soon enough
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.
ngj is offline   Reply With Quote

Old   April 29, 2008, 09:45
Default Hi Vivien No question is si
  #9
Senior Member
 
Join Date: Mar 2009
Posts: 248
Rep Power: 9
jaswi is on a distinguished road
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
jaswi is offline   Reply With Quote

Old   April 29, 2008, 09:57
Default If there is only a 'bin' file
  #10
Member
 
Vivien
Join Date: Mar 2009
Posts: 52
Rep Power: 8
sunnysun is on a distinguished road
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?
sunnysun is offline   Reply With Quote

Old   April 29, 2008, 10:10
Default Well I am afraid to say that y
  #11
Senior Member
 
Join Date: Mar 2009
Posts: 248
Rep Power: 9
jaswi is on a distinguished road
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
jaswi is offline   Reply With Quote

Old   April 30, 2008, 06:09
Default Hi, Jaswi, i found the source
  #12
Member
 
Vivien
Join Date: Mar 2009
Posts: 52
Rep Power: 8
sunnysun is on a distinguished road
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
sunnysun is offline   Reply With Quote

Old   April 30, 2008, 06:16
Default Hi Vivien its very difficul
  #13
Senior Member
 
Join Date: Mar 2009
Posts: 248
Rep Power: 9
jaswi is on a distinguished road
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
jaswi is offline   Reply With Quote

Old   April 30, 2008, 10:55
Default Hi, Jaswi,I already sent the f
  #14
Member
 
Vivien
Join Date: Mar 2009
Posts: 52
Rep Power: 8
sunnysun is on a distinguished road
Hi, Jaswi,I already sent the files to your email, pleae have a look!

Many many thanks!

Best wishes,

Vivien
sunnysun is offline   Reply With Quote

Old   May 13, 2009, 11:44
Default Hello
  #15
Member
 
Jagmohan Meena
Join Date: May 2009
Posts: 30
Rep Power: 8
jmmeena is on a distinguished road
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 04:54.
jmmeena is offline   Reply With Quote

Old   May 15, 2009, 05:59
Default
  #16
Member
 
Jagmohan Meena
Join Date: May 2009
Posts: 30
Rep Power: 8
jmmeena is on a distinguished road
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
jmmeena is offline   Reply With Quote

Old   May 15, 2009, 07:16
Default
  #17
Senior Member
 
su_junwei's Avatar
 
su junwei
Join Date: Mar 2009
Location: Xi'an China
Posts: 151
Rep Power: 10
su_junwei is on a distinguished road
Send a message via MSN to su_junwei
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
su_junwei is offline   Reply With Quote

Old   May 16, 2009, 06:16
Smile
  #18
Member
 
Jagmohan Meena
Join Date: May 2009
Posts: 30
Rep Power: 8
jmmeena is on a distinguished road
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
jmmeena is offline   Reply With Quote

Old   May 16, 2009, 06:18
Default
  #19
Member
 
Jagmohan Meena
Join Date: May 2009
Posts: 30
Rep Power: 8
jmmeena is on a distinguished road
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 06:46.
jmmeena is offline   Reply With Quote

Old   May 16, 2009, 15:02
Default
  #20
Senior Member
 
su_junwei's Avatar
 
su junwei
Join Date: Mar 2009
Location: Xi'an China
Posts: 151
Rep Power: 10
su_junwei is on a distinguished road
Send a message via MSN to su_junwei
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
su_junwei 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
ScalarTransportFoam and turbulent diffusion coefficient rybakov2 OpenFOAM Running, Solving & CFD 2 June 24, 2014 14:21


All times are GMT -4. The time now is 02:49.