turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Navigation
- Simcenter
- Forums
- Blogs
- Knowledge Bases

- Siemens PLM Community
- Simcenter
- 3D Simulation - Simcenter 3D Forum
- Trouble using expressions for variable boundary co...

Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

Highlighted
#
##### Trouble using expressions for variable boundary condition NX 10 Adv Thermal Solver

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

2 weeks ago

Howdy Folks

The TLDR version:

Expression is:

(fd("T_infinity",time)+TEMPF("P1"))/2

TEMPF("P1") is meant to grab the temperature at "P1" during the solving process.

The dialog accepts the formula but when I try to create the field I get the following error:

"Specified Independent variables do not define a valid domain".

Full Version:

I'm using NX 10 Advanced Simulation (Thermal Solver Specifically) and I would like to create a formula for a boundary condition that changes depending on the surface temperature of the item being simulated.

My Goal: Create a formula of the form: T_avg=(T_infinity(time)+T_surface(time))/2.

T_infinity is a table field of the form (time,temperature).

I created a point on my geometry "Menu->Insert->Model Preparation->Point ->(Inferred-choose point on part)".

Right Click on the point -> properties -> change to "general" tab and enter a name, say "P1" (no quotes).

Finally right click on fields -> New Fields -> Formula

Choose "Time" for the independent domain and "Temperature" for the dependent domain.

Expression is:

(fd("T_infinity",time)+TEMPF("P1"))/2

The dialog accepts the formula but when I try to create the field I get the following error:

"Specified Independent variables do not define a valid domain".

I have tried adding Default/Max/Min to the independent domain fields but that does not appear to help.

I know this can be done with an external fortran script that works with the tmg solver but I was hoping for a way to do it in the NX environment.

Thanks all for taking the time, I look forward to any responses.

Austin

Labels:

5 REPLIES

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

a week ago

Hi Austin,

TEMPF is evaluated at solve time, so you won't be able to use that in a field. Field inputs have to be evaluated prior to solve time. All solver evaluated functions need to be included in expressions used by loads.

Note too that as of version 11, you can't add temperatures. The following online help article explains the special treatment that temperatures receive with respect to expressions.

If you have a test model, I'd be interested in looking at it to see if your problem can be solved within the product. What sort of boundary condition does the average temperature act as an input to? For instance, does it act as an input to an evaluation of another field that is only temperature dependent?

Regards,

Mark

Mark Lamping

Simulation Product Management

Simulation and Test Solutions

Siemens Industry Sector

Siemens Product Lifecycle Management Software Inc.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

a week ago

Mark,

Thanks for your reply. Because TEMPF is not a valid expression function is that why the domain error is occuring? I was under the impression TEMPF was a valid expression input as it is one of the auto-generated ones. In what context could this (or ug_var("temperature")) be used as an expression input? When you say "all solver evaluated functions need to be included in expressions used by loads" does that mean structural only?

The average temperature is meant to be an input into an expression for convection coefficient. I wanted to create an expression similar to h=f(velocity(time),(Tavg)) Where Tavg is (Tinfinity(time)+Tsurface(from solver))/2

Most of the NX convection objects require the convection coefficient "h" as an input (IE thermal stream, Convection to environment, and thermal convecting zone). Convection to environment -> Forced convection to environment allows the user to select a correlation for external flow and then the user specifies other variables including velocity. However there is no option for the velocity to be time dependent.

I can create temperature-dependent values of h at discrete times and arrange them all in a time-dependent table of fields, but depending on how velocity varies with time that could result in alot of tables. I was hoping there was a way around creating that many tables as it can get cumbersome.

Now I understand that evaluating the properties of air at Tavg vs Tinfinity is probably not going to change my convection coefficient that much, but it seemed like something that could be done simply using expressions, though that does not seem to be the case.

I look forward to your reply and thank you for your time,

Austin

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

a week ago

Austin,

My apologies if this rambles. There’s a lot going on.

I believe the invalid independent domain error while creating the field is indeed due to TEMPF being evaluated at solve time. That is, the value of TEMPF is unknown until the solve is run. The field wants to return an answer with respect to the expression, but it can’t because TEMPF has no value until the solve is performed. The error may not be the correct error, but I’m sure that TEMPF being un-evaluate able is giving the field a problem.

TEMPF is a valid input to a thermal load’s expression. So, for example, a stream’s inlet temperature can be defined as TEMPF(“RefPt1”), where RefPt1 is a point in the model. The stream’s temperature will be sent to the solver as an analytical expression rather than as a real value (or vector of real values for transient). This is possible because the Simcenter Thermal solver supports expressions as input. The structural solver (i.e. NX Nastran) doesn’t support the use of analytical expressions for load magnitudes where some of the expression’s inputs are evaluated at solve time. It requires tabular real data for transients fully defined prior to solve time. The tabular real data is generated when the NX Nastran input file is created. Now, you can define a load for NX Nastran inside Simcenter as an expression, F(t), but the inputs to F(t) have to resolve to real values prior to solve time.

You are correct that a forced convection requires a constant velocity. I tried to define a forced convection with a transient velocity anyway. I defined a velocity as a field and specified my expression for the forced convection’s velocity as FD(“Velocity”), where FD() is a function that converts a field for use in an expression. Unfortunately, I received an error stating that the velocity has to be a constant. So, you are right about a forced convection’s velocity needing to be a constant. So then I decided to try to define the forced convection using a stream. A stream accepts mass flow as input, so I needed to use my velocity field as part of a function that evaluated to mass flow. The stream’s mass flow expression was defined as:

fd("Velocity")*1kg/1mm kg/s

But, the Forced Convection requires material (i.e. density) and temperature (to evaluate temperature dependent density), so it amounts to a mass flow as well. It seems that you can do what you need with the stream.

Introducing your need for an average temperature gets more complicated. But you can compute average temperatures using the function AVG. In a test model I defined 2 reference points on edges and used those temperatures in a temperature constraint. My expression for the average temperature was:

AVG(TEMP(“RefPt1”), TEMP(“RefPt2”))

That means, your HTC expression could use the AVG function if you can provide it discrete temperatures. Finally, I specified a time history of temperature over time to represent TInfinity. That worked too. I was able to specify a temperature expression as:

AVG(TEMP(“RefPt1”), FD(“TInfinity”)), where TInfinity was a time based field.

I’m not sure yet if your specific use case is addressed or not. It may require a user defined plugin function to gather up the appropriate inputs to produce the desired HTC. That is possible too with some coding on the user's side. A user defined plugin is implemented in Simcenter as a DLL that is referenced in the customer defaults. All functions in the DLL can be used in expressions to evaluate loads.

Regards,

Mark

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Wednesday

Mark,

It took me a few reads but I finally understood that the built-in "TEMP" function is valid only for "Thermal Load" objects. I'm not sure what the difference is between "Convection to Environment" as a constraint and "Thermal Convecting Zone" as a load object aside from the swirl options in the latter. I'll have to dig into that.

I looked at the thermal stream object but since it still required an expression for H I couldnt think of a reason to use it over the "Thermal Convecting Zone", which is what I went with. I've managed to pass the expression syntax checker and now I'm having problems with the INPF file while I try to solve. That may be more appropriate for another thread and I'm going to try shortening my entry but for now I did the following for H.

Total Formula

C1*((rho*vel/mu)^(4/5))*k*(Pr^(1/3))*(5/4)

C1 represents several constants

rho= fd("rho_tab",T_Avg)

vel= (fd("Vel_tab",time))

mu= (fd("Mu_tab",T_Avg))

k= (fd("K_tab",T_Amb))

Pr = (fd("Pr_Tab",T_Amb))

T_Amb = (fd("Ambient_Tab",time))

T_Avg= ((TEMP("SURF")+T_Amb)/2) where 'SURF' is the name of the point I created.

I had to import material property tables. NX sees them as Temperature dependent and unitless.

I pasted the formula into the "extended text" option for "H" and then substituded the expressions for rho, vel, etc.

This passes the syntax check.

Trying to solve I get the following error:

Cpu time= 0.1 DATACH Module

Performing data checking...

** FATAL **

** Element group Conv contains no elements.

** FATAL **

** Run aborted due to errors.

** FATAL **

** Error in TMG input file INPF:

** error in field 4 of following line 999

ZONE_CONVECTION 2 SELECTION "Conv"

** FATAL **

** Error in TMG input file INPF:

** The above Card9 line no. 198 has an error in it.

Run aborted due to fatal errors.

Here "conv" is the name of the load in the simulation tree. I checked the INPF file and sure enough no elements listed.

If i change the expression to C1*Vel the sim runs just fine (INPF lists the elements selected).

If I change the expression to C1*TEMP('SURF') the solver runs (INPF lists the elements selected) but it gives me the following error:

** FATAL ** ** The named point 'SURF' ** used in the function 'TEMP' does not exist. ** Please check the named points names.

It does however properly list the selected elements in the INPF file. Am I supposed to do something special to pass the point name to the solver? Is there a limit to what NX can/will write for the "extended text"? Total formula length works out to 481 charachters (my field names are longer).

I'm going to fiddle with this a bit, see if I can make it work. Any additional insights would be much appreciated. Also at this point I'm not sure if this is a separate topic? I can always mark the syntax problem as fixed and make a new post for the INPF problems.

I can do this in a user-specified DLL, the hope was that this approach would be easier to use across different simulations. Also the user DLL's (from what I understand) will fail in a multiple-core solve unless the dll is created with multi-core fortran, which is way over my head.

Thanks a million,

Austin

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Thursday

Hello Austin,

Sorry for jumping in so late. The issue is that you are for until SC12, you could NOT use solution-dependent variable for looking up a Table Field. (You now can in SC12....)

The current workaround is to write a user-defined function and compiling it. See below documentation on how to do this:

Make sure to check your Microsoft if you have problem compiling the .dll.

Just a small taste if ever you'd consider jumping to SC12..

Cheers,

Jacques

Follow Siemens PLM Software

© 2018 Siemens Product Lifecycle Management Software Inc