Comments (6)
Hi @ainafp
Thank you for your nice words.
Right now, you can only have the main diagonal of a tensor in the diffusion coefficient. For instance, for a 2D diffusion problem you can write:
L = 50; % domain length
Nx = 20; % number of cells
m = createMesh2D(Nx,Nx, L,L);
D_x = 1;
D_y = 20;
D = createFaceVariable(m, [D_x, D_y]);
Mdiff = diffusionTerm(D);
or alternatively
L = 50; % domain length
Nx = 20; % number of cells
m = createMesh2D(Nx,Nx, L,L);
D_x = 1;
D_y = 20;
D = createFaceVariable(m, 0.0);
D.xvalue(:) = D_x;
D.yvalue(:) = D_y;
Mdiff = diffusionTerm(D);
from fvtool.
@ainafp
Apparently, it is possible to diagonalize the diffusion tensor by finding the right coordinate.
from fvtool.
ok thanks! I'll try to do it diagonalizing and otherwise I will extend it to use a matrix.
Thank you for being so responsive! I saw you added the example to the toolbox too.
from fvtool.
Please feel free to submit a PR if you manage to extend the code. I forgot to link the example. It's good that you saw it yourself!
from fvtool.
Hello!
I am trying to input the tensor finally, entering vectors instead of scalars in xvalue, yvalue and zvalue.
Can I do it as FaceVariable? Or should I do some kind of mean like harmonicMean?
I am not sure I understand the difference between face and center of the cells.
Thank you in advance!
from fvtool.
Hi @ainafp
The fluxes are calculated on the interfaces between finite volume cells. Usually, the value of, e.g., concentration on the interface (or what I call a face variable) is calculated by linearly interpolating between the values of concentration in the neighboring cells. Also, the transport coefficients need to be calculated on the cell interfaces, that is done by using one of the averaging methods.
To answer your question about using a FaceVariable or averaging an scalar to get the FaceVariable, it depends on your specific problem. My guess is, you need to define the FaceVariable and assign the values of your diagonal tensors [ax, ay, az]
to the FaceVariable, i.e.,
F = createFaceVariable(m, [ax, ay, az]);
which automatically assigns ax, ay, and az, to xvalue, yvalue, and zvalue of a FaceVariable, respectively.
P.S. I have written a post about the transport coefficients here
from fvtool.
Related Issues (20)
- A bug in 3D Cartesian TVD scheme
- Convenience functions for spatially variable cell and face variables
- diffusion equation HOT 4
- What's the difference between Cylindrical2D and Radial2D? HOT 2
- solving reaction-diffusion(-advection) equations? HOT 2
- convection diffusion with time-space dependent coefficients HOT 11
- Implicit vs explicit Euler HOT 6
- Spherical coordinates not working HOT 6
- Changing bounds of mesh HOT 4
- Radial (R, Theta) and 3D cylindrical (R, Theta, Z) coordinates HOT 1
- advection-diffusion-reaction HOT 7
- single phase flow and transport HOT 4
- Size o linear system of equations HOT 1
- 1D heat transfer through the composite wall HOT 5
- Spherical coordinate
- Non-uniform grid support HOT 1
- Add mesh visualization functionality HOT 1
- Boundary conditions HOT 2
- Explicit integration transport equation 1D HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fvtool.