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

Question about scalar transport

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 18, 2008, 08:29
Default I must admit I did not see tha
  #21
Senior Member
 
dmoroian's Avatar
 
Dragos
Join Date: Mar 2009
Posts: 648
Rep Power: 20
dmoroian is on a distinguished road
I must admit I did not see that C was a volVectorField. I don't understand how do you want to use this vector as a scalar, though.
As I understand, you want to track 2 scalars. Then, why don't you use 2 scalar transport equations for that?

Dragos
dmoroian is offline   Reply With Quote

Old   April 25, 2008, 07:25
Default Hi Dragos, i have a new probl
  #22
Member
 
davey david
Join Date: Mar 2009
Posts: 54
Rep Power: 17
suredross is on a distinguished road
Hi Dragos,
i have a new problem;how do i modify the navier stokes equation in the code to reflect dimensionless variables?the previuos issue has been resolved,thanks for your help.



davey
suredross is offline   Reply With Quote

Old   April 28, 2008, 03:19
Default Hi Davey My quess would be,
  #23
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37
ngj will become famous soon enoughngj will become famous soon enough
Hi Davey

My quess would be, that it is not straight forward to do so. The dimensions of your velocity and pressure fields are easily set to 0 in the /0/-directory.
A quick look into e.g. Foam::Time in Doxygen shows that you cannot set the dimensions on time through the constructors (and therefor probably not on the mesh either). This results in a ddt of a dimensionless field which obvious will have s^{-1}. On the other hand grad(p) is m^{-1} thus a mismatch in dimensions and OF will return an error.
My conclusion is that it is not possible to make an implementation of the dimensionless equations in OF, except of course you defined the length, mass and time scale and write down the equations using those, but then I would prefer using the implementation as it is and do the dimensionless calculation on a piece of paper to figure out the initial condition to reflect the values of your non-dimensional quantities.

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, 07:10
Default Hi Niels, i did as you said a
  #24
Member
 
davey david
Join Date: Mar 2009
Posts: 54
Rep Power: 17
suredross is on a distinguished road
Hi Niels,
i did as you said and have now got my equations.however there is a new problem;i need to add the laplace equation to my solver because i need to solve for electric potential(fields) in particular regions of my mesh.i tried doing it as before(i.e like adding a source term to a code)but i am getting error messages all the while.can you please help out here?

thanks in advance

davey
suredross is offline   Reply With Quote

Old   April 29, 2008, 07:42
Default Hi Davey You need to elabor
  #25
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37
ngj will become famous soon enoughngj will become famous soon enough
Hi Davey

You need to elaborate a little bit on that. I am not into electric field, so please correct me if I am wrong, but aren't the equations for the electric field quite similar to those in potentialFoam? You might find inspiration there.

- 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 30, 2008, 05:31
Default Hi, in running my solver(modi
  #26
Member
 
davey david
Join Date: Mar 2009
Posts: 54
Rep Power: 17
suredross is on a distinguished road
Hi,
in running my solver(modified icofoam),i am hit with this error message:

--> FOAM FATAL ERROR : incompatible dimensions for operation
[U[0 1 -2 0 0 0 0] ] - [U[0 -1 -1 0 0 0 0] ]#0 Foam::error::printStack(Foam:stream&) in "/home/cfd/OpenFOAM/OpenFOAM-1.4.1/lib/linuxGccDPOpt/libOpenFOAM.so"
#1 Foam::error::abort() in "/home/cfd/OpenFOAM/OpenFOAM-1.4.1/lib/linuxGccDPOpt/libOpenFOAM.so"
#2 void Foam::checkMethod<foam::vector<double> >(Foam::fvMatrix<foam::vector<double> > const&, Foam::fvMatrix<foam::vector<double> > const&, char const*) in "/home/cfd/OpenFOAM/OpenFOAM-1.4.1/applications/bin/linuxGccDPOpt/junctionFoam"
#3 Foam::tmp<foam::fvmatrix<foam::vector<double> > > Foam::operator-<foam::vector<double> >(Foam::tmp<foam::fvmatrix<foam::vector<double> > > const&, Foam::tmp<foam::fvmatrix<foam::vector<double> > > const&) in "/home/cfd/OpenFOAM/OpenFOAM-1.4.1/applications/bin/linuxGccDPOpt/junctionFoam"
#4 main in "/home/cfd/OpenFOAM/OpenFOAM-1.4.1/applications/bin/linuxGccDPOpt/junctionFoam"
#5 __libc_start_main in "/lib/libc.so.6"
#6 Foam::regIOobject::readIfModified() in "/home/cfd/OpenFOAM/OpenFOAM-1.4.1/applications/bin/linuxGccDPOpt/junctionFoam"


From function checkMethod(const fvMatrix<type>&, const fvMatrix<type>&)
in file /home/cfd/OpenFOAM/OpenFOAM-1.4.1/src/finiteVolume/lnInclude/fvMatrix.C at line 1208.

FOAM aborting
any body who can help?

many thanks

davey
suredross is offline   Reply With Quote

Old   April 30, 2008, 07:24
Default The Dimensions of the operands
  #27
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
The Dimensions of the operands do not fit (have a look at the programmers guide chapter 1.5 and discussions about "incompatible dimensions for operation" elsewhere on the board).

The first operand (basically [(m/s)/s]) looks OK for the velocity equation. The second one is missing m^2/s (propably in your nu)
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   August 12, 2008, 07:39
Default In my diploma thesis I simulat
  #28
New Member
 
Apanasevich, Pavel
Join Date: Mar 2009
Location: Bremen, Germany
Posts: 2
Rep Power: 0
pavel is on a distinguished road
In my diploma thesis I simulate the mixing process in a T-shaped micro-mixer (width 200&mu;m, height 100&mu;m). The flow is laminar (steady-state) thus I am using the simpleFoam solver and I've added the scalar transport equation
fvm::ddt(C) + fvm::div (phi,C) &ndash;fvm::laplacian(DC,C)
in the solver in order to solve the species equation and calculate the concentration field in the mixer.

The scalar is released at the inlet 2 (C=1), and at the inlet 1 (C=0, dimensionless) there is no scalar. The boundary condition for the velocity is a parabolic velocity profile (Umax = 3.29m/s at the Inlet 1 und -3.29 m/s at the Inlet 2). At the outlet I am using zeroGradient for velocity und fixedValue (0) for p (pressure). The cells size is 4&mu;m - 4&mu;m - 4&mu;m (hex-cells).

The problem is the following: the calculated concentration must be between 0 and 1 but I receive values from -0.16 until 1.16.

I've tried the following steps:
1) div (phi,U) Gauss limitedLinearV 1.0;
div (phi,C) Gauss limitedLinear 1.0;
laplacian (DC,C) Gauss linear corrected;

Result: C = -0.153 &ndash; 1.08, but the physical sense of mixing is not correct (compared to simulation results using CFD-ACE+ and experimental results)



2) div (phi,U) Gauss linear;UpwindV Gauss;
div (phi,C) Gauss Gamma01 1 Gauss;
laplacian (DC,C) Gauss linear limited 1.0;

Result: C = -0.17 &ndash; 1.07, the physical sense of mixing is better than 1) but is not correct too.

3) div (phi,U) Gauss linearUpwindV Gauss;
div (phi,C) Gauss linearUpwind Gauss;
laplacian (DC,C) Gauss linear corrected;

Result: C = -0.157 &ndash; 1.16, the physical sense of mixing is correct (compared to simulation results using CFD-ACE+ and experimental results) but C is not between 1 and 0

fvSolution file for all cases:
&hellip;
C PBiCG
{ tolerance 1e-06;
relTol 0;
preconditioner DILU;
};
&hellip;
RelaxationFactors
P 0.3;
U 0.7;
C 0.7;
&hellip;
fvSchemes:
&hellip;
fluxRequiment
{ default no;
P;
C; (here I've tried with and without C -ïƒ* I cannot see any difference)

How can I improve my results from approach #3, so that my concentration is in the boundaries between 1 and 0?

Thanks in advance ,
Pavel
pavel is offline   Reply With Quote

Old   September 16, 2008, 08:07
Default hello, i am simulating the fl
  #29
Member
 
davey david
Join Date: Mar 2009
Posts: 54
Rep Power: 17
suredross is on a distinguished road
hello,
i am simulating the flow and mixing effects in a rectangular channel(pure EOF). i introduce a scalar transport equation to see the mixing effects,thus
fvm::ddt(C) + fvm::div (phi,C)&ndash;fvm::laplacian(DC,C)
i have set the concentration in one half of my mesh to 1 and 0 in the other(used setfields,because of periodicity of the channel).this implies no inlet/outlet.the velocity values from steady state flow are used as the initial velocity conditions. unfortunately i cant see the convective mixing in paraview??
can i anybody help,please!??
suredross is offline   Reply With Quote

Old   September 16, 2008, 10:45
Default hello! I am new on the openfo
  #30
New Member
 
Hansjoerg Seybold
Join Date: Mar 2009
Posts: 15
Rep Power: 17
hansjoerg is on a distinguished road
hello!
I am new on the openfoam message board.
I have a question related to the scalartransportfoam. I calculated a solution of steady state NS in a complex geometry. Now i would like to solve the heat transport (scalartransport is exactly what i need.) how can i import the fluent Mesh and Velocity field to openfoam?
thanks a lot
hansjoerg
hansjoerg is offline   Reply With Quote

Old   September 16, 2008, 11:45
Default fluentMeshToFoam fluent3DMesh
  #31
Senior Member
 
Gavin Tabor
Join Date: Mar 2009
Posts: 181
Rep Power: 17
grtabor is on a distinguished road
fluentMeshToFoam
fluent3DMeshToFoam
gambitMeshToFoam

- all do exactly what they say on the tin, so to speak. Why do you need to import a velocity field though - you can calculate that as part of the solution, surely?

Gavin
grtabor is offline   Reply With Quote

Old   September 16, 2008, 13:44
Default Thanks Gavin, i have a fluent
  #32
New Member
 
Hansjoerg Seybold
Join Date: Mar 2009
Posts: 15
Rep Power: 17
hansjoerg is on a distinguished road
Thanks Gavin,
i have a fluent solution for the steady state NS already and i think fluent3DMeshToFoam only convert the mesh without the velocity values.
I read about ensightToFoam to import mesh and values. is this true?
thanks hj
hansjoerg is offline   Reply With Quote

Old   August 23, 2014, 01:07
Default
  #33
New Member
 
Jonas L. Ansoni
Join Date: Jun 2011
Location: Brazil
Posts: 22
Rep Power: 14
Jonas Ansoni is on a distinguished road
Quote:
Originally Posted by jerome View Post
Hello,

The scalar that is transported is a mass. However, I noticed that sometimes, I obtain small negative values at some cell centres. Is there any way to avoid that? Would it be possible to inform the solver that only positive values are expected?

I tried to use other numerical schemes for that but it did not change anything. Is there any interpolation, laplacian or divergence schemes that I can use to obtain a positive and conservative scalar?

Thank you very much

Jerome
Hi!

I'm simulating the transport of a passive scarlar (C) in a biphasic flow by interDyFoam and monitoring the value of C in specified points by probes.

I created a new solver based on interDyFoam (interDyMScalarFoam.C) as can seen on the attached files. The solver works, however I've obtained negative values in the C probes points (pontoMonitTracer_C). Jerome reported a similar problem on post #12.

I tried to use other numerical schemes such as suggested by Jasak on post #13, but without success.

Does anyone have any suggestion?

Link to download the files (interDyMScalarFoam.C, C, fvSchemes, fvSolutions)
https://dl.dropboxusercontent.com/u/...onForum.tar.gz


Thanks in advance!
Jonas Ansoni is offline   Reply With Quote

Old   August 21, 2020, 10:45
Default recirculating scalar
  #34
Member
 
Rosario Arnau
Join Date: Feb 2017
Location: Spain
Posts: 57
Rep Power: 9
rarnaunot is on a distinguished road
Hi foamers,

I know this is an old post but I have a question about scalars/concentration at scalarTransportFoam solver. I'have seen that there are some experts at this threat so hope one of you can help me:

In my case I have two inlets (Inlet 1 and RecirculationInt) and two outlets (Outlet and RecirculationOutlet).

The flow enters the domain by the Inlet and exits through Outlet but, the flow that enters through Inlet and RecirculationInlet exits the domain through RecirculationOutlet so that the flows going in and out are:

Inlet Flow= Q1 +Q2
RecirculationInlet= Q3
Outlet= -Q1
RecirculationOutlet= -(Q2+Q3)

Now I need to introduce an scalar so that the concentration that goes out through RecirculationOutlet need to enter again in the domain in order to avoid lossing my scalar concentration.

I'm able to calculate the surface concentration of the patch throughout:

Code:
{
Recirc_T
        {

            type            surfaceFieldValue;
            operation       areaIntegrate;
            libs ("libfieldFunctionObjects.so");
            writeArea       yes;
            regionType      patch;
            surfaceFormat   foam;
            name            RecirculationOutlet;
            enabled         true;
            writeControl   writeTime;
            //writeControl   timeStep; //Output every timestep
            //writeInterval   1; //Cada timestep, guarda valor
            valueOutput     true;
            log             false;
            writeFields     no;
            fields          
            ( T)
}
But this is just for post-processing. Does anybody know how to do this?

Thanks!
rarnaunot 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
Passive scalar transport novyno OpenFOAM Running, Solving & CFD 10 May 5, 2016 13:31
Scalar transport Sanchit CFX 0 September 29, 2008 07:46
Negative scalar transport diegon OpenFOAM Running, Solving & CFD 0 December 1, 2006 08:30
Steady scalar transport heather OpenFOAM Running, Solving & CFD 2 August 31, 2005 08:44
Scalar Transport Equations 123 Main CFD Forum 6 August 10, 1998 09:05


All times are GMT -4. The time now is 06:50.