CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Question about scalar transport (https://www.cfd-online.com/Forums/openfoam-solving/58550-question-about-scalar-transport.html)

dmoroian April 18, 2008 08:29

I must admit I did not see tha
 
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

suredross April 25, 2008 07:25

Hi Dragos, i have a new probl
 
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

ngj April 28, 2008 03:19

Hi Davey My quess would be,
 
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

suredross April 29, 2008 07:10

Hi Niels, i did as you said a
 
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

ngj April 29, 2008 07:42

Hi Davey You need to elabor
 
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

suredross April 30, 2008 05:31

Hi, in running my solver(modi
 
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:http://www.cfd-online.com/OpenFOAM_D...part/proud.gifstream&) 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

gschaider April 30, 2008 07:24

The Dimensions of the operands
 
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)

pavel August 12, 2008 07:39

In my diploma thesis I simulat
 
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

suredross September 16, 2008 08:07

hello, i am simulating the fl
 
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!??

hansjoerg September 16, 2008 10:45

hello! I am new on the openfo
 
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

grtabor September 16, 2008 11:45

fluentMeshToFoam fluent3DMesh
 
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

hansjoerg September 16, 2008 13:44

Thanks Gavin, i have a fluent
 
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

Jonas Ansoni August 23, 2014 01:07

Quote:

Originally Posted by jerome (Post 201223)
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!

rarnaunot August 21, 2020 10:45

recirculating scalar
 
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!


All times are GMT -4. The time now is 23:28.