|
[Sponsors] |
modifying laplacianFoam - temperature dependent diffusivity |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
November 17, 2019, 09:32 |
modifying laplacianFoam - temperature dependent diffusivity
|
#1 | ||
New Member
Chris
Join Date: Sep 2017
Posts: 5
Rep Power: 8 |
Dear Foamers,
I try to modify the laplacianFoam solver to account for a variable thermal diffusivity. I found the following three threads: LaplacianFoam with non-constant Diffusion Coefficient Non-constant Diffusion Coefficient Thermal conductivity as function of temperature which deal with this modification. However, I'm not able to implement them. I added the following code to the createFields.H Code:
volScalarField Diff ( IOobject ( "Diff", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE ), mesh, dimensionedScalar("Diff",dimensionSet(0,2,-1,0,0),0.0) ); Code:
while (runTime.loop()) { Diff = 430-0.0785*T; fvScalarMatrix TEqn(-fvm::laplacian(Diff, T)); TEqn.solve(); } Quote:
Code:
--> FOAM FATAL ERROR: LHS and RHS of '-' have different dimensions dimensions : [0 0 0 0 0 0 0] - [0 0 0 1 0 0 0] Since I'm not yet very familiar with openFOAM, I tried a work around by changing the dimension of Diff (to avoid a similar dimension problem) to K and get rid of the constant "430" first. Code:
volScalarField Diff ( IOobject ( "Diff", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE ), mesh, dimensionedScalar("Diff",dimensionSet(0,0,0,1,0),0.0) ); Code:
while (runTime.loop()) { Diff = -0.0785*T; fvScalarMatrix TEqn(-fvm::laplacian(Diff, T)); TEqn.solve(); } Quote:
|
|||
November 17, 2019, 23:00 |
|
#2 |
Senior Member
Mohammad Shakil Ahmmed
Join Date: Oct 2012
Location: AUS
Posts: 137
Rep Power: 14 |
Hi Chris,
If you look at the error message printed by the OpenFOAM, you may figure out why the error is coming. The error in the first line is showing is a "printStack" type, which means that something is calculating wrong, Please check the parameters as well as the boundary conditions you're using for simulations. Then, check the laplacian scheme you used, as the diffusion term is non-linear, you may use the harmonic interpolation, which may help you to simulate. -S |
|
November 18, 2019, 12:08 |
|
#3 | |||
New Member
Chris
Join Date: Sep 2017
Posts: 5
Rep Power: 8 |
Dear Mohammed,
thanks for the hint ! I found the problem. The initial temperature distribution within my domain was set to "zero", Quote:
Quote:
In addition, I checked both, "linear" as well as "harmonic" interpolation scheme for "Diff" and also the solver "Conjugate Gradient" as well as "GaussSeidel". All of them give the same result. But I got another question. In order to get the dimensions of "Diff" right (not the work around with dimension "K" - see above) I would like to know how I can assign the right dimension to the terms within the equation. Quote:
|
||||
October 19, 2021, 07:06 |
|
#4 |
New Member
Jayabrata Dhar
Join Date: Nov 2018
Posts: 17
Rep Power: 7 |
You can name new scalar variables, give them proper dimensions in the transportproperties file, so that Diff has a dimension of thermal diffusivity. This will work well. Or else you have to put dimensionSet to 0 so that OpenFOAM does not check dimensional consistency before running the simulations.
|
|
October 19, 2021, 13:53 |
|
#5 |
Senior Member
Join Date: Sep 2013
Posts: 353
Rep Power: 20 |
Define 430 as a variable with a unit (this is a dimensionedScalar). Something like this with maybe a slightly different syntax.
Code:
dimensionedScalar Tvalue = ("Tvalue", [0 2 -1 0 0 0 0], 430); |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
OpenFOAM Temperature Dependent Viscosity | JR22 | OpenFOAM Running, Solving & CFD | 0 | April 4, 2017 07:45 |
temperature dependent deviation | hebeldebel | STAR-CCM+ | 7 | July 30, 2014 10:44 |
Temperature dependent material properties | stuart230588 | CFX | 1 | November 21, 2013 16:36 |
temperature dependent heat flux | rohinibc | Fluent UDF and Scheme Programming | 0 | December 11, 2012 08:45 |
Time Dependent Temperature Dependent BC Analysis | RP | Main CFD Forum | 1 | March 28, 2008 01:22 |