Updates an existing boundary with the provided information
Updates the boundary with the given info, returns a json object of the updated case. The data field is optional, do note that the target boundary will be completely replaced by the information in this call. For example, not filling in a property field in 'data' will delete all the already existing properties on this boundary.
Returns: a json object with the updated boundary
:param int boundary_Id:
the id of the boundary that you want to update
:param string boundary_name:
the new name you want the boundary to have (can be the same as the old one)
:param string boundary_type:
the boundary type you want this boundary to have, 'fixedTemperatureWall' -- 'heatedWall' -- 'externalWall' -- 'insulatedWall' -- 'cyclic'
:param string data:
this field is optional, contains all data concerning the boundary, this should be a string object in json format. An example is the following:
json.dumps({
"boundaryType": "fixedFlowRateInlet",
"properties": {
"T": 293,
"U": 0.2,
"emissivity": 1,
"absorptivity": 0.9
},
"stl": "https://s3.direct.eu-de.cloud-object-storage.appdomain.cloud/stage-helios-case/cases/805/52ee9602-818c-452b-8f57-ab7e872fd310.stl",
"step": "https://s3.direct.eu-de.cloud-object-storage.appdomain.cloud/stage-helios-case/cases/805/3c63fa2b-fb25-4d0a-be62-cc72ce1b80f9.step",
"name": "fixedFlowRateInlet",
"id": 10173
})
Python code for the function to update the boundary:
def update_boundary(self, boundary_Id, boundary_name, boundary_type, data="{}") -> Dict:
boundary_url = self.caseserver_url + "/boundaries/" + str(boundary_Id)
payload = json.dumps({"name": boundary_name,"boundaryType": boundary_type, "data": data})
response = requests.put(boundary_url, data=payload, headers=self.put_header)
if(response.ok):
print("boundary update successful: \n", response.text, "\n")
return response.json()
else:
logger.error(f"boundary update failed: {response.content}")
raise Exception