CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   time derivative of laplacian (https://www.cfd-online.com/Forums/openfoam-programming-development/229254-time-derivative-laplacian.html)

nikitin-pro August 2, 2020 04:46

time derivative of laplacian
 
I have a function I can't implement:
\frac{\partial(c\alpha\Delta T)}{\partial t}

a -- is a constant in [m2/s], which I defined via external dictionary (lookup)
c -- is a constant in [s], which I defined via external dictionary (lookup)
T -- is temperature in [K]

Laplacian of T should yield [K/m2] and c\alpha\Delta T should yield [K], which is a scalar field. I can't understand why I can't get a time derivative from it.

I've tried
fvm::ddt(c * fvm::laplacian(a,T)), but got an error: no matching function for call to ‘Foam::GeometricField::GeometricField(Foam::tmp >)’

Santiago August 2, 2020 16:06

Quote:

Originally Posted by nikitin-pro (Post 779353)
I have a function I can't implement:
\frac{\partial(c\alpha\Delta T)}{\partial t}

a -- is a constant in [m2/s], which I defined via external dictionary (lookup)
c -- is a constant in [s], which I defined via external dictionary (lookup)
T -- is temperature in [K]

Laplacian of T should yield [K/m2] and c\alpha\Delta T should yield [K], which is a scalar field. I can't understand why I can't get a time derivative from it.

I've tried
fvm::ddt(c * fvm::laplacian(a,T)), but got an error: no matching function for call to ‘Foam::GeometricField::GeometricField(Foam::tmp >)’

Assuming that your interpretation of the term you show is correct, which i think is not, you're trying to project in time a linear system of equations (laplacian). In other words, a linear system of a linear system... What you want is:

fvm::ddt(fvc::laplacian(...

Coming to your interpretation problem, you are mixing mathematical notations. The leibniz notation (d/dt) with the vector (nabla, delta) notation for derivatives. Im betting the Delta T in the term above means "temperature difference", not "second order derivative of..."'

nikitin-pro August 2, 2020 16:22

Interesting thing:compiles OK:
volScalarField lap(c * fvc::laplacian(a,T));
fvScalarMatrix TEqn (fvm::ddt(T) - fvm::ddt(lap) - fvm::laplacian(a,T) == 0);
but solution fails with the following error:
incompatible fields for operation
[T] - [(c*laplacian(a,T))]



compilation error (no matching function for call to ‘ddt(Foam::tmp >)’):
fvScalarMatrix TEqn (fvm::ddt(T) - fvm::ddt(c * fvc::laplacian(a,T))) - fvm::laplacian(a,T) == 0);

-----------------------------------
As for notation: This is a part of modified Fourier equation:
\frac{\partial}{\partial t}(T-ca\Delta T) = a\Delta T
where a -- thermal diffusivity [m2/s]


if one set c=0 s, then will get simple heat equation

mAlletto August 3, 2020 15:21

did you try:


fvc::ddt(c * fvc::laplacian(a,T)))


I think there is no implicit operator implement in openfaom for what you want to do

nikitin-pro August 3, 2020 15:35

I did.. same error.
a somewhat solution is that
c * fvc::laplacian(a,fvc::ddt(T)) or c * fvc::ddt(volScalarField("lap",fvc::laplacian(a,T)) )


Both compile ok and simulation runs well, but this term doesn't affect solution at all. Seems like ca\Delta\frac{\partial T}{\partial t}=0


All times are GMT -4. The time now is 11:56.