CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

How to add source term and material derivative of log(T) in openFaom.

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By alexeym

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 26, 2021, 09:13
Default How to add source term and material derivative of log(T) in openFaom.
  #1
Member
 
idrees khan
Join Date: Jun 2019
Posts: 36
Rep Power: 7
idrees khan is on a distinguished road
Hi Dear's


I'm adding non-isothermal Oldroyd-B model to viscoelasticFluidFaom solver the stress equation(using Oldroyd-B model) for isothermal case is like so,
Code:
// Stress transport equation
    fvSymmTensorMatrix tauEqn
    (
        fvm::ddt(tau_)
      + fvm::div(phi(), tau_)
     ==
      
        etaP/lambda*twoD
      + twoSymm(C)
      - fvm::Sp(1/lambda, tau_)
    );
tauEqn.relax();
tauEqn.solve();
}

But for non-isothermal case in the stress equation
Code:
//-  WLF to update viscosities for temperature dependence
    volScalarField lambda = Foam::exp( -C11_*(T - To_) / (C21_ + T - To_) )*lambda_;
    volScalarField etaP   = Foam::exp( -C11_*(T - To_) / (C21_ + T - To_) )*etaP_;
there is a term (
Code:
lambda*tua_*D(log(T))/Dt
where Lambda is relaxation time which also depends upon temperature i.e as define above ) means multiplication of relaxation time lambda(T) tau_ and material derivative of log(T) please have a look of screenshot)



my question is how to define it in openFoam term
Code:
  lambda*tua_*D(log(T)/Dt
rest of the equation is same as given above.


if i define it like
Code:
volScalarField  logT = log(T);
Code:
// material derivative term of log(T) in multiplication with tau_
       fvc::ddt(tau_/lambda,logT) +fvc::div(phi()*tau_,logT/lambda)
which is wrong beacause this:
Code:
 fvc::div(phi()*tau_,logT),
phi is a surface field that are multiplying a volumetric field,I'm getting erorr's while compiling


if define like so
Code:
volScalarField  logT = log(T);
// material derivative term of log(T) in multiplication with tau_
Code:
tau_*fvc::ddt(1/lambda,logT) + tau_*fvc::div(phi(),logT/lambda)
But I'm not sure although it compile successfully by running "wmake libso"
but give me and error when I'm running the solver saying
Code:
argument of transcendental function is not dimensionless
which is i think because of the declaration of
Code:
volScalarField  logT = log(T);
but if I'm not declaring it like so it doesn't compile with "wmake libso"

what i'm thinking just like we define material derivative in momentum eqaution i.e DU/Dt which is wrtten in openFaom

Code:
fvm::ddt(U) +fvm::phi ,U)
here U is a variable to whom we are taking the derivative.
so I'm applying the same track for
Code:
  lambda*tua_*D(log(T)/Dt
also i want to add the source term to momentum eqaution,
source term
Code:
F=g*Cb(T - To)
where F is is the body force due to thermal convection with g gravitational accelaration and Cb thermal expansion
i write
Code:
fvm::Sp(g*Cb, T)   - g*Cb*To   or fvc::Sp(g*Cb, T)   - g*Cb*To and simply  (g*Cb(T - To))
but getting error's (Have a look screenshot please)


regards
idrees
Attached Images
File Type: png Screenshot of consitutive eqaution.png (41.1 KB, 9 views)
File Type: jpg Erro from adding source term.jpg (167.2 KB, 9 views)
idrees khan is offline   Reply With Quote

Old   January 27, 2021, 15:32
Default
  #2
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

1. There is fvc::DDt(phi, Field). Here is a link to Foundation's documentation (fvc::DDt), guess, foam-extend has something similar.
2. To use T in log, T should be dimensionless. Either divide the field by 1K, or do something more appropriate.
3. Error screenshot is irrelevant. Post simple text of the whole error. But it seems, you have tried to add different types of fields (ex. vector and tensor).
idrees khan likes this.
alexeym is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to Add the material derivative of log(T) in the constitutive equation's. idrees khan OpenFOAM Programming & Development 5 January 21, 2021 08:57
curvature correction term, material derivative of a tensor volker OpenFOAM Programming & Development 7 June 3, 2010 09:08
UDF Scalar Code: HT 1 Greg Perkins FLUENT 8 October 20, 2000 13:40
UDFs for Scalar Eqn - Fluid/Solid HT Greg Perkins FLUENT 0 October 14, 2000 00:03
UDFs for Scalar Eqn - Fluid/Solid HT Greg Perkins FLUENT 0 October 11, 2000 04:43


All times are GMT -4. The time now is 07:20.