CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   modify scalarTransportFoam, problems need help (https://www.cfd-online.com/Forums/openfoam/70274-modify-scalartransportfoam-problems-need-help.html)

panda60 November 19, 2009 02:03

modify scalarTransportFoam, problems need help
 
Dear all.
I want to modify the salarTransportFoam to solve another gas concentrate.My diffusion coefficient is changing with turbulence viscosity, so I write code like this:

for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
solve
(
fvm::ddt(Y)
+ fvm::div(phi, Y)
- fvm::laplacian(nut/0.7, Y)
);
}

in creatFields file ,I add a virable :

Info<< "Reading field Y\n" << endl;

volScalarField Y
(
IOobject
(
"Y",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);


but when I run ,it said mistake in fvSchemes in system dirctory:

ddtSchemes
{
default Euler;
}

gradSchemes
{
default Gauss linear;
}

divSchemes
{
default none;
div(phi,Y) Gauss limitedLinear 1;
}

laplacianSchemes
{
default none;
laplacian((nut/0.7), Y) Gauss linear corrected;
}


interpolationSchemes
{
default linear;
}

snGradSchemes
{
default corrected;
}

fluxRequired
{
default no;
Y ;
}

I need help very much. Thank you very much.

panda60 November 19, 2009 20:39

when runing ,it displayed the following mistake:

ill defined primitiveEntry starting at keyword 'laplacian(nut' on line 37 and
ending at line 59.
file:/home/tiger/OpenFOAM/case/system/fvScheme at line 59.
from function primitiveEntry::read Entry(const dictionary&, Istream&)
in file db/dictionary/primeitiveEntry/primitiveEntry IO>C at ling 20
FOAM exiting.


Why this happened.

eelcovv November 20, 2009 04:58

It seems to me that your are not allowed to use operators in the scheme dictionary, so in stead of

laplacian((nut/0.7), Y) Gauss linear corrected ;

you could try

laplacian(nut, Y) Gauss linear corrected ;

Or define a new field kappat=nut/0.7 and use that instead.

Cheers

Eelco

santos November 20, 2009 05:22

I think it will work with
Code:

laplacian((nut|0.7),Y) Gauss linear corrected;
Regards,
Jose Santos

jnally November 20, 2009 15:33

Usually, I would just delete the line you have added (making sure that the default is set to none).

When you run the solver, OpenFOAM will error and tell you that there is no laplacian scheme provided for a calculation which it will define in the output.

If you just copy and paste this into your fvSchemes file and add the Gauss linear corrected after it, it should work.

You can do this for other calculations that you need to provide.

Example output below with the calculation to add to fvSchemes highlighted in bold(for pretty much the same problem):

Courant Number mean: 0.439812 max: 15.7149
Time = 1001



keyword laplacian((DS0+(nut|Sct)),Species0) is undefined in dictionary "/home/jimmer/OpenFOAM/jimmer-1.6/run/indoor2/system/fvSchemes::laplacianSchemes"

file: /home/jimmer/OpenFOAM/jimmer-1.6/run/indoor2/system/fvSchemes::laplacianSchemes from line 42 to line 42.

From function dictionary::lookupEntry(const word&, bool, bool) const
in file db/dictionary/dictionary.C at line 388.

FOAM exiting

panda60 December 3, 2009 00:46

Quote:

Originally Posted by santos (Post 237005)
I think it will work with
Code:

laplacian((nut|0.7),Y) Gauss linear corrected;
Regards,
Jose Santos

Dear Jose Santos:

my case can be run now. But when a little time has been going on , my residual doesn't change at all, and my result is not right compared with experiment data.

DILUPBiCG: Solving for C, Initial residual = 9.99842e-07, Final residual = 9.99842e-07, No Iterations 0
Time = 0.1568

DILUPBiCG: Solving for C, Initial residual = 9.99842e-07, Final residual = 9.99842e-07, No Iterations 0
Time = 0.15685

DILUPBiCG: Solving for C, Initial residual = 9.99842e-07, Final residual = 9.99842e-07, No Iterations 0
Time = 0.1569

DILUPBiCG: Solving for C, Initial residual = 9.99842e-07, Final residual = 9.99842e-07, No Iterations 0
Time = 0.15695

DILUPBiCG: Solving for C, Initial residual = 9.99842e-07, Final residual = 9.99842e-07, No Iterations 0
Time = 0.157

DILUPBiCG: Solving for C, Initial residual = 9.99842e-07, Final residual = 9.99842e-07, No Iterations 0
Time = 0.15705

DILUPBiCG: Solving for C, Initial residual = 9.99842e-07, Final residual = 9.99842e-07, No Iterations 0
Time = 0.1571

DILUPBiCG: Solving for C, Initial residual = 9.99842e-07, Final residual = 9.99842e-07, No Iterations 0
Time = 0.15715

DILUPBiCG: Solving for C, Initial residual = 9.99842e-07, Final residual = 9.99842e-07, No Iterations 0
Time = 0.1572

......................
......................

Could you tell me why this happens .

santos December 3, 2009 05:40

Hi,

Maybe you could elaborate a little more on your problem. What quantities are you comparing with your experimental data?

Regards,
Jose Santos

panda60 December 4, 2009 00:24

Quote:

Originally Posted by santos (Post 238604)
Hi,

Maybe you could elaborate a little more on your problem. What quantities are you comparing with your experimental data?

Regards,
Jose Santos

I am sorry ,it is my mistake. I change residual from 1e-6 to 1e-10 , now the simulation is going on . Thank you for your kind hearted.

sanjibdsharma December 4, 2009 13:30

Hi All,

If I want to solve 10 scalars (non-reactive species), which changes the effective density or viscosity of the solution as they get mixed in a reactor, how do I do that ?

Also, if I want to include reactions with the associated scalars, how do I do that ?

Please suggest. This is a very important problem I am currently stuck with.

Best regards,

Sanjib


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