|
[Sponsors] |
![]() |
![]() |
#1 |
New Member
Alexis Courtais
Join Date: Feb 2018
Posts: 3
Rep Power: 8 ![]() |
Hi everyone,
I am trying to implement the following equation within OpenFOAM (Ua is the adjoint velocity) : - ![]() ![]() ![]() ![]() ![]() ![]() ![]() I tried the following implementation but I'm not sure it computes the adjoint equation above Code:
volTensorField gradU (fvc::grad(U)); volVectorField adjointTransposeConvection2(gradU.T() & Ua); tmp<fvVectorMatrix> tUaEqn ( fvm::div(-phi, Ua) +fvm::Sp(fvc::div(phi),Ua) + adjointTransposeConvection2 +turbulence->divDevReff(Ua) == fvOptions(Ua) ); fvVectorMatrix& UaEqn = tUaEqn.ref(); UaEqn.relax(); fvOptions.constrain(UaEqn); solve(UaEqn == -fvc::grad(pa)-2*tau*fvc::laplacian(nu,U)); Thanks in advance. Berilmun |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Senior Member
Andrew Somorjai
Join Date: May 2013
Posts: 175
Rep Power: 13 ![]() |
Quote:
|
|
![]() |
![]() |
![]() |
![]() |
#3 |
New Member
Alexis Courtais
Join Date: Feb 2018
Posts: 3
Rep Power: 8 ![]() |
||
![]() |
![]() |
![]() |
![]() |
#4 | |
Senior Member
Andrew Somorjai
Join Date: May 2013
Posts: 175
Rep Power: 13 ![]() |
Quote:
![]() ![]() Code:
template<class BasicTurbulenceModel> Foam::tmp<Foam::fvVectorMatrix> Foam::linearViscousStress<BasicTurbulenceModel>::divDevRhoReff ( volVectorField& U ) const { return ( - fvc::div((this->alpha_*this->rho_*this->nuEff())*dev2(T(fvc::grad(U)))) - fvm::laplacian(this->alpha_*this->rho_*this->nuEff(), U) ); } nuEff() is the effective viscosity. dev2 is line 115 from https://www.openfoam.com/documentati...8C_source.html Just use -fvm::laplacian(nu, Ua). |
||
![]() |
![]() |
![]() |
![]() |
#5 | |
New Member
Alexis Courtais
Join Date: Feb 2018
Posts: 3
Rep Power: 8 ![]() |
Quote:
Do you have a tip to modeling the term ( ![]() |
||
![]() |
![]() |
![]() |
![]() |
#6 |
Senior Member
Andrew Somorjai
Join Date: May 2013
Posts: 175
Rep Power: 13 ![]() |
Quote:
from here Understanding fvm::Sp() What exactly is that term by the way, is Ua the flux? |
|
![]() |
![]() |
![]() |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Current conservation equation implementation | miguelmontenegro | Fluent UDF and Scheme Programming | 3 | July 3, 2024 08:21 |
Convective term in heat equation for rotating solids | vabishek | OpenFOAM Programming & Development | 8 | June 24, 2020 12:10 |
mass flow in is not equal to mass flow out | saii | CFX | 12 | March 19, 2018 06:21 |
Pressure distribution on a wall | darazsbence | CFX | 17 | October 6, 2015 11:38 |
Diffusion Equation | izardy amiruddin | Main CFD Forum | 2 | July 4, 2002 09:14 |