# Very Imortant for every one using OpenFoam

 Register Blogs Members List Search Today's Posts Mark Forums Read

 September 24, 2010, 06:02 "nu" term in UEqn #1 Senior Member   Join Date: Sep 2010 Location: France Posts: 194 Rep Power: 7 1- Is how to change the "nu" in the icOFoam solver to a new one nu_new that depends on another scalarField C which also to be solved. For example: In UEqn i have the "fvm::laplacian(nu, U)" but i need to put nu = 1-C/5; where C is another Scalarfield to be solved after PISO loop in the C_scalar_Equation: solve ( ddt(C)+div(phi,C)=div(J); ) 2-How to do if i need to define the BC for the C field, where one of the patches is (J=0), J exists in the C_scalar_Equation and it is a vectorField. 3-Does in the PISO loop , it does for just one dt, or it does it for all, so if at each time step i want to update my C, it is OK to solve C_scalar_Equation after the PISO loop, or what? thanks a lot Last edited by T.D.; September 27, 2010 at 06:02.

 September 24, 2010, 11:55 #2 Senior Member   David Gaden Join Date: Apr 2009 Location: Winnipeg, Canada Posts: 397 Rep Power: 12 1. I don't have the source handy right now but I believe fvm::laplacian can take the first argument as either a scalar or a volScalarField. I would define nu_new as a volScalarField, according to your equation there. You will run into dimensional problems... what are the dimensions of C? If C has dimensions, you also have to give dimensions to the "1" in the 1-5/C equation. You could do an ugly work around with a dimensionless C using: Code: ```// nu_new is created previously dimensionSet nu_newDims(nu_new.dimensions()); nu_new.dimensions().reset(dimless); nu_new = 1 - 5 / C; nu_new.dimensions().reset(nu_newDims);``` Also, I think the 1-5/C part needs to change... I think the 1 needs to be something with pTraits:ne, or something like that (again, no source in front of me at the moment). 2 - Depends on the physics. If it is a scalar, just use zeroGradient, unless it is an inlet, then use a value you expect from the freestream. 3 - Not sure what you mean. You can do anything you want just before the runTime.write(), and you shouldn't interfere with the PISO loop.

September 24, 2010, 12:32
Hi
#3
Senior Member

Join Date: Sep 2010
Location: France
Posts: 194
Rep Power: 7
Quote:
 Originally Posted by marupio 1. I don't have the source handy right now but I believe fvm::laplacian can take the first argument as either a scalar or a volScalarField. I would define nu_new as a volScalarField, according to your equation there. You will run into dimensional problems... what are the dimensions of C? If C has dimensions, you also have to give dimensions to the "1" in the 1-5/C equation. You could do an ugly work around with a dimensionless C using: Code: ```// nu_new is created previously dimensionSet nu_newDims(nu_new.dimensions()); nu_new.dimensions().reset(dimless); nu_new = 1 - 5 / C; nu_new.dimensions().reset(nu_newDims);``` Also, I think the 1-5/C part needs to change... I think the 1 needs to be something with pTraits:ne, or something like that (again, no source in front of me at the moment). 2 - Depends on the physics. If it is a scalar, just use zeroGradient, unless it is an inlet, then use a value you expect from the freestream. 3 - Not sure what you mean. You can do anything you want just before the runTime.write(), and you shouldn't interfere with the PISO loop.

Hi

really, my nu_new has the dimension of another predefined dimensionedScalar nu0, where nu_new=nu0*(1-5/C), and my C is dimensionless volScalarField, so can i multiply a dimensinedScalar term with another dimensoinless volScalarField, knowing later i am going to use the nu_new in the laplacian(nu_new,U)
??
What about using a new viscosityModel and implement it, that you advice? it is better, but if it can be solved without that it will be much more easier to me.

thanks a lot

 September 25, 2010, 17:22 #4 Senior Member   Alberto Passalacqua Join Date: Mar 2009 Location: Ames, Iowa, United States Posts: 1,889 Rep Power: 26 Using appropriate titles makes me more willing to answer... Btw, you asked the same question in another thread already. __________________ Alberto Passalacqua GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as live DVD/USB, hard drive image and virtual image. OpenQBMM - An open-source implementation of quadrature-based moment methods

September 26, 2010, 15:34
nu as function of another field in UEqn, + BC problem
#5
Senior Member

Join Date: Sep 2010
Location: France
Posts: 194
Rep Power: 7
Hi
execuse me for my repetition in other threads, and sorry for my titles
but the reason is that i am new here, and i am excited to learn

anyway thanks a lot, thank you so much alberto
I tried what you told me for nuEff, but i did not understand what you said about to Update nuEff?
so, i attached all my code, can you please just look at, and check if ok? thanks

I have another questions concerning , my term J, how can i apply a Patch for "c" but that depends on "J" value, for example BC for a wall for "c" field is [J=0]

Does My "c" field" in the code, is going to be updated at each dt?

Thanks a lot

T.D.

Quote:

Last edited by T.D.; September 26, 2010 at 18:12. Reason: add something+

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post msrinath80 OpenFOAM Running, Solving & CFD 18 March 3, 2015 06:36 wyldckat OpenFOAM Announcements from Other Sources 3 September 8, 2010 06:25 pete Site News & Announcements 0 June 29, 2009 05:56 jussi OpenFOAM Installation 0 April 24, 2008 14:25 oseen OpenFOAM Installation 9 August 26, 2007 13:50

All times are GMT -4. The time now is 18:23.