[solved]differentiation in one direction
Does anyone of you know what is the best way to dicsretize following problem:
we have: f(x,y) -- scalar function
we need: f_xxxx
(fourth order) differentiation but only in one direction.
laplacian(f) = f_xx + f_yy
but I need only f_xx (in fact I need f_xxxx)
You should use a difference quoutient, like you have propably seen for f_x. You can perform the difference quotient "four" times or you can have a look here (they have already done it for you):
Probably it should be the best for you to read the whole article, but you can also jump ahead to:
This I know.
I didn't put it explicit in my question but I need to know how to make it in OpenFOAM.
so far I found such explicit solution:
volVectorField gradT=fvc::grad(T); // (T_x, T_y)
volScalarField Txxxx = gradT.component(0); // T_x
gradT = fvc::grad(Txxxx); // (T_xx, T_xy)
Txxxx = gradT.component(0); // T_xx
gradT = fvc::grad(Txxxx); // (T_xxx, T_xxy)
Txxxx = gradT.component(0); // T_xxx
gradT = fvc::grad(Txxxx); // (T_xxxx, T_xxxy)
Txxxx = gradT.component(0); // T_xxxx
Maybe someone have some better idea ?
Is it possible to descritize T_xxxx implicitly ?
It seems that problem can be solved (after Akidess suggestion ):
"... it sounds like you want anisotropic diffusion - why not just pass a diffusion coefficient tensor to laplacian instead of a scalar?..."
x - direction diffusion:
DTe1D DTe1D [ 0 2 -1 0 0 0 0 ] (3e-02 0 0 0 0 0 0 0 0 );
x,y and - directions diffusion:
DTe3D DTe3D [ 0 2 -1 0 0 0 0 ] (3e-02 0 0 0 3e-02 0 0 0 3e-02 );
for f_xxxx it can be done as follows :
suppose we have equation f_xxxx = g(x,y),
substitution: h = f_xx
so we have two "one-directional" Poison equations to solve:
h_xx = g(x,y)
f_xx = h(x,y)
fvm::laplacian(DTe1D, h) == g
fvm::laplacian(DTe1D, f) == h
|All times are GMT -4. The time now is 16:47.|