|
[Sponsors] |
Tensor manipulation for custom vector equation source term |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 19, 2021, 04:59 |
Tensor manipulation for custom vector equation source term
|
#1 |
Member
Andrea Di Ronco
Join Date: Nov 2016
Location: Milano, Italy
Posts: 55
Rep Power: 9 |
Hi!
In a solver I'm working on I need to perform some algebraic manipulation of tensors in order to build a source term for a vector equation. More specifically, I need to implement this expression: Where is an additional velocity field for which the equation is solved, and is the standard fluid velocity field. I thought it could be useful to write the same expression in vector form in order to directly implement it as a vector equation. With some manipulation where the operation is intended element-wise. Now I'm faced with at least a couple of issues: 1) assemble the tensor 2) perform the operation 3) perform the matrix product between and Due to my somewhat limited knowledge of the OpenFOAM library, for the moment I neglected 2). What I came up with is: Code:
fvVectorMatrix F(fvc::grad(U) - diag(fvc::grad(U)) & (U - V)); Code:
error: no match for ‘operator-’ (operand types are ‘Foam::tmp<Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh> >’ and ‘Foam::tmp<Foam::Field<Foam::DiagTensor<double> > >’) fvVectorMatrix F(fvc::grad(U) - diag(fvc::grad(U)) & (U - V)); Does anyone know how to properly extract/subtract the diagonal contribution from a volTensorField object? In my limited experience, I couldn't find any other related function. Furthermore, how can I perform the element-wise operations described in 2)? Or maybe I'm just following the wrong road and someone knows a better way to perform my task. Of course any advice or observation would be greatly appreciated! Regards, Andrea |
|
Tags |
tensor |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Other] Tabulated thermophysicalProperties library | chriss85 | OpenFOAM Community Contributions | 62 | October 2, 2022 03:50 |
Source Term due to evaporation in energy transport equation | styleworker | OpenFOAM Programming & Development | 3 | September 7, 2022 03:09 |
Source term for EVAPORATION in Energy Equ. - technical difficulty ? | Kummi | OpenFOAM | 1 | September 9, 2019 09:32 |
polynomial BC | srv537 | OpenFOAM Pre-Processing | 4 | December 3, 2016 09:07 |
DxFoam reader update | hjasak | OpenFOAM Post-Processing | 69 | April 24, 2008 01:24 |