Skip to content
Snippets Groups Projects
Commit e23f838d authored by Pierre Augier's avatar Pierre Augier
Browse files

fluidsimfoam_multi_region_snappy: all files generated

parent b8acea34
No related branches found
No related tags found
1 merge request!89fluidsimfoam-multi-region-snappy
Pipeline #68217 failed
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object controlDict;
}
application chtMultiRegionFoam;
startFrom latestTime;
startTime 0.001;
stopAt endTime;
endTime 75;
deltaT 0.001;
writeControl adjustable;
writeInterval 15;
purgeWrite 0;
writeFormat ascii;
writePrecision 7;
writeCompression off;
timeFormat general;
timePrecision 6;
runTimeModifiable true;
maxCo 0.3;
maxDi 10.0;
adjustTimeStep yes;
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object decomposeParDict;
}
numberOfSubdomains 6;
method scotch;
......@@ -5,5 +5,5 @@
class dictionary;
object decomposeParDict;
}
numberOfSubdomains 6;
numberOfSubdomains 4;
method scotch;
......@@ -9,1 +9,18 @@
method scotch;
regions
{
heater
{
numberOfSubdomains 1;
method simple;
coeffs
{
n
(
1
1
1
);
}
}
}
......@@ -52,8 +52,9 @@
if code is False:
return
with open(self.output.path_run / self.rel_path, "w") as file:
file.write(code)
path = self.output.path_run / self.rel_path
path.parent.mkdir(exist_ok=True)
path.write_text(code)
@abstractmethod
def generate_code(self):
......@@ -71,8 +72,7 @@
return read_field_file(path)
def overwrite(self, dumpable):
with open(self.output.path_run / self.rel_path, "w") as file:
file.write(dumpable.dump())
(self.output.path_run / self.rel_path).write_text(dumpable.dump())
class FileGenerator(FileGeneratorABC):
......
......@@ -278,7 +278,7 @@
"tasks.py missing in solver templates_dir "
f"{self.input_files.templates_dir}"
)
shutil.copy(path_tasks_py, self.sim.path_run)
shutil.copy(path_tasks_py, self.path_run)
for file_generator in vars(self.input_files).values():
if hasattr(
......@@ -287,6 +287,12 @@
# system files are already generated
file_generator.generate_file()
if hasattr(self, "internal_symlinks"):
for relative_path, target in self.internal_symlinks.items():
path_symlink = self.path_run / relative_path
path_symlink.parent.mkdir(exist_ok=True)
path_symlink.symlink_to(target)
@classmethod
def _complete_params_block_mesh_dict(cls, params):
default = {
......
......@@ -124,7 +124,7 @@
)
internal_symlinks = {}
for path in path_case.glob("**/*"):
for path in path_case.rglob("*"):
if not path.is_symlink():
continue
path_resolved = path.resolve()
......@@ -233,7 +233,8 @@
path_in_saved_case.parent.mkdir(exist_ok=True)
path_in_saved_case.write_text(code)
path_template = (path_templates / relative_path).with_suffix(".jinja")
path_template = path_templates / relative_path
path_template = path_template.with_name(path_template.name + ".jinja")
path_template.parent.mkdir(exist_ok=True)
path_template.write_text(code_template)
......
......@@ -42,6 +42,10 @@
""".strip().split(
"\n"
)
# advanced solver (multiRegion + snappyHexMesh)
main_tutorials.append(
"heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater"
)
path_foam_tutorials = Path(path_foam_tutorials)
path_main_tutorials = [
path_foam_tutorials / rel_path.strip() for rel_path in main_tutorials
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment