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/)
-   -   Second Partial Derivative Source term in OF (https://www.cfd-online.com/Forums/openfoam-solving/198446-second-partial-derivative-source-term.html)

Tempest February 6, 2018 23:06

Second Partial Derivative Source term in OF
 
1 Attachment(s)
Hello OFers,

I am trying to add a source term in the energy equation (see image) for simulating a lid driven cavity. This involves second partial derivative of Temperature.

For this, I am doing something like this:

Code:

volVectorField gradT = fvc::grad(T);
volScalarField Ty = gradT.component(1); // T_y
volVectorField gradT2 = fvc::grad(Ty); // (T_xy, T_yy, T_zy)
volScalarField Tyy = gradT2.component(1); // T_yy

Is this correct? Or what can be the correct way to do it?

Santiago February 11, 2018 13:58

Quote:

Originally Posted by Tempest (Post 680701)
Hello OFers,

I am trying to add a source term in the energy equation (see image) for simulating a lid driven cavity. This involves second partial derivative of Temperature.

For this, I am doing something like this:

Code:

volVectorField gradT = fvc::grad(T);
volScalarField Ty = gradT.component(1); // T_y
volVectorField gradT2 = fvc::grad(Ty); // (T_xy, T_yy, T_zy)
volScalarField Tyy = gradT2.component(1); // T_yy

Is this correct? Or what can be the correct way to do it?

Isnt that a laplacian? OF implements a laplacian object in the fvm/fvc namespace


All times are GMT -4. The time now is 08:16.